How to Add Material Chip View in Android Projects

Now social media is on hike and many of social apps are creating but if you want your app also goes on hike then you should think different from other developers. For this perspective i came with Material chip view which can be used as tags for categories, contacts or creating text clouds.

How you can add Material chip view


Add following line of code to your module(app) level gradle file

compile 'com.robertlevonyan.view:MaterialChipView:1.0.1'



Recommended articles :


    app:mcv_chipText="@string/customTitle" />

Cutomizing Chip


alt text


alt text


alt text


alt text


Custom Atributes Description app:mcv_chipText Text label of Chip app:mcv_textColor Custom color for text labelapp:mcv_backgroundColor Custom background color app:mcv_selectedBackgroundColor Custom background color when selectedapp:mcv_hasIcon Chip with icon app:mcv_chipIcon Icon resource for Chip app:mcv_closable Chip with close button app:mcv_closeColorCustom color for close button app:mcv_selectable Chip with selection button app:mcv_selectedTextColor Custom color for label when selected app:mcv_selectedCloseColor Custom color for close button when selected

Setting Listeners

Chip chip = (Chip) findViewById(;

Chip click listener

chip.setOnChipClickListener(new OnChipClickListener() {
            public void onChipClick(View v) {
                //Your action here...

On Close button click listener

chip.setOnCloseClickListener(new OnCloseClickListener() {
            public void onCloseClick(View v) {
                //Your action here...

On Icon click listener

chip.setOnIconClickListener(new OnIconClickListener() {
            public void onIconClick(View v) {
                //Your action here...

On Select button click listener

chip.setOnSelectClickListener(new OnSelectClickListener() {
            public void onSelectClick(View v, boolean selected) {
                //Your action here...

Customizing Chip from Java

chip.setChipText(); // Set Chip label
        chip.setTextColor(); // Set Chip label color
        chip.changeBackgroundColor(); //Set custom background color
        chip.changeSelectedBackgroundColor(); //Set custom background color when selected
        chip.setHasIcon(); //Set chip has icon
        chip.setChipIcon(); //Set Icon Drawable for Chip
        chip.setClosable(); //Set Chip has close button
        chip.setCloseColor(); //Set custom color for close button
        chip.setSelectable(); //Set Chip has selection button
        chip.setSelectedTextColor(); //Set custom color for label when selected
        chip.setSelectedCloseColor(); //Set custom color for close button when selected

Hope you like this tutorial. Please comment below and share your thought with us.

By Tell Me How

It is a technology blog and admin has excellent experience in programming from 5+ year. You can contact us at

Share your thoughts

Leave a Reply

Loading Facebook Comments ...
Loading Disqus Comments ...