mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 14:38:33 +00:00
Support disabled animations for accessibility.
This commit is contained in:
parent
4e6798e38e
commit
a32b875587
@ -7,6 +7,7 @@ import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@ -263,6 +264,8 @@ public final class WebRtcAnswerDeclineButton extends LinearLayout implements Acc
|
||||
}
|
||||
|
||||
private void animateElements(int delay) {
|
||||
if (areAnimationsDisabled()) return;
|
||||
|
||||
ObjectAnimator fabUp = getUpAnimation(answer);
|
||||
ObjectAnimator fabDown = getDownAnimation(answer);
|
||||
ObjectAnimator fabShake = getShakeAnimation(answer);
|
||||
@ -297,6 +300,11 @@ public final class WebRtcAnswerDeclineButton extends LinearLayout implements Acc
|
||||
animatorSet.start();
|
||||
}
|
||||
|
||||
private boolean areAnimationsDisabled() {
|
||||
return Settings.Global.getFloat(getContext().getContentResolver(),
|
||||
Settings.Global.ANIMATOR_DURATION_SCALE, 1) == 0f;
|
||||
}
|
||||
|
||||
private void resetElements() {
|
||||
animating = false;
|
||||
complete = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user