summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AppsCustomizeTabHost.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-02-10 15:43:22 -0800
committerWinson Chung <winsonc@google.com>2012-02-17 11:14:29 -0800
commit7044272f180d34ab29866f6c59ee75376e8a1df5 (patch)
tree11347a033b082e5f4a035e4c35b33f4dd8c28452 /src/com/android/launcher2/AppsCustomizeTabHost.java
parenta900bd5a434a3a8ce9de77d6a1abb2c3798399de (diff)
downloadandroid_packages_apps_Trebuchet-7044272f180d34ab29866f6c59ee75376e8a1df5.tar.gz
android_packages_apps_Trebuchet-7044272f180d34ab29866f6c59ee75376e8a1df5.tar.bz2
android_packages_apps_Trebuchet-7044272f180d34ab29866f6c59ee75376e8a1df5.zip
Allow touches to fall through AllApps nearing end of transition (Bug: 5991846, 6016062, 5991846)
- Also updating mTransitionProgress so control when drops succeed Change-Id: I2f672c64f0a87249dcf7d254f963b8b2710c849f
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizeTabHost.java')
-rw-r--r--src/com/android/launcher2/AppsCustomizeTabHost.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index a5964dfca..4639c57cc 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -53,6 +53,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
private LinearLayout mContent;
private boolean mInTransition;
+ private boolean mTransitioningToWorkspace;
private boolean mResetAfterTransition;
public AppsCustomizeTabHost(Context context, AttributeSet attrs) {
@@ -154,8 +155,23 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
+ public boolean onInterceptTouchEvent(MotionEvent ev) {
+ // If we are mid transition then intercept touch events here so we can ignore them
+ if (mInTransition) {
+ return true;
+ }
+ return super.onInterceptTouchEvent(ev);
+ };
+
@Override
public boolean onTouchEvent(MotionEvent event) {
+ // Allow touch events to fall through if we are transitioning to the workspace
+ if (mInTransition) {
+ if (mTransitioningToWorkspace) {
+ return super.onTouchEvent(event);
+ }
+ }
+
// Intercept all touch events up to the bottom of the AppsCustomizePane so they do not fall
// through to the workspace and trigger showWorkspace()
if (event.getY() < mAppsCustomizePane.getBottom()) {
@@ -349,6 +365,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
@Override
public void onLauncherTransitionStart(Launcher l, boolean animated, boolean toWorkspace) {
mInTransition = true;
+ mTransitioningToWorkspace = toWorkspace;
if (toWorkspace) {
// Going from All Apps -> Workspace
@@ -377,6 +394,11 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
}
@Override
+ public void onLauncherTransitionStep(Launcher l, float t) {
+ // Do nothing
+ }
+
+ @Override
public void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace) {
mInTransition = false;
if (animated) {