We can change the RecyclerView from type of ListView to GridView in single line of code.
Video output of sample project
code is:
Video output of sample project:
I hope this post is useful to you. kindly share your feedback as comment here.
Thank You
Video output of sample project
code is:
private void setLayoutManager() { if (mColumnCount <= 1) { mColumnCount = 1; recyclerView.setLayoutManager(new LinearLayoutManager(context)); } else { recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount)); } }
Video output of sample project:
Simple RecyclerView example in Android
Simple RecyclerView example with filter option in Android
Simple recyclerview example with checkbox in Android
Source code on GitHub
Thank You
Comments
Post a Comment