LinearLayoutManager mLayoutManager = new LinearLayoutManager(this);
mLayoutManager.setReverseLayout(true);
mLayoutManager.setStackFromEnd(true);
// Set the layout manager to your recyclerview
recyclerView.setLayoutManager(mLayoutManager);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class FilterableListAdapter<T, VH : RecyclerView.ViewHolder>( | |
diffCallback: DiffUtil.ItemCallback<T> | |
) : ListAdapter<T, VH>(diffCallback), Filterable { | |
private var originalList: List<T> = currentList.toList() | |
override fun getFilter(): Filter { | |
return object : Filter() { | |
override fun performFiltering(constraint: CharSequence?): FilterResults { | |
return FilterResults().apply { |