material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.08k stars 3.04k forks source link

[Checkbox] Incorrect uncheck animation #3533

Closed p-dmitriy closed 10 months ago

p-dmitriy commented 10 months ago

Description: I faced a bug with checkbox animation (first checbox on gif). Animation for states indeterminate -> unchecked and checked -> unchecked is visually skipped. Seems the problem is in mtrl_checkbox_button_checked_unchecked.xml. Animation preview in Android Studio also show me immediate disappearing of the rectangle inside the box.

Expected behavior: Animated disappearing of rectangle as for 2 and 3 cheboxes on gif.

Source code:

<com.google.android.material.checkbox.MaterialCheckBox
    style="@style/Widget.Material3.CompoundButton.CheckBox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

Minimal sample app repro: In material catalog app I also didn't see uncheck animation.

Android API version: Tested on 30 and 33.

Material Library version: 1.8.0

Device: Xiaomi 13/Xiaomi Mi 9 Lite ezgif com-video-to-gif

leticiarossi commented 10 months ago

Hi, the M3 up to date animation for the unchecked state is supposed to be a quick fade out (see specs), differently from the bottom 2 checkboxes of your example. It's very quick so it can be hard to see, but I just checked that it's working as expected on the M3 catalog.

You can change the animations speed of your device/emulator via the developer options/"Animator duration scale" to make sure that it's working. If you find there's still an issue then please reopen with a sample app where the bug is reproducible. Thanks!