respect animator duration scale in own animation
android, android-animation
Solution
You can try something like this:
final float animatorSpeed;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
animatorSpeed = Settings.Global.getFloat(
context.getContentResolver(),
Settings.Global.ANIMATOR_DURATION_SCALE,
0);
} else {
animatorSpeed = Settings.System.getFloat(
context.getContentResolver(),
Settings.System.ANIMATOR_DURATION_SCALE,
0);
}
Problem
how can I respect the animator duration scale setting in own animations? Can I read the setting and multiply it to my duration or what is a good way for this?