Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef067fb8 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix RTL handling for Keyguard affordances

Bug: 17328362
Change-Id: Ieb076c46379085e043b0c16755355d4c3018bd7d
parent 6531ae2f
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -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) {