I have a view in my app that requires animation for validation reasons.
In normal cases the animation works well. Unless when the user's device has animations disabled either from the Accessibility Options or from the Developer settings (Window animation scale, Transition animation scale, Animator duration scale).
Is there a way to display the animation for a view even if the animations are disabled for the device?
Thanks
Here is the animation code:
private ObjectAnimator translateAnimator;
private View animatedView;
...
private void startAnimation() {
if (translateAnimator == null) {
translateAnimator = ObjectAnimator.ofFloat(animatedView, "translationX", 0f, 300f);
translateAnimator.setAutoCancel(true);
translateAnimator.setDuration(2000);
translateAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
translateAnimator.setRepeatCount(ValueAnimator.INFINITE);
translateAnimator.setRepeatMode(ValueAnimator.REVERSE);
translateAnimator.start();
} else {
translateAnimator.resume();
}
}