summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/CustomizePagedView.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2010-11-15 13:45:50 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-15 13:45:50 -0800
commit67f7f18203b2ada5e8d5eea771f73c6448af6d93 (patch)
tree3991961b34fe8f8b839b2b05a43eb4b9c7b92b22 /src/com/android/launcher2/CustomizePagedView.java
parenteed565d5126cb40b2a7ecdf5f6e8ac7a7464007b (diff)
parente22a8e9d3eafe569fe0f4d284c77af08c6e2fe28 (diff)
downloadandroid_packages_apps_Trebuchet-67f7f18203b2ada5e8d5eea771f73c6448af6d93.tar.gz
android_packages_apps_Trebuchet-67f7f18203b2ada5e8d5eea771f73c6448af6d93.tar.bz2
android_packages_apps_Trebuchet-67f7f18203b2ada5e8d5eea771f73c6448af6d93.zip
Merge "Minor fixes to Launcher"
Diffstat (limited to 'src/com/android/launcher2/CustomizePagedView.java')
-rw-r--r--src/com/android/launcher2/CustomizePagedView.java42
1 files changed, 14 insertions, 28 deletions
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index 1763a00f6..a0e3528ec 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -303,9 +303,10 @@ public class CustomizePagedView extends PagedView
@Override
public void onClick(View v) {
- if (!v.isInTouchMode()) {
- return;
- }
+ // Return early if this is not initiated from a touch
+ if (!v.isInTouchMode()) return;
+ // Return early if we are still animating the pages
+ if (mNextPage == INVALID_PAGE) return;
// On certain pages, we allow single tap to mark items as selected so that they can be
// dropped onto the mini workspaces
@@ -368,9 +369,10 @@ public class CustomizePagedView extends PagedView
@Override
public boolean onLongClick(View v) {
- if (!v.isInTouchMode()) {
- return false;
- }
+ // Return early if this is not initiated from a touch
+ if (!v.isInTouchMode()) return false;
+ // Return early if we are still animating the pages
+ if (mNextPage == INVALID_PAGE) return false;
// End the current choice mode before we start dragging anything
if (isChoiceMode(CHOICE_MODE_SINGLE)) {
@@ -604,17 +606,9 @@ public class CustomizePagedView extends PagedView
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
- // Temporary change to prevent the last page from being too small (and items bleeding
- // onto it). We can remove this once we properly fix the fading algorithm
- if (i < numPages - 1) {
- addView(layout, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
- } else {
- addView(layout, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
- }
+ addView(layout, new LinearLayout.LayoutParams(
+ LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.MATCH_PARENT));
}
}
@@ -665,17 +659,9 @@ public class CustomizePagedView extends PagedView
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
- // Temporary change to prevent the last page from being too small (and items bleeding
- // onto it). We can remove this once we properly fix the fading algorithm
- if (i < numPages - 1) {
- addView(layout, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
- } else {
- addView(layout, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
- }
+ addView(layout, new LinearLayout.LayoutParams(
+ LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.MATCH_PARENT));
}
}