Blink on battery saver mode
fredericojssilva opened this issue · 6 comments
Circular Progress blink instead of rotate when on battery saver, Android >=5.0
Seems like all application animations are disabled in battery saver mode, causing all ValueAnimators to end instantly. However, CPV just resets the animation at the end of the indeterminate animation, so it just sorta flickers and crashes my emulator. @fredericojssilva: Was flickering the only issue or did it cause other problems like crashing or battery drainage?
I don't know if there is a good solution to this. However, since battery saver mode was introduced in API 21, I would suggest using the native progress bar when running API >=21. I believe this should be possible with the <include>
tag to include a layout/progress_bar.xml
using a CPV, and then making a layout-v21/progress_bar.xml
that uses the native ProgressBar.
@rahatarmanahmed What do you think about not running animation in battery saver mode? This flickering looks really bad.
@rongi As I said before, I still think this should be solved by not using CPV on API >= 21. Much easier to just swap in the native view than to deal with handling battery saver mode logic.
(That being said, if you can figure out how to do that automatically in CPV itself without breaking it for older versions, I would definitely accept a PR for that.)
@rahatarmanahmed Is it possible to have native view that looks the same as CPV on Android API >= 21? Is it possible to change color of that view? Will this native view look the same across different android devices? I'm using CPV mainly for consistency of how progress view looks across devices.
I've just looked at behaviour of standard ProgressView and it looks like they just don't show their progress if device is in a battery saving mode. It feels like even this is a better behaviour than non stopping flickering.