diff options
author | Winson Chung <winsonc@google.com> | 2011-06-02 10:49:29 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-06-08 16:42:03 -0700 |
commit | b26f3d6a8c62e7c1a603b6c7979375d8dd4f20d4 (patch) | |
tree | 9dadb1d6bbfdd26d57fbf579748b9445c8074113 /src/com/android/launcher2/AppsCustomizePagedView.java | |
parent | c0dcf597084d00e4c23a7fea5fd0738f6c095a6b (diff) | |
download | android_packages_apps_Trebuchet-b26f3d6a8c62e7c1a603b6c7979375d8dd4f20d4.tar.gz android_packages_apps_Trebuchet-b26f3d6a8c62e7c1a603b6c7979375d8dd4f20d4.tar.bz2 android_packages_apps_Trebuchet-b26f3d6a8c62e7c1a603b6c7979375d8dd4f20d4.zip |
Modifying AppsCustomize behaviour to use springloaded mode.
Change-Id: I21d181ad3d245731ee8402915f8918b91bfc4553
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizePagedView.java')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizePagedView.java | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 62a8936a1..464bb44fb 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -410,9 +410,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen protected boolean beginDragging(View v) { if (!super.beginDragging(v)) return false; - // Hide the pane so that the user can drop onto the workspace, we must do this first, - // due to how the drop target layout is computed when we start dragging to the workspace. - mLauncher.showWorkspace(true); if (v instanceof PagedViewIcon) { beginDraggingApplication(v); @@ -420,6 +417,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen beginDraggingWidget(v); } + // Go into spring loaded mode + int currentPageIndex = mLauncher.getWorkspace().getCurrentPage(); + CellLayout currentPage = (CellLayout) mLauncher.getWorkspace().getChildAt(currentPageIndex); + mLauncher.enterSpringLoadedDragMode(currentPage); return true; } private void endDragging(boolean success) { @@ -439,8 +440,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen if (allAppsInfoButton != null) allAppsInfoButton.setDragAndDropEnabled(false); } }); + mLauncher.exitSpringLoadedDragMode(); mLauncher.getWorkspace().onDragStopped(success); mLauncher.unlockScreenOrientation(); + } /* @@ -781,6 +784,34 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen return mContentWidth; } + @Override + protected void onPageBeginMoving() { + /* TO BE ENABLED LATER + setChildrenDrawnWithCacheEnabled(true); + for (int i = 0; i < getChildCount(); ++i) { + View v = getChildAt(i); + if (v instanceof PagedViewCellLayout) { + ((PagedViewCellLayout) v).setChildrenDrawingCacheEnabled(true); + } + } + */ + super.onPageBeginMoving(); + } + + @Override + protected void onPageEndMoving() { + /* TO BE ENABLED LATER + for (int i = 0; i < getChildCount(); ++i) { + View v = getChildAt(i); + if (v instanceof PagedViewCellLayout) { + ((PagedViewCellLayout) v).setChildrenDrawingCacheEnabled(false); + } + } + setChildrenDrawnWithCacheEnabled(false); + */ + super.onPageEndMoving(); + } + /* * AllAppsView implementation */ |