Fix RTL handling for Keyguard affordances

Bug: 17328362
Change-Id: Ieb076c46379085e043b0c16755355d4c3018bd7d
This commit is contained in:
Jorim Jaggi
2014-09-01 16:44:08 +02:00
parent 6531ae2fcd
commit ef067fb879

View File

@@ -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) {