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:
@@ -56,8 +56,8 @@ public class DragController {
|
||||
private static final int SCROLL_OUTSIDE_ZONE = 0;
|
||||
private static final int SCROLL_WAITING_IN_ZONE = 1;
|
||||
|
||||
private static final int SCROLL_LEFT = 0;
|
||||
private static final int SCROLL_RIGHT = 1;
|
||||
static final int SCROLL_LEFT = 0;
|
||||
static final int SCROLL_RIGHT = 1;
|
||||
|
||||
private Context mContext;
|
||||
private Handler mHandler;
|
||||
@@ -156,6 +156,10 @@ public class DragController {
|
||||
mScrollZone = context.getResources().getDimensionPixelSize(R.dimen.scroll_zone);
|
||||
}
|
||||
|
||||
public boolean dragging() {
|
||||
return mDragging;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a drag.
|
||||
*
|
||||
@@ -487,18 +491,21 @@ public class DragController {
|
||||
mScrollState = SCROLL_WAITING_IN_ZONE;
|
||||
mScrollRunnable.setDirection(SCROLL_LEFT);
|
||||
mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
|
||||
mDragScroller.onEnterScrollArea(SCROLL_LEFT);
|
||||
}
|
||||
} else if (!inDeleteRegion && x > mScrollView.getWidth() - mScrollZone) {
|
||||
if (mScrollState == SCROLL_OUTSIDE_ZONE) {
|
||||
mScrollState = SCROLL_WAITING_IN_ZONE;
|
||||
mScrollRunnable.setDirection(SCROLL_RIGHT);
|
||||
mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
|
||||
mDragScroller.onEnterScrollArea(SCROLL_RIGHT);
|
||||
}
|
||||
} else {
|
||||
if (mScrollState == SCROLL_WAITING_IN_ZONE) {
|
||||
mScrollState = SCROLL_OUTSIDE_ZONE;
|
||||
mScrollRunnable.setDirection(SCROLL_RIGHT);
|
||||
mHandler.removeCallbacks(mScrollRunnable);
|
||||
mDragScroller.onExitScrollArea();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user