Skip to content
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.

Blink on battery saver mode #16

Closed
fredericojssilva opened this issue May 22, 2015 · 6 comments
Closed

Blink on battery saver mode #16

fredericojssilva opened this issue May 22, 2015 · 6 comments

Comments

@fredericojssilva
Copy link

Circular Progress blink instead of rotate when on battery saver, Android >=5.0

@rahatarmanahmed
Copy link
Owner

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?

@rahatarmanahmed
Copy link
Owner

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.

@rongi
Copy link

rongi commented Jan 9, 2017

@rahatarmanahmed What do you think about not running animation in battery saver mode? This flickering looks really bad.

@rahatarmanahmed
Copy link
Owner

rahatarmanahmed commented Jan 9, 2017

@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.)

@rongi
Copy link

rongi commented Jan 10, 2017

@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.

@rongi
Copy link

rongi commented Jan 10, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants