Skip to content

Commit 258d9fc

Browse files
author
Adam Cohen
committed
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
1 parent 61ccc16 commit 258d9fc

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetRegion.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public class KeyguardWidgetRegion extends LinearLayout implements PagedView.Page
2929
private int mPage = 0;
3030
private Callbacks mCallbacks;
3131

32+
// We are disabling touch interaction of the widget region for factory ROM.
33+
private static final boolean DISABLE_TOUCH_INTERACTION = true;
34+
3235
private static final long CUSTOM_WIDGET_USER_ACTIVITY_TIMEOUT = 30000;
3336

3437
public KeyguardWidgetRegion(Context context) {
@@ -52,19 +55,21 @@ protected void onFinishInflate() {
5255
mPager.setPageSwitchListener(this);
5356

5457
setSoundEffectsEnabled(false);
55-
setOnClickListener(new OnClickListener() {
56-
@Override
57-
public void onClick(View v) {
58-
showPagingFeedback();
59-
}
60-
});
58+
if (!DISABLE_TOUCH_INTERACTION) {
59+
setOnClickListener(new OnClickListener() {
60+
@Override
61+
public void onClick(View v) {
62+
showPagingFeedback();
63+
}
64+
});
65+
}
6166
}
6267

6368
public void showPagingFeedback() {
64-
if (true || (mPage < mPager.getPageCount() - 1)) {
69+
if ((mPage < mPager.getPageCount() - 1)) {
6570
mLeftStrip.makeEmGo();
6671
}
67-
if (true || (mPage > 0)) {
72+
if ((mPage > 0)) {
6873
mRightStrip.makeEmGo();
6974
}
7075
}

policy/src/com/android/internal/policy/impl/keyguard/PagedView.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
7777
private static final int MIN_SNAP_VELOCITY = 1500;
7878
private static final int MIN_FLING_VELOCITY = 250;
7979

80+
// We are disabling touch interaction of the widget region for factory ROM.
81+
private static final boolean DISABLE_TOUCH_INTERACTION = true;
82+
8083
static final int AUTOMATIC_PAGE_SPACING = -1;
8184

8285
protected int mFlingThresholdVelocity;
@@ -861,6 +864,10 @@ protected boolean hitsNextPage(float x, float y) {
861864

862865
@Override
863866
public boolean onInterceptTouchEvent(MotionEvent ev) {
867+
if (DISABLE_TOUCH_INTERACTION) {
868+
return false;
869+
}
870+
864871
/*
865872
* This method JUST determines whether we want to intercept the motion.
866873
* If we return true, onTouchEvent will be called and we do the actual
@@ -1099,6 +1106,10 @@ protected float maxOverScroll() {
10991106

11001107
@Override
11011108
public boolean onTouchEvent(MotionEvent ev) {
1109+
if (DISABLE_TOUCH_INTERACTION) {
1110+
return false;
1111+
}
1112+
11021113
// Skip touch handling if there are no pages to swipe
11031114
if (getChildCount() <= 0) return super.onTouchEvent(ev);
11041115

0 commit comments

Comments
 (0)