Questions tagged [android-chips]

Chips are compact elements that represent an input, attribute, or action. Chips allow users to enter information, make selections, filter content, or trigger actions. Chips should appear dynamically as a group of multiple interactive elements. Unlike buttons, which should be a consistent and familiar call to action, one that a user expects to appear as the same action in the same general area.

The Chip android component is provided by the Material Components Library.

A Chip represents a complex entity in a small block, such as a contact. It is a rounded button that consists of a label, an optional chip icon, and an optional close icon. A chip can either be clicked or toggled if it is checkable.

Chips may be placed in a ChipGroup, which can be configured to lay out its chips in a single horizontal line or reflowed across multiple lines. If a chip group contains checkable chips, it can also control the multiple-exclusion scope for its set of chips so that checking one chip unchecks all other chips in the group.

240 questions
16
votes
2 answers

How to change the shape of Chips component in android?

When I added ChipGroup and Chips to XML, first it gave me rendering issue which caused activity crash. I solved it by changing the support library version in the gradle.app from implementation 'com.google.android.material:material:1.2.0-alpha05' to…
16
votes
5 answers

Dynamically create Choice Chip in android

I am using Material Components for creating the Choice chip. I have followed https://material.io/develop/android/components/chip/ document. There is enough stuff for creating a chip in XML but not get an idea of how to create choice chip…
15
votes
1 answer

Extra space on top and bottom of android Chip material component

I'm using Chip view in my layout Since upgraded material design component from 1.0.0 to 1.1.0, there is an extra space at the top and bottom of view I couldn't find any document about how to remove these spaces In material 1.0.0 In material…
13
votes
2 answers

Adding horizontal scrolling to chip group in Relative layout

I created few static chips in a group. I'm using this link (https://material.io/design/components/chips.html#) as reference. Code is as given below:
Ajay Kulkarni
  • 2,900
  • 13
  • 48
  • 97
12
votes
7 answers

Create chip with outline Jetpack Compose

I have the following composable function to build a Chip: @Composable fun CategoryChip( category: String, isSelected: Boolean = false, onSelectedCategoryChanged: (String) -> Unit, onExecuteSearch: () -> Unit ) { Surface( modifier =…
12
votes
5 answers

How to get selected chips from ChipGroup?

I search a lot on internet but couldn't find the exact solution. Here is the link that i last tried from SO. Get selected Chips from a ChipGroup I want to get selected chips from chip group when a button is clicked. This function contain information…
12
votes
4 answers

Set custom chipDrawable background to Chip

I want to set custom drawable background to Chip, just like that chip.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.bg_cutom_drawable)); But it is not working.It gives an error…
Ritesh Adulkar
  • 841
  • 11
  • 18
11
votes
1 answer

Remove an android Chip from a Chip Group smoothly

In one of the fragments of the app i'm developing, i let the users create various chips and every chip represents an option. I was able to animate the chip creation. Now, when the user taps on a chip, i remove it from the group. I was able to…
m.i.n.a.r.
  • 922
  • 2
  • 12
  • 28
11
votes
3 answers

Do not show Checked Icon On Material Components Chip Android

Edit: I managed to make it work by setting the below attirbutes in styles.xml like so: styles.xml
lidkxx
  • 2,731
  • 2
  • 25
  • 44
9
votes
4 answers

particular title(fetched from api) using searchview?

I want something like this: so the thing is, what I exactly want is when user type particular topic name(if present in-app) in searchview it should able give suggestions and if found it should open that topic activity (just like Facebook,…
Wini
  • 1,906
  • 1
  • 12
  • 31
9
votes
3 answers

How to add entry chips in android dynamically along with icon

I need entry chips to be added dynamically using material design library along with icon which will be retrieved through API call. How to use Glide library to set chip icon? NOTE : I am not saving any images before in drawable folder. All the data…
Eswar
  • 199
  • 1
  • 13
9
votes
1 answer

How to add Material Design Chips to input field using autocomplete in android?

I am trying to implement Material Design Chips with AutoCompleteTextView in order to add Contact Chips in an input field when the user clicks on an autocomplete suggestion (like Gmail Recipient Chips). The desired behaviour can be seen on Material…
9
votes
2 answers

How to use Chips component from android support library?

I have read the documentation on the official website. But I was unable to implement Chip in my project following the documentation. Android Studio can't find and import Chip class as well as Chip view. I have also noticed that on Google Developer…
zoha131
  • 1,758
  • 2
  • 16
  • 18
8
votes
3 answers

How to programatically select the default Chip in a ChipGroup in Android?

TL;DR - What is the correct way to programatically select a default choice Chip that is a child of a ChipGroup in Android? -- In my android app, I am using com.google.android.material.chip.Chip styled as @style/Widget.MaterialComponents.Chip.Choice…
8
votes
1 answer

Avoid Chip Group to get unchecked

I have this following Chip Group and when I tap on a Chip that is already checked, it gets unchecked, but I have to always have a checked chip. The behavior is similar to the Radio Group.
1
2
3
15 16