From ef067fb8795bb2f0903d34f5832219984335f396 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Mon, 1 Sep 2014 16:44:08 +0200 Subject: [PATCH] Fix RTL handling for Keyguard affordances Bug: 17328362 Change-Id: Ieb076c46379085e043b0c16755355d4c3018bd7d --- .../phone/KeyguardAffordanceHelper.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java index 20ffba2d45b94..eca8e6a89a5f3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java @@ -59,9 +59,9 @@ public class KeyguardAffordanceHelper { private int mMinTranslationAmount; private int mMinFlingVelocity; private int mHintGrowAmount; - private final KeyguardAffordanceView mLeftIcon; - private final KeyguardAffordanceView mCenterIcon; - private final KeyguardAffordanceView mRightIcon; + private KeyguardAffordanceView mLeftIcon; + private KeyguardAffordanceView mCenterIcon; + private KeyguardAffordanceView mRightIcon; private Interpolator mAppearInterpolator; private Interpolator mDisappearInterpolator; private Animator mSwipeAnimator; @@ -84,12 +84,7 @@ public class KeyguardAffordanceHelper { KeyguardAffordanceHelper(Callback callback, Context context) { mContext = context; mCallback = callback; - mLeftIcon = mCallback.getLeftIcon(); - mLeftIcon.setIsLeft(true); - mCenterIcon = mCallback.getCenterIcon(); - mRightIcon = mCallback.getRightIcon(); - mLeftIcon.setPreviewView(mCallback.getLeftPreview()); - mRightIcon.setPreviewView(mCallback.getRightPreview()); + initIcons(); updateIcon(mLeftIcon, 0.0f, SWIPE_RESTING_ALPHA_AMOUNT, false); updateIcon(mCenterIcon, 0.0f, SWIPE_RESTING_ALPHA_AMOUNT, false); updateIcon(mRightIcon, 0.0f, SWIPE_RESTING_ALPHA_AMOUNT, false); @@ -113,6 +108,16 @@ public class KeyguardAffordanceHelper { android.R.interpolator.fast_out_linear_in); } + private void initIcons() { + mLeftIcon = mCallback.getLeftIcon(); + mLeftIcon.setIsLeft(true); + mCenterIcon = mCallback.getCenterIcon(); + mRightIcon = mCallback.getRightIcon(); + mRightIcon.setIsLeft(false); + mLeftIcon.setPreviewView(mCallback.getLeftPreview()); + mRightIcon.setPreviewView(mCallback.getRightPreview()); + } + public boolean onTouchEvent(MotionEvent event) { int pointerIndex = event.findPointerIndex(mTrackingPointer); if (pointerIndex < 0) { @@ -436,6 +441,7 @@ public class KeyguardAffordanceHelper { public void onConfigurationChanged() { initDimens(); + initIcons(); } public void reset(boolean animate) {