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
0
votes
1 answer

Android Chip Restrict Multiple entry

I have initialized chip and it is completely working. the problem is that when i close the chip the chip position is not getting removed from my model class. and multiple chips are able to add with same name.…
0
votes
0 answers

Unable to apply style to Android Material Component Chip programmatically

This is the screenshot of what I am working on. There are two classes involved here. DraggableLayout and DraggableChip. Now, I want to change the style of the chip to R.style.Widget_MaterialComponents_Chip_Entry This is what the code looks…
0
votes
1 answer

Chip setoncheckedchangelistener String comparison return false

Some Context : I'm filtering trip according to their date, those trips are on firebase, I have a method(getTripState) that compare the current date to the trip date and either return "Upcoming" or "Old Trips" depending on the case. The chips play…
Dr4ke the b4dass
  • 1,184
  • 2
  • 17
  • 40
0
votes
4 answers

Change android chip icon position

I have added a few chips in my app. The default chip have tick icon when you select it like this. I want to change the icon position to the bottom. Like this. There is no property to change the icon position. How can I achieve this result.
kartoos khan
  • 409
  • 6
  • 22
0
votes
1 answer

How to add theme dynamically to chip view android

i have chip group in xml layout and need to add chip dynamically. i need to add theme dynamically ,without changing the app theme i want to set material theme for chip view till now i cant find a proper solution , i will show my code snippet. i…
0
votes
1 answer

getText() always return empty string from dynamically created Chip component?

I'm trying to dynamically create some choice chip components based on an ArrayList of String from some computation and following are the code to create the chips and adding them to a ChipGroup created in layout XML file. if…
Kar Keng Chan
  • 73
  • 1
  • 8
0
votes
2 answers

Chip text is overlapping icon when using setText()

I am using android.support.design.chip.Chip and the problem I get is that when I set the text dynamically by setText("..."), the text wrongly appears by overlapping the icon, but when I set it on the xml file as app:chipText="Hello" it appears…
mantc_sdr
  • 451
  • 3
  • 17
0
votes
0 answers

Application crashes on loading android chip component

Chip material component crash I'm using android.support.design.chip.Chip material element using com.android.support:appcompat-v7:28.0.0 support library. App crashes with this error: Caused by: android.view.InflateException: Binary XML file line…
Ali Has
  • 598
  • 1
  • 8
  • 24
0
votes
1 answer

Chip Group listener change chip position when fragment recreate

I'm creating a chip programmatically. The chips are created but when the app stops (not destroyed) and re-opens, the position of the chip changes in the chip Group Listener. Here is my code: private lateinit var playlist: Array
Hussnain Haidar
  • 2,200
  • 19
  • 30
0
votes
3 answers

Changing color of rounded button with transparent background

How can I change color of rounded corners textView or button with transparent background like this I want when clicked again the button unselect , not only select
0
votes
3 answers

How can I apply ViewHolder pattern to ChipGroup

I have a RecyclerView and every list item has a ChipGroup in it. I want to inflate Chips from xml and add them to the ChipGroup. Every list item has 1 to 4 chips. If my RecyclerView has 50 items, Chips get inflated 50 to 200 times. Thanks to the…
osrl
  • 8,168
  • 8
  • 36
  • 57
0
votes
1 answer

App crashed with "Error inflating class android.support.design.chip.Chip" after updated to support library version 28.0.0-rc02

I have got the the error "Error inflating class android.support.design.chip.Chip. This component requires that you specify a valid TextAppearance attribute. Update your app theme to inherit from Theme.MaterialComponents (or a descendant)." after…
0
votes
1 answer

on which view lifecycle event can i check chip.getLayout()?

I have a Chip view. I want to check if the text is ellipsized and if so - to replace the text with a shorter text (on run time). I have seen this code to check if the text in the Chip is ellipsized. Layout l = textview.getLayout(); if (l != null) { …
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
0
votes
1 answer

RecyclerView with dynamic elements based on response

I am tryin to create a RecyclerView which displays a list of cars along with various tags for each row item. For example: BMW v6,turbo ---> Tags Merc V8, Twin-turbo, Carbon-Fiber ---> Tags The problem being the tags are retrieved in a JSON response…
user2511882
  • 9,022
  • 10
  • 51
  • 59
0
votes
2 answers

Making a Custom RadioButton

I'm trying to make a custom RadioButton like this: I tried making a RadioGroup with three RadioButton in it with the background of the RadioGroup being a rectangle and the background of the RadioButton would be a blue rectangle when checked and…
1 2 3
15
16