You do not need to use a 3rd party library to make chips.
A chip is basically a TextView
with a rounded background. You can add a delete button and an ImageView
also to create a view such as the one used for Google contacts.
For the purposes of the example I will only use a simple TextView
. First create the UI for the chip.
-> shape_chip_drawable.xml
In your activity layout file, just define this drawable resource file as the TextView
background like this:
This is the view which is created:
Now we can use HorizontalScrollView
to display a row of chips (like GooglePlay application) or use StaggeredGridLayoutManager
to build a staggered grid of chips.
[EDIT]
If you want to show the chips as a FlowLayout
, which is not inherently supported in Android, we need to use a Library. Don't worry, its a very small change.
You have add the following line to your Gradle depencencies:
compile 'com.xiaofeng.android:flowlayoutmanager:1.2.3.2'
and set your recycler view layout manager with it:
recyclerView.setLayoutManager(new FlowLayoutManager());
Additional details here on GitHub
Have a great day! Do upvote if it helps.