zhanghai / MaterialProgressBar

Material Design ProgressBar with consistent appearance
Apache License 2.0
2.22k stars 278 forks source link

No Indeterminate ProgressBar/Horizontal in Samsung device, Android 5.0 #1

Closed trietbui85 closed 9 years ago

trietbui85 commented 9 years ago

My device is: Samsung Galaxy S5, Android 5.0.

As you can see in below screenshot, there is native implementation of Indeterminate ProgressBar, but no one in library implementation. The same issue with ProgressBar on Toolbar.

image

zhanghai commented 9 years ago

Seems that the ProgressBar on that platform is not happy to start our animation. Will investigate it later today.

zhanghai commented 9 years ago

Could you please test for this sample APK?

I tried to set the progress drawable in style to @null to avoid the overhead of loading a drawable that's bound to be replaced, but on my Samsung S4 5.0.1 the determinate horizontal progress won't show up (but the indeterminate ones worked fine on my three testing devices). So I guess it is possiblely a similar issue.

trietbui85 commented 9 years ago

@DreaminginCodeZH I still got the same issue as the old build: both Indeterminate ProgressBar and Horizontal of native implementation don't show as expected.

zhanghai commented 9 years ago

Tested on a Samsung S4 5.0.1, a Samsung 4.3, an Android-x86 4.4.2, an Android-x86 5.0, an Android-x86 5.0.1, a Cyanogenmod 5.0.2, a crDriod 5.0.2, cannot reproduce this bug. Seems to be a Samsung-specific regression that has been fixed.

Just to be sure, what is your Android version specifically? is it plain 5.0, or 5.0.1, or 5.0.2?

It can be helpful if you can provide some related adb log, and a PR is also welcomed.

trietbui85 commented 9 years ago

Hi, my phone run Android plain 5.0.

However this morning, when I try to clone your repo, and use AppCompat lib v22.1.0 (I haven't updated my Android support lib to v22.2.0 yet), then I see no issue with Indeterminate ProgressBar and Horizontal.

Will try with AppCompat v22.2.0 and let you know later.

image

zhanghai commented 9 years ago

So when you're running the compiled sample apk from this repo (with appcompat 22.2), the indetermianate progress won't show up. But when you compile it against appcompat 22.1, it works. Did I get it right?

Just a piece of information. If this is an appcompat related issue, the main usage of it in this library is PathInterpolatorCompat, however there should be no problem related to it since implementation on 5.0+ should delegate the call to native implementation.

And here are all the usages:

$ grep -r 'import android\.support'
sample/src/main/java/me/zhanghai/android/materialprogressbar/sample/MainActivity.java:import android.support.v7.app.AppCompatActivity;
sample/src/main/java/me/zhanghai/android/materialprogressbar/sample/AboutActivity.java:import android.support.v7.app.AppCompatActivity;
sample/src/main/java/me/zhanghai/android/materialprogressbar/sample/AppUtils.java:import android.support.v4.app.NavUtils;
sample/src/main/java/me/zhanghai/android/materialprogressbar/sample/AppUtils.java:import android.support.v4.app.TaskStackBuilder;
library/src/main/java/me/zhanghai/android/materialprogressbar/internal/ObjectAnimatorCompatBase.java:import android.support.annotation.Size;
library/src/main/java/me/zhanghai/android/materialprogressbar/ProgressDrawableBase.java:import android.support.v4.view.ViewCompat;
library/src/main/java/me/zhanghai/android/materialprogressbar/Interpolators.java:import android.support.v4.view.animation.PathInterpolatorCompat;
trietbui85 commented 9 years ago

Well, just compile and run app against AppCompat v22.2.0 and see it run without any problem. Only see visibility with Indeterminate ProgressBar and Horizontal problem when use your APK to test.

Update: found a little interesting log:

06-10 14:04:08.246 2791-2791/? W/PropertyValuesHolder﹕ Method setRotation() with type float not found on target class class me.zhanghai.android.materialprogressbar.g 06-10 14:04:08.246 2791-2791/? W/PropertyValuesHolder﹕ Method setRotation() with type float not found on target class class me.zhanghai.android.materialprogressbar.g 06-10 14:04:08.251 2791-2791/? W/PropertyValuesHolder﹕ Method setRotation() with type float not found on target class class me.zhanghai.android.materialprogressbar.g 06-10 14:04:08.566 2791-2791/? W/PropertyValuesHolder﹕ Method setTranslateX() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.566 2791-2791/? W/PropertyValuesHolder﹕ Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method setScaleX() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method setTranslateX() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method setScaleX() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathStart() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathEnd() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.571 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathOffset() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathStart() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathEnd() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathOffset() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathStart() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathEnd() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setTrimPathOffset() with type float not found on target class class me.zhanghai.android.materialprogressbar.f 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setTranslateX() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setScaleX() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setTranslateX() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.d 06-10 14:04:08.576 2791-2791/? W/PropertyValuesHolder﹕ Method setScaleX() with type float not found on target class class me.zhanghai.android.materialprogressbar.d

zhanghai commented 9 years ago

Oh, it is ProGuard. ObjectAnimators call by reflection. See https://github.com/PhilJay/MPAndroidChart/issues/348

I've always tested with debug build APKs (so that I can modify source and debug immediately). My fault.

Will fix this lator today.

(But the library aar is not affected since the obfuscation happens only when I compile sample.)

trietbui85 commented 9 years ago

Ha ha, thanks for pointing it out. It's great to finally know where does this issue come from :)

zhanghai commented 9 years ago

Issue resolved, and directives have been added to readme.

I've also published this library to Maven central btw, you can take a look at the integration section.

nikil07 commented 7 years ago

For anyone coming here for the same issue, as indeterminate progress bar not being shown or visible. I faced the same and spend a lot of time over, then I realized that the "Animation scale" in developer options was turned off.

Might help someone.