material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[Progress indicator] Doesn't spin on API level 21

Open Leonidius20 opened this issue 1 year ago • 3 comments

Description: Neither the circular progress indicator, nor the linear one have animation on Android 5.0 (api level 21). They are just stuck in one state without any animation. At the same time, the same code produces a progress indicator with proper animation on Android 12.

Interestingly enough, there is exactly the same issue with the Jetpack Compose version of progress indicators (don't spin on android 5, do spin on android 12), although I understand that it is a separate issue.

Android API version: 21

Material Library version: 1.11.0

Device: ASUS ZenPad C 7.0 (P01Y)

Leonidius20 avatar May 17 '24 15:05 Leonidius20

Do you mind to provide a minimum repro sample? It animates with no problems in our catalog on API 21 emulator.

pekingme avatar May 17 '24 18:05 pekingme

Here's what happens with linear progress indicators in the app at https://github.com/Leonidius20/Lugat (you can download apk from the releases section):

On Android 12 (works as intended):

https://github.com/material-components/material-components-android/assets/25536411/3f4d4ccb-c533-4862-8216-180daef459ee

On Android 5 (no animation):

https://github.com/material-components/material-components-android/assets/25536411/6bdf4cc1-0cac-40a4-a622-7744584f58c3

Leonidius20 avatar May 17 '24 22:05 Leonidius20

Here's where the indicator is defined in the layout: https://github.com/Leonidius20/Lugat/blob/29952c18a4f211f563f8487950a47cec399402ed/app/src/main/res/layout/fragment_word_details.xml#L57

And here are the only manipulations that happen with the indicator in the code, which is that the visibility changes between Visible and Gone https://github.com/Leonidius20/Lugat/blob/29952c18a4f211f563f8487950a47cec399402ed/app/src/main/java/io/github/leonidius20/lugat/features/details/ui/WordDetailsFragment.kt#L90

Leonidius20 avatar May 17 '24 22:05 Leonidius20