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

Commit 258d9fc6 authored by Adam Cohen's avatar Adam Cohen
Browse files

Fix inability to start pattern outside view bounds (issue 7344325)

-> At the same time, disabling the abilit to page the widget region
   and see the overscroll effect

Change-Id: Icd9d9e253404bfbfc411d8958f7c634ca4e37279
parent 61ccc162
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ public class KeyguardWidgetRegion extends LinearLayout implements PagedView.Page
    private int mPage = 0;
    private Callbacks mCallbacks;

    // We are disabling touch interaction of the widget region for factory ROM. 
    private static final boolean DISABLE_TOUCH_INTERACTION = true;

    private static final long CUSTOM_WIDGET_USER_ACTIVITY_TIMEOUT = 30000;

    public KeyguardWidgetRegion(Context context) {
@@ -52,6 +55,7 @@ public class KeyguardWidgetRegion extends LinearLayout implements PagedView.Page
        mPager.setPageSwitchListener(this);

        setSoundEffectsEnabled(false);
        if (!DISABLE_TOUCH_INTERACTION) {
            setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
@@ -59,12 +63,13 @@ public class KeyguardWidgetRegion extends LinearLayout implements PagedView.Page
                }
            });
        }
    }

    public void showPagingFeedback() {
        if (true || (mPage < mPager.getPageCount() - 1)) {
        if ((mPage < mPager.getPageCount() - 1)) {
            mLeftStrip.makeEmGo();
        }
        if (true || (mPage > 0)) {
        if ((mPage > 0)) {
            mRightStrip.makeEmGo();
        }
    }
+11 −0
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
    private static final int MIN_SNAP_VELOCITY = 1500;
    private static final int MIN_FLING_VELOCITY = 250;

    // We are disabling touch interaction of the widget region for factory ROM. 
    private static final boolean DISABLE_TOUCH_INTERACTION = true;

    static final int AUTOMATIC_PAGE_SPACING = -1;

    protected int mFlingThresholdVelocity;
@@ -861,6 +864,10 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (DISABLE_TOUCH_INTERACTION) {
            return false;
        }

        /*
         * This method JUST determines whether we want to intercept the motion.
         * If we return true, onTouchEvent will be called and we do the actual
@@ -1099,6 +1106,10 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        if (DISABLE_TOUCH_INTERACTION) {
            return false;
        }

        // Skip touch handling if there are no pages to swipe
        if (getChildCount() <= 0) return super.onTouchEvent(ev);