I have a recyclerView with n items. Each item is expandable onCLick of it. I want my item to expand as well as move to the top onCLick. Suppose if I click third item then it
You can do like this way: Create one method in adaptor as below.
public void swapeItem(int fromPosition,int toPosition){
Collections.swap(arrayList, fromPosition, toPosition);
notifyItemMoved(fromPosition, toPosition);
}
now on item click you can use like this way.
swapeItem(9,0); // here 9 is a clicked item position and 0 means at top of the list.
Moving to the top? Sure!