Skip to main content

Posts

Showing posts from November, 2016

Featured post

Simple RecyclerView example with filter option in Android

Hi Guys, Maybe you all are expert in terms of using RecyclerView in android. This blog is simple example for using filter option with RecyclerView adapter. As for now you will instantiate RecyclerView and set the adapter to RecyclerView as following way. RecyclerView list = (RecyclerView) findViewById(R.id.list); list.setLayoutManager(new LinearLayoutManager(this)); list.setHasFixedSize(true); ArrayList&ltNumber&gt numbers = new ArrayList&lt&gt(); String ONEs[] = {"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN"}; String TENs[] = {"ZERO", "TEN", "TWENTY", "THIRTY", "FOURTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY", "HUNDRED"}; String HUNDREDS[] = {"ZERO", "HUNDRED", "TWO HUND

Dynamically change ListView to GridView and Vice Versa using RecyclerView

We can change the RecyclerView from type of ListView to GridView in single line of code. 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: I hope this post is useful to you. kindly share your feedback as comment here. 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