mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
Don't animate the spinning circle if animations are disabled (#2338)
This commit is contained in:
parent
4d22d91e98
commit
d1b3124ab0
2 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,7 @@ import org.thoughtcrime.securesms.ConversationListActivity;
|
|||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.connect.AccountManager;
|
||||
import org.thoughtcrime.securesms.connect.DcHelper;
|
||||
import org.thoughtcrime.securesms.util.AccessibilityUtil;
|
||||
import org.thoughtcrime.securesms.util.Prefs;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
|
@ -80,6 +81,10 @@ public class TestUtils {
|
|||
|
||||
private static void prepare() {
|
||||
Prefs.setBooleanPreference(getInstrumentation().getTargetContext(), Prefs.DOZE_ASKED_DIRECTLY, true);
|
||||
if (!AccessibilityUtil.areAnimationsDisabled(getInstrumentation().getTargetContext())) {
|
||||
throw new RuntimeException("To run the tests, disable animations at Developer options' " +
|
||||
"-> 'Window/Transition/Animator animation scale' -> Set all 3 to 'off'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.view.animation.RotateAnimation;
|
|||
import android.widget.ImageView;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.AccessibilityUtil;
|
||||
|
||||
public class DeliveryStatusView {
|
||||
|
||||
|
@ -24,6 +25,8 @@ public class DeliveryStatusView {
|
|||
|
||||
private void animatePrepare()
|
||||
{
|
||||
if (AccessibilityUtil.areAnimationsDisabled(context)) return;
|
||||
|
||||
if(prepareAnimation ==null) {
|
||||
prepareAnimation = new RotateAnimation(360f, 0f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
|
@ -39,6 +42,8 @@ public class DeliveryStatusView {
|
|||
|
||||
private void animateSending()
|
||||
{
|
||||
if (AccessibilityUtil.areAnimationsDisabled(context)) return;
|
||||
|
||||
if(sendingAnimation ==null) {
|
||||
sendingAnimation = new RotateAnimation(0, 360f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue