Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get android animation scale speeds programmatically?

I want to get the "Animator duration scale/speed" (from developer options), in order to set correct animation speed during some processes in my app (loadings and real time based animations).

Or, is there any way to Override the speed to default/1x (in case the user setted to 0.5x) to don't write many cases? (in other words app based animation speed)

Should I care about this issue, is this a common problem?

like image 639
Aaron Avatar asked Jan 20 '17 19:01

Aaron


People also ask

How do I set custom animation speed?

Set the speedOn the Animations tab, in the Duration box, enter the number of seconds that you want the effect to run.

What is animation scaling on Android?

There are three types of animation scales in your system: The Window animation scale, Transition animation scale, and Animator duration scale. All three of these scales control the animations that appear when you scroll through a page, open an app, or transition between different screens.

Does turning off animations improve performance?

No, by default it will not affect the phone in any way . It will display certain settings which can affect the phone's behavior if you're not aware about what that particular option does.


1 Answers

The answer was (just like the comment that I posted under the post):

Finally, I found this code which helped me get users current animation speed scale.

Settings.Global.getFloat(getContentResolver(),
Settings.Global.ANIMATOR_DURATION_SCALE, 1.0f);
like image 110
Aaron Avatar answered Sep 29 '22 20:09

Aaron