diff options
author | Joe Onorato <joeo@google.com> | 2010-09-29 11:40:39 -0700 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2010-09-30 18:17:31 -0700 |
commit | 658db74c24817892f1a379b16620744f38f60e40 (patch) | |
tree | 153de3910f84637018b8810c3aa9e0a84757c514 /src/com/android/launcher2/DragController.java | |
parent | f34bab59fc0260f926aec44d044883dce1b4191f (diff) | |
download | packages_apps_trebuchet-658db74c24817892f1a379b16620744f38f60e40.zip packages_apps_trebuchet-658db74c24817892f1a379b16620744f38f60e40.tar.gz packages_apps_trebuchet-658db74c24817892f1a379b16620744f38f60e40.tar.bz2 |
the scroll drag area was too small, and should have come from a resource anyway.
Change-Id: I11111aff767e21a2582c5c368b5d9ff1ac8f9cd7
Diffstat (limited to 'src/com/android/launcher2/DragController.java')
-rw-r--r-- | src/com/android/launcher2/DragController.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index 185f704..d544340 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -33,6 +33,8 @@ import android.view.inputmethod.InputMethodManager; import java.util.ArrayList; +import com.android.launcher.R; + /** * Class for initiating a drag within a view or across multiple views. */ @@ -47,7 +49,6 @@ public class DragController { public static int DRAG_ACTION_COPY = 1; private static final int SCROLL_DELAY = 600; - private static final int SCROLL_ZONE = 20; private static final int VIBRATE_DURATION = 35; private static final boolean PROFILE_DRAWING_DURING_DRAG = false; @@ -87,6 +88,11 @@ public class DragController { /** Y offset from the upper-left corner of the cell to where we touched. */ private float mTouchOffsetY; + /** the area at the edge of the screen that makes the workspace go left + * or right while you're dragging. + */ + private int mScrollZone; + /** Where the drag originated */ private DragSource mDragSource; @@ -147,6 +153,7 @@ public class DragController { public DragController(Context context) { mContext = context; mHandler = new Handler(); + mScrollZone = context.getResources().getDimensionPixelSize(R.dimen.scroll_zone); } /** @@ -475,13 +482,13 @@ public class DragController { if (mDeleteRegion != null) { inDeleteRegion = mDeleteRegion.contains(x, y); } - if (!inDeleteRegion && x < SCROLL_ZONE) { + if (!inDeleteRegion && x < mScrollZone) { if (mScrollState == SCROLL_OUTSIDE_ZONE) { mScrollState = SCROLL_WAITING_IN_ZONE; mScrollRunnable.setDirection(SCROLL_LEFT); mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY); } - } else if (!inDeleteRegion && x > mScrollView.getWidth() - SCROLL_ZONE) { + } else if (!inDeleteRegion && x > mScrollView.getWidth() - mScrollZone) { if (mScrollState == SCROLL_OUTSIDE_ZONE) { mScrollState = SCROLL_WAITING_IN_ZONE; mScrollRunnable.setDirection(SCROLL_RIGHT); @@ -514,7 +521,7 @@ public class DragController { mMotionDownX = screenX; mMotionDownY = screenY; - if ((screenX < SCROLL_ZONE) || (screenX > mScrollView.getWidth() - SCROLL_ZONE)) { + if ((screenX < mScrollZone) || (screenX > mScrollView.getWidth() - mScrollZone)) { mScrollState = SCROLL_WAITING_IN_ZONE; mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY); } else { |