wip 3029324: Implement new drag feedback

- Show page borders when dragging
- Enlarge scroll region (landscape only)
- When inside scroll region, show green border on adjacent page
This commit is contained in:
Patrick Dubroy committed 2010-10-06 17:39:05 -07:00
1 parent 7ed39f3362
commit 1262e36948
8 files changed
+138 -60

No files matched your search

+15 -11
View File
@@ -133,6 +133,8 @@ public abstract class PagedView extends ViewGroup {
// (SmoothPagedView does this)
protected boolean mDeferScrollUpdate = false;
protected boolean mIsPageMoving = false;
/**
* Simple cache mechanism for PagedViewIcon outlines.
*/
@@ -159,11 +161,6 @@ public abstract class PagedView extends ViewGroup {
void onPageSwitch(View newPage, int newPageIndex);
}
public interface PageMovingListener {
void onPageBeginMoving();
void onPageEndMoving();
}
public PagedView(Context context) {
this(context, null);
}
@@ -257,12 +254,22 @@ public abstract class PagedView extends ViewGroup {
}
}
// a method that subclasses can override to add behavior
protected void pageBeginMoving() {
private void pageBeginMoving() {
mIsPageMoving = true;
onPageBeginMoving();
}
private void pageEndMoving() {
onPageEndMoving();
mIsPageMoving = false;
}
// a method that subclasses can override to add behavior
protected void pageEndMoving() {
protected void onPageBeginMoving() {
}
// a method that subclasses can override to add behavior
protected void onPageEndMoving() {
}
/**
@@ -657,12 +664,9 @@ public abstract class PagedView extends ViewGroup {
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
// Release the drag
pageEndMoving();
mTouchState = TOUCH_STATE_REST;
mAllowLongPress = false;
mActivePointerId = INVALID_POINTER;
break;
case MotionEvent.ACTION_POINTER_UP: