From 1ff706b8c03063740ca74868fea46fa47d71bb27 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Tue, 14 Sep 2010 17:35:20 -0700 Subject: [PATCH] fix two crashes * fix crash where Workspace gets an ACTION_MOVE but didn't get the ACTION_DOWN before it * fix crash in DimmableBubbleTextView on non-xlarge devices (buganizer bug#3001211) Change-Id: I419b4a9fd3c95df9949f1d46746845ad2dc4b831 --- res/layout-land/application.xml | 2 +- res/layout-port/application.xml | 8 ++++---- res/layout-xlarge-land/application.xml | 18 ++++++++++++++++++ res/layout-xlarge-port/application.xml | 18 ++++++++++++++++++ src/com/android/launcher2/PagedView.java | 12 +++++++++--- 5 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 res/layout-xlarge-land/application.xml create mode 100644 res/layout-xlarge-port/application.xml diff --git a/res/layout-land/application.xml b/res/layout-land/application.xml index 846c81c1db..6e8c31e117 100644 --- a/res/layout-land/application.xml +++ b/res/layout-land/application.xml @@ -14,5 +14,5 @@ limitations under the License. --> - diff --git a/res/layout-port/application.xml b/res/layout-port/application.xml index ec66976589..32c1510d98 100644 --- a/res/layout-port/application.xml +++ b/res/layout-port/application.xml @@ -4,9 +4,9 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,5 +14,5 @@ limitations under the License. --> - + diff --git a/res/layout-xlarge-land/application.xml b/res/layout-xlarge-land/application.xml new file mode 100644 index 0000000000..d0c8d9bf66 --- /dev/null +++ b/res/layout-xlarge-land/application.xml @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/res/layout-xlarge-port/application.xml b/res/layout-xlarge-port/application.xml new file mode 100644 index 0000000000..ec66976589 --- /dev/null +++ b/res/layout-xlarge-port/application.xml @@ -0,0 +1,18 @@ + + + + diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index ebb28f9281..1e0dad4aef 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -545,15 +545,21 @@ public abstract class PagedView extends ViewGroup { return true; } - switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_MOVE: { /* * mIsBeingDragged == false, otherwise the shortcut would have caught it. Check * whether the user has moved far enough from his original down touch. */ - determineScrollingStart(ev); - break; + if (mActivePointerId != INVALID_POINTER) { + determineScrollingStart(ev); + break; + } + // if mActivePointerId is INVALID_POINTER, then we must have missed an ACTION_DOWN + // event. in that case, treat the first occurence of a move event as a ACTION_DOWN + // i.e. fall through to the next case (don't break) + // (We sometimes miss ACTION_DOWN events in Workspace because it ignores all events + // while it's small- this was causing a crash before we checked for INVALID_POINTER) } case MotionEvent.ACTION_DOWN: {