material-components / material-components/material-components-android
[Chip] Chip doesn't expand with animation when checked
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Description: When I check a Chip in a ChipGroup the animation does not work properly.
Expected behavior:

Source code:
stateChipGroup.setOnCheckedChangeListener { group, checkedId ->
if (checkedId == View.NO_ID) { //user tried to uncheck the checked button
group.check(lastCheckedId)
return@setOnCheckedChangeListener
}
lastCheckedId = checkedId
val chip = stateChipGroup.findViewById<View?>(checkedId)
if (chip != null && chip is Chip) {
when (chip.text) {
getString(R.string.enabled) -> {
sharedPref?.edit {
putInt(CHIP_KEY_STATE, BEACON_VISIBLE)
commit()
}
}
getString(R.string.disabled) -> {
sharedPref?.edit {
putInt(CHIP_KEY_STATE, BEACON_INVISIBLE)
commit()
}
}
getString(R.string.both) -> {
sharedPref?.edit {
putInt(CHIP_KEY_STATE, BEACON_BOTH)
commit()
}
}
}
vm.updateRecyclerView()
}
}
Current behavior

Android API version: Android API version here
Material Library version: 1.1.0-alpha08
Device: OnePlus 7 Pro, OnePlus 3t
To help us triage faster, please check to make sure you are using the latest version of the library.
Cannot since app crashes due to error #605
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the checked ChipGroup behavior from the issue's Kotlin source snippet on the reported Android setup, using Material Library 1.1.0-alpha08. Compare the expected and current animations shown in the linked recordings, and verify that checking a Chip expands it with the intended animation without triggering the crash noted in issue #605.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100