recyclerView. setLayoutManager(new LinearLayoutManager(this)); recyclerView. addItemDecoration(new ItemDecorator(-80)); This causes top item to stack lowest and next item after the top item overlaps it.
Update single item Change the "Sheep" item so that it says "I like sheep." String newValue = "I like sheep."; int updateIndex = 3; data. set(updateIndex, newValue); adapter. notifyItemChanged(updateIndex);
Expandable RecyclerView is one of the most important feature in Android which can be easily created for our application . It contains two views one is parent view and other is child view. Parent is visible by default but the child view has to be expanded and collapsed. It will expand when we click on parent view.
I am adding an item to recyclerview position 0 programamticly
public void addQuestion(Question question){
this.questionList.add(0, question);
notifyItemInserted(0);
}
This is working very well and the items do appear in the list at top BUT the user has to scroll up to see the new item.
Is there any trick how the item appear at top and recyclerview is scrolling up automaticly ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With