Merge "Fix inability to start pattern outside view bounds (issue 7344325)" into jb-mr1-dev

This commit is contained in:
Adam Cohen
2012-10-13 20:40:33 -07:00
committed by Android (Google) Code Review
2 changed files with 24 additions and 8 deletions

View File

@@ -29,6 +29,9 @@ public class KeyguardWidgetRegion extends LinearLayout implements PagedView.Page
private int mPage = 0; private int mPage = 0;
private Callbacks mCallbacks; 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; private static final long CUSTOM_WIDGET_USER_ACTIVITY_TIMEOUT = 30000;
public KeyguardWidgetRegion(Context context) { public KeyguardWidgetRegion(Context context) {
@@ -52,19 +55,21 @@ public class KeyguardWidgetRegion extends LinearLayout implements PagedView.Page
mPager.setPageSwitchListener(this); mPager.setPageSwitchListener(this);
setSoundEffectsEnabled(false); setSoundEffectsEnabled(false);
setOnClickListener(new OnClickListener() { if (!DISABLE_TOUCH_INTERACTION) {
@Override setOnClickListener(new OnClickListener() {
public void onClick(View v) { @Override
showPagingFeedback(); public void onClick(View v) {
} showPagingFeedback();
}); }
});
}
} }
public void showPagingFeedback() { public void showPagingFeedback() {
if (true || (mPage < mPager.getPageCount() - 1)) { if ((mPage < mPager.getPageCount() - 1)) {
mLeftStrip.makeEmGo(); mLeftStrip.makeEmGo();
} }
if (true || (mPage > 0)) { if ((mPage > 0)) {
mRightStrip.makeEmGo(); mRightStrip.makeEmGo();
} }
} }

View File

@@ -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_SNAP_VELOCITY = 1500;
private static final int MIN_FLING_VELOCITY = 250; 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; static final int AUTOMATIC_PAGE_SPACING = -1;
protected int mFlingThresholdVelocity; protected int mFlingThresholdVelocity;
@@ -862,6 +865,10 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
@Override @Override
public boolean onInterceptTouchEvent(MotionEvent ev) { public boolean onInterceptTouchEvent(MotionEvent ev) {
if (DISABLE_TOUCH_INTERACTION) {
return false;
}
/* /*
* This method JUST determines whether we want to intercept the motion. * This method JUST determines whether we want to intercept the motion.
* If we return true, onTouchEvent will be called and we do the actual * If we return true, onTouchEvent will be called and we do the actual
@@ -1100,6 +1107,10 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
@Override @Override
public boolean onTouchEvent(MotionEvent ev) { public boolean onTouchEvent(MotionEvent ev) {
if (DISABLE_TOUCH_INTERACTION) {
return false;
}
// Skip touch handling if there are no pages to swipe // Skip touch handling if there are no pages to swipe
if (getChildCount() <= 0) return super.onTouchEvent(ev); if (getChildCount() <= 0) return super.onTouchEvent(ev);