diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-12-08 15:07:24 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-12-08 16:09:45 -0800 |
commit | d0030b05f591cbadb21f51b7c87f2d8813f35627 (patch) | |
tree | f690494af4d5942b02fb2ef2caffa18c77c0f85b /src/com/android/launcher3/WorkspaceStateTransitionAnimation.java | |
parent | fcb1dd183cc81208ec4d6498b12e7e969a3e3e9a (diff) | |
download | android_packages_apps_Trebuchet-d0030b05f591cbadb21f51b7c87f2d8813f35627.tar.gz android_packages_apps_Trebuchet-d0030b05f591cbadb21f51b7c87f2d8813f35627.tar.bz2 android_packages_apps_Trebuchet-d0030b05f591cbadb21f51b7c87f2d8813f35627.zip |
Adding placeholder method for compat implementations for Accessibility manager
> Moving some utility methods to the compat class
Bug: 69611105
Change-Id: Ide0cab0b926d7bc03617fc568d2a2b429ee00cd9
Diffstat (limited to 'src/com/android/launcher3/WorkspaceStateTransitionAnimation.java')
-rw-r--r-- | src/com/android/launcher3/WorkspaceStateTransitionAnimation.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index abc140d7d..9f76b6f96 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -18,16 +18,15 @@ package com.android.launcher3; import static com.android.launcher3.LauncherAnimUtils.DRAWABLE_ALPHA; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; +import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.TimeInterpolator; import android.animation.ValueAnimator; -import android.content.Context; import android.util.Property; import android.view.View; -import android.view.accessibility.AccessibilityManager; import com.android.launcher3.LauncherState.PageAlphaProvider; import com.android.launcher3.LauncherStateManager.AnimationConfig; @@ -165,7 +164,7 @@ public class WorkspaceStateTransitionAnimation { return; } view.setAlpha(alpha); - AlphaUpdateListener.updateVisibility(view, isAccessibilityEnabled(view)); + AlphaUpdateListener.updateVisibility(view, isAccessibilityEnabled(view.getContext())); } public <T> void setFloat(T target, Property<T, Float> property, float value, @@ -177,12 +176,6 @@ public class WorkspaceStateTransitionAnimation { TimeInterpolator interpolator) { property.set(target, value); } - - protected boolean isAccessibilityEnabled(View v) { - AccessibilityManager am = (AccessibilityManager) - v.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); - return am.isEnabled(); - } } public static class AnimatedPropertySetter extends PropertySetter { @@ -202,7 +195,8 @@ public class WorkspaceStateTransitionAnimation { return; } anim = ObjectAnimator.ofFloat(view, View.ALPHA, alpha); - anim.addListener(new AlphaUpdateListener(view, isAccessibilityEnabled(view))); + anim.addListener(new AlphaUpdateListener(view, + isAccessibilityEnabled(view.getContext()))); } anim.setDuration(mDuration).setInterpolator(getFadeInterpolator(alpha)); |