This is my ExpandableRecyclerAdapter adapter.
public class MyAdapter extends ExpandableRecyclerAdapter<MyAdapter.ProductParentViewHolder, MyAdapter.ProductChildViewHolder> { private LayoutInflater mInflater; private Context context; private List<? extends ParentListItem> mParentItemList; public MyAdapter(Context context, List<ParentListItem> itemList) { super(itemList); mInflater = LayoutInflater.from(context); this.context = context; this.mParentItemList = itemList; } @Override public ProductParentViewHolder onCreateParentViewHolder(ViewGroup viewGroup) { View view = mInflater.inflate(R.layout.list_item_crime_parent, viewGroup, false); return new ProductParentViewHolder(view); } @Override public ProductChildViewHolder onCreateChildViewHolder(ViewGroup viewGroup) { View view = mInflater.inflate(R.layout.list_item_crime_child, viewGroup, false); return new ProductChildViewHolder(view); } @Override public void onBindParentViewHolder(ProductParentViewHolder crimeParentViewHolder, int i, ParentListItem parentListItem) { Product product = (Product) parentListItem; crimeParentViewHolder.productName.setText(product.getBrandName() + " " + product.getProductName()); Glide.with(context) .load(product.getProductImagePath()) .placeholder(R.drawable.placeholder) .error(R.drawable.placeholder) .into(crimeParentViewHolder.thumbnail); } @Override public void onBindChildViewHolder(ProductChildViewHolder productChildViewHolder, int i, Object childListItem) { final ProductVariant productVariant = (ProductVariant) childListItem; productChildViewHolder.mCrimeDateText.setText(productVariant.getVariantName()); productChildViewHolder.variantMrp.setText(context.getString(R.string.positive_amount, productVariant.getMRP())); productChildViewHolder.variantMrp.setPaintFlags(productChildViewHolder.variantMrp.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); productChildViewHolder.variantSellPrice.setText(context.getString(R.string.positive_amount, productVariant.getSellPrice()));
When I am at the bottom of the page and click on the element that it expands, but the exapnded child is not displayed to the user because it is at the bottom of the screen.
I want to move this item to the screen and show the user advanced items.
How can i do this?
source share