Updates A11y Shortcut animations to not loop in code.
Continuously repeated animations go against accessibility guidelines to avoid unstoppable motion. The animation files themselves have been updated to loop twice so that the user can still see the animation temporarily. The loop restarts if the user exits and enters the page again. Bug: 370661517 Flag: EXEMPT minor bugfix with resource changes Test: Manually observe animations Change-Id: I52348a094680ef345bf8c2b12ab91c9406bf5cb4
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -72,7 +72,6 @@ import com.android.settingslib.utils.StringUtil;
|
||||
import com.android.settingslib.widget.LottieColorUtils;
|
||||
|
||||
import com.airbnb.lottie.LottieAnimationView;
|
||||
import com.airbnb.lottie.LottieDrawable;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -335,7 +334,8 @@ public final class AccessibilityShortcutsTutorial {
|
||||
result -> Log.w(TAG, "Invalid image raw resource id: " + imageRawRes,
|
||||
result));
|
||||
lottieView.setAnimation(imageRawRes);
|
||||
lottieView.setRepeatCount(LottieDrawable.INFINITE);
|
||||
// Follow the Motion Stoppable requirement by using a finite animation.
|
||||
lottieView.setRepeatCount(0);
|
||||
LottieColorUtils.applyDynamicColors(context, lottieView);
|
||||
lottieView.playAnimation();
|
||||
|
||||
|
@@ -35,7 +35,6 @@ import com.android.settings.R;
|
||||
import com.android.settingslib.widget.LottieColorUtils;
|
||||
|
||||
import com.airbnb.lottie.LottieAnimationView;
|
||||
import com.airbnb.lottie.LottieDrawable;
|
||||
|
||||
/**
|
||||
* A preference represents an accessibility shortcut option with a checkbox and a tutorial image
|
||||
@@ -96,7 +95,8 @@ public class ShortcutOptionPreference extends CheckBoxPreference {
|
||||
.getResourceEntryName(mIntroImageRawResId),
|
||||
result));
|
||||
imageView.setAnimation(mIntroImageRawResId);
|
||||
imageView.setRepeatCount(LottieDrawable.INFINITE);
|
||||
// Follow the Motion Stoppable requirement by using a finite animation.
|
||||
imageView.setRepeatCount(0);
|
||||
LottieColorUtils.applyDynamicColors(imageView.getContext(), imageView);
|
||||
imageView.playAnimation();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user