As of May 31, 2023, we have updated our Code of Conduct.

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

Android - Remove all chips from chipgroup

How do I remove all chips from a ChipGroup? I know I can remove one chip by passing it to the removeView method or one chip by it's index by calling the removeViewAt and passing it's index, but I ...
Leonardo Sibela's user avatar
1 vote
1 answer
102 views

How to save UI state within a chip while using navigation in compose?

I have a chip that changes configurations when being clicked on. However, as the user navigates back (popbackstack) or navigates to another screen, the clicked chip re-sets its previous position. As I ...
Josef M's user avatar
  • 394
0 votes
0 answers
32 views

Checked ID more than Child Count in ChipGroup Android when clicked right away

I created a Chip dynamically based on a list, and set OnCheckedChangeListener to the ChipGroup. So supposed there is 2 items in the list, the possible checkedId should be 1 or 2. But i find weird ...
wiryadev's user avatar
  • 1,039
0 votes
1 answer
43 views

OutlineSpotShadowColor under API 28

I'm trying to disable clicking effect on Material Chip. In Api>28 there is outlineSpotShadowColor attribute. And how to handle this on Api<28? In my adapter i'm adding chip and disabling this ...
Nickaleush's user avatar
0 votes
1 answer
65 views

How can i show the selected chips in chip group android

I am working on an property listing application where users can list their property like rooms etc. Now the problem I m facing is in the "update listing details" part. So basically we have ...
Puru Chaudhary's user avatar
0 votes
1 answer
22 views

Android Chip with material font icon text not wrapping correctly

In my Android app I have a recyclerview with chips inside, and some chip has not just normal text but icons from the material font. @Override public void onBindViewHolder(final ViewHolder holder, ...
P5music's user avatar
  • 3,159
0 votes
0 answers
17 views

Need advice on what to use to mimic the Ring App Event Slider

I want to copy the event slider that Ring uses for video events for a video entertainment app I'm making, but I don't know what action/event to use for when a chip/date touches the center piece (the ...
WrapItUp87's user avatar
0 votes
0 answers
29 views

How to get the string array form edit text with chips?

I want to make an edit text with the entry of tags in material chip form. After that, I want the tags in a string array. How to achieve that in java android
ThinQ's user avatar
  • 19
2 votes
1 answer
157 views

Set Custom Drawable Background of Material Chip Programetically

I want help. I want UI as below and I am using Material Chip for that. These are material chip of filter type. But the tricky part is these all chips get added in view dynamically (Based on API ...
krupa parekh's user avatar
0 votes
0 answers
327 views

In flutter how do i pass the selected value of choice chips widget back as input field for a form

Hi I am using choice chips widget to select from a list of options, how do i pass the selected value as input a form ,am calling the CustomChipWidget() to render chips in the UI page . i am able to ...
madhu sudana's user avatar
0 votes
0 answers
56 views

Android ChipGroup: Add child view only in XML to check layout design

I have been trying this scenario. I have a ChipGroup and I only add the Chips dynamically into the group. Now if I want to check the layout design I do it by adding some Chips temporarily in the xml. ...
Sashi Kiran's user avatar
0 votes
0 answers
34 views

Kotlin Chipgroup

I have a problem, because I have a chipGroup with twoo chips. When user doesnt click nothing is ok, when user click one chip I need to know which (and I can do this), BUT I also need to know that when ...
wenus's user avatar
  • 1,325
1 vote
3 answers
262 views

How to print deselected (unselected) chips like the selected chips in flutter?

I built multi select chips using Map function. And when selected a chip then color change to yellow. When selected chips then print selected chips. Like that I want to select chips and display the ...
Dasun Dola's user avatar
1 vote
1 answer
151 views

Get text from Chips in a ChipGroup

I am using an EditText to create chips in a ChipGroup and I want that you can't create more than one of the same tags: tag & tag as example should not be possible. I could create an array of ...
Andrey's user avatar
  • 51
0 votes
0 answers
65 views

Chip makes weird margins/paddings that disappear when I set icon

So, I make a custom View inherited from Material's Chip. Here's the View itself : class ChipView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int ...
user2234594's user avatar
0 votes
0 answers
60 views

Why does applying a style using a ContextThemeWrapper only work for certain attributes?

I'm generating Material.Chip views in my fragment. I'd like to configure their appearance, but I'd like to do so using a style. I've read online that I could use a ContextThemeWrapper like so: Chip ...
Cosinux's user avatar
  • 311
0 votes
0 answers
32 views

Getting chipBackground color from a chip

I would like to get the color of my Chip but this way I can't because what I get is ColorStateList. colors.children.forEach { val chip = it as Chip chip....
Antonio's user avatar
  • 31
0 votes
1 answer
187 views

Adding Chips into ChipGroup dynamically: border is not visible?

This is how I make a static ChipGroup <com.google.android.material.chip.ChipGroup android:id="@+id/chip_group_filter" android:layout_width="match_parent" ...
anta40's user avatar
  • 6,451
1 vote
3 answers
670 views

How to add chip to edit text in Android Studio

I found a dependency that I thought might help me, and it looked promising. But when I try to implement it I get a "Failed to resolve: com.hootsuite.android:nachos:1.1.1" : https://i.stack....
Faris Rizvanović's user avatar
1 vote
2 answers
531 views

How to make a chip retain its shape after click-event in compose?

I am currently trying to make it so that when the user has clicked the chip it still retains it's initial form/shape, in this case round. How can I achieve this? This is how it operates currently: ...
Josef M's user avatar
  • 394
1 vote
1 answer
54 views

How fix ChipGroup's direction when reCreate in a Fragment?

There is a ChipGroup in a HorizontalScrollView. I'm creating chips programmatically. When scroll fragment to bottom and ChipGroup off then scroll to top and it visible but ChipGroup's direction was ...
WhoisAbel's user avatar
  • 1,489
0 votes
0 answers
61 views

Layout inside TextInputLayout:

I'm trying to put ChipLayout inside TextInputLayout: <com.google.android.material.textfield.TextInputLayout android:id="@+id/text_layout_author" android:layout_width="0dp&...
len's user avatar
  • 346
0 votes
0 answers
63 views

How to add ChipGroup Selected Text to firebase?

I am new to android and working on an app where I need to take data from users from the chip Groups, and I want to save that data to firestore but I m facing a problem, I created a method ...
Vivek M Fauzdar's user avatar
0 votes
0 answers
84 views

using checkbox and chip saving their values into sharedpreferences and then showing into textview using kotlin. please guide how to optimise code

private lateinit var sharedPreferences: SharedPreferences private lateinit var checkBox: CheckBox private lateinit var chip: Chip private lateinit var tvNext2CheckBox: TextView private ...
Rana HM Hasnain's user avatar
1 vote
0 answers
183 views

How to change the position of close icon in chip vertically android

I wanted to change the position of an icon from right centered inside the chip to the top right corner of the chip. I have seen only start and end padding, not top and bottom, is there any way to ...
Vamsi Madhav H's user avatar
0 votes
1 answer
102 views

How to set up Chip and ChipGroup attributes properly?

I figured out that app: namespace attributes are not applied to Chip view in my project, though documentation and some sample code I have seen state that they do. What do I do wrong? <com.google....
Alexander Alexander's user avatar
1 vote
0 answers
36 views

onItemClick() event not fired with HorizontalScrollView in android

I'm using ChipView in android. I've added HorizontalScrollView to chips_recipient_dropdown_item.xml file. but now the onItemClick event is not fired of the class RecipientEditTextView.java ...
M123's user avatar
  • 1,199
0 votes
0 answers
888 views

Sorting or filtering Recyclerview with Chips in Android

What is the best way to implement a filtering ChipGroup on a recyclerview? I have an EditText that user can put a value for filtering, after press Enter key a chip is added on the ChipGroup. How I can ...
Dúver Cruz's user avatar
0 votes
2 answers
40 views

How to get colors? [closed]

I am trying to achieve something like this where the text and background colors are similar. How do I get the corresponding background (probably 50% transparent of chosen color) color for a chip in ...
Mark Delphi's user avatar
  • 1,336
0 votes
2 answers
483 views

Chip Drawable giving error in Material UI 3 Android Kotlin

hey I am working in android with material ui 3. I am getting error when I used this code. I am trying to set style through programmatically and I am getting error. I want to create tag through using ...
Kotlin Learner's user avatar
6 votes
2 answers
1k views

ChipGroup with draggable Chips

In my XML I'm just declaring a ChipGroup as follows: <com.google.android.material.chip.ChipGroup android:id="@+id/chipGroup" android:layout_width="match_parent" ...
drmrbrewer's user avatar
  • 11.1k
1 vote
1 answer
328 views

How to make horizontally scrollable multi-line chipgroup in android?

Horizontally scrollable multi-line chip group This is the chip group design I am trying to make in android. I have tried to use three chip-groups for three lines but they don't scroll together. ...
subhra priyadarshinee's user avatar
0 votes
2 answers
647 views

How to increase width of ChoiceChip to same value for all?

I am using https://api.flutter.dev/flutter/material/ChoiceChip-class.html and I want to make them same size. I found out this solution How to increase the width of a chip in flutter but padding is not ...
Karol Wiśniewski's user avatar
0 votes
2 answers
81 views

best way to manage filters with a custom style

I work on an Android app and I need to implement filters based on the app design guidelines. There are 2 kinds of filters: with an icon without an icon The filter can be selected/unselected (or ...
Gold.strike's user avatar
  • 1,259
0 votes
0 answers
426 views

Scroll to selected chip in horizontalScrollView

I have HorizontalScrollView , Which has a Horizontal Linear layout with 7 chips. In which some chips are out of screen. Selected chipID is stored in DataStore (branchTypeID) So now the next time this ...
Agni Gari's user avatar
  • 12.2k
0 votes
2 answers
709 views

Material Chip the selection behavior doesn't work

I can't understand how the Chip works. I want to do a a view which contains dynamic filters to select. When I select a chip, there is a press effect (OK), but the chip doesn't stay in the selected ...
anthony's user avatar
  • 7,613
5 votes
1 answer
381 views

Adding Vertical divider in ChipGroup (Android)

Im trying to add a vertical divider in chipgroup to separate primary chip from other chips. Just like YouTube: I have attempted to add it through this method. In the Activity: <...
Amitoj's user avatar
  • 161
0 votes
0 answers
516 views

Problem working with chips programmatically

I'm adding chips into chipGropup programatically like this XML <com.google.android.material.chip.ChipGroup android:id="@+id/chipGroup" android:layout_width=...
Electrocode's user avatar
1 vote
2 answers
141 views

Display Multiple chips/tags in single line in android using autocomplete text view

i want to display multiple chips may two or more in single line and rest in the subsequent lines. Please see the attached image, i want the same as displayed in the image.enter image description here
Himanshu verma's user avatar
0 votes
1 answer
373 views

Draw Chip inside ChipGroup over border of MaterialCardView

I am making the layout for a recyclerview row, and I want ChipGroup to draw over the border of the MaterialCard like in this mockup: The problem is that it doesnt matter what parent layout I use, or ...
dariovaz's user avatar
1 vote
0 answers
51 views

Is it possible to achieve chip in android where there are multiple texts and icons in between?

This is what I want to achieve. Is it possible to do that with Chip?
Prosenjith Roy's user avatar
0 votes
1 answer
1k views

How to center align Chips in ChipGroup?

I've 3 chips, and what I want to achieve is to align the 1st chip to be at the start, the 2nd in middle and 3rd at the end of screen horizontally. I also want to ask how can I add new line in ...
lawayben's user avatar
3 votes
1 answer
1k views

How to add choice chip dynamically in android studio in my case

I have Model Class Like this: private String animalName, type; public Model(){} public Model(String animalName, String type){ this.animalName = animalName; this.type = type; } //and getter and ...
James Bond's user avatar
0 votes
0 answers
885 views

Same Material Chips are added again to ChipGroup when RecyclerView is scrolled up/down

As the official material.io documentation says: Chips are compact elements that represent an input, attribute, or action. I want to add chips as attributes (tags) for any blog post, a recyclerview ...
Arshad Ali's user avatar
  • 3,022
0 votes
0 answers
152 views

Flutter - How to use ellipsis for widgets in Wrap?

I want an ellipsis to appear when the widget exceeds two lines. (not text) Now the status is like this enter image description here I wish it was like this enter image description here this is my code ...
aimyon's user avatar
  • 53
2 votes
2 answers
917 views

Alternatives to ReplacementSpan in Jetpack Compose?

I know this question is very vague and doesn't probably have a single correct answer. I just wanted to hear some input and create some content around advanced text styles in Compose. I hope it's fine. ...
Lorenzo Benevento's user avatar
0 votes
1 answer
293 views

Extra end and start margin with chips

How can i remove extra margins or (spacing) from chips inside chip group? below is all things that i try in styles,code and xml none of these work for me. Here is how it's looks: And here is what i ...
Sami Shorman's user avatar
5 votes
1 answer
405 views

Cannot draw on Chip when text alignment is center

I am extending Chip class to perform some drawing over it for my lib , my use case is more complex but for simplicity let's say i am just drawing a diagonal line my code class MyChip (context: Context,...
Abhinav Chauhan's user avatar
0 votes
1 answer
102 views

Custom AutoCompleteTextView with custom Adapter for DropDown ignoring onItemClick

So I made a custom AutoCompleteTextView and a custom Adapter. Everything works as long as I use TextView to display data in the dropdown, the click event gets triggered and the TextView gets filled ...
Lorenzo Benevento's user avatar
-1 votes
1 answer
629 views

how can get chipgroup values when the user selected and submit to firebase?

how can get chipgroup values when the user selected and submit to firebase? I already written the code, but when user selected and submit the date to firebase, I just got the value -1. I don't know ...
James's user avatar
  • 13

1
2 3 4 5