summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher/Launcher.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-06-23 17:34:54 -0700
committerRomain Guy <romainguy@android.com>2009-06-23 17:34:54 -0700
commit1ce1a24cba4dc41bccfeab6fccb2f3355423841a (patch)
tree277d1f889e4e5fb1977441fa75b4ba6153b46a68 /src/com/android/launcher/Launcher.java
parent417d23428af00d928805c88c7731ccd0ece7fab2 (diff)
downloadandroid_packages_apps_Trebuchet-1ce1a24cba4dc41bccfeab6fccb2f3355423841a.tar.gz
android_packages_apps_Trebuchet-1ce1a24cba4dc41bccfeab6fccb2f3355423841a.tar.bz2
android_packages_apps_Trebuchet-1ce1a24cba4dc41bccfeab6fccb2f3355423841a.zip
Fixes #1937447. Home was not saving the appropriate state when losing focus.
Diffstat (limited to 'src/com/android/launcher/Launcher.java')
-rw-r--r--src/com/android/launcher/Launcher.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/com/android/launcher/Launcher.java b/src/com/android/launcher/Launcher.java
index 2e7281874..328a5ca2b 100644
--- a/src/com/android/launcher/Launcher.java
+++ b/src/com/android/launcher/Launcher.java
@@ -519,6 +519,8 @@ public final class Launcher extends Activity implements View.OnClickListener, On
mRestoring = true;
}
+ mCurrentGesture = (Gesture) savedState.get(RUNTIME_STATE_PENDING_GESTURE);
+
boolean gesturesShowing = savedState.getBoolean(RUNTIME_STATE_GESTURES_PANEL, false);
if (gesturesShowing) {
final Gesture gesture = (Gesture) savedState.get(RUNTIME_STATE_GESTURES_PANEL_GESTURE);
@@ -536,8 +538,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
}
});
}
-
- mCurrentGesture = (Gesture) savedState.get(RUNTIME_STATE_PENDING_GESTURE);
}
/**
@@ -1056,12 +1056,14 @@ public final class Launcher extends Activity implements View.OnClickListener, On
outState.putParcelable(RUNTIME_STATE_PENDING_GESTURE, mCurrentGesture);
}
- if (mGesturesWindow != null && mGesturesWindow.isShowing() && isConfigurationChange) {
+ if (mGesturesWindow != null && mGesturesWindow.isShowing()) {
outState.putBoolean(RUNTIME_STATE_GESTURES_PANEL, true);
- final Gesture gesture = mGesturesOverlay.getGesture();
- if (gesture != null) {
- outState.putParcelable(RUNTIME_STATE_GESTURES_PANEL_GESTURE, gesture);
+ if (mCurrentGesture == null || !mWaitingForResult) {
+ final Gesture gesture = mGesturesOverlay.getGesture();
+ if (gesture != null) {
+ outState.putParcelable(RUNTIME_STATE_GESTURES_PANEL_GESTURE, gesture);
+ }
}
}
}
@@ -2427,6 +2429,10 @@ public final class Launcher extends Activity implements View.OnClickListener, On
mMatcher.gesture = overlay.getGesture();
if (mMatcher.gesture.getLength() < GesturesConstants.LENGTH_THRESHOLD) {
overlay.clear(false);
+ if (mGesturesAction.intent != null) {
+ mGesturesAction.intent = null;
+ setGesturesNextPrompt(null, getString(R.string.gestures_unknown));
+ }
} else {
mMatcher.run();
}
@@ -2436,6 +2442,10 @@ public final class Launcher extends Activity implements View.OnClickListener, On
mMatcher.gesture = overlay.getGesture();
if (mMatcher.gesture.getLength() < GesturesConstants.LENGTH_THRESHOLD) {
overlay.clear(false);
+ if (mGesturesAction.intent != null) {
+ mGesturesAction.intent = null;
+ setGesturesNextPrompt(null, getString(R.string.gestures_unknown));
+ }
} else {
overlay.postDelayed(mMatcher, GesturesConstants.MATCH_DELAY);
}
@@ -2473,6 +2483,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
}
if (!match){
+ mGesturesAction.intent = null;
if (animate) {
setGesturesNextPrompt(null, getString(R.string.gestures_unknown));
} else {
@@ -2488,7 +2499,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private void updatePrompt(ApplicationInfo info, boolean animate) {
if (mGesturesAction.intent != null &&
- info.intent.toURI().equals(mGesturesAction.intent.toURI()) &&
+ info.intent.toUri(0).equals(mGesturesAction.intent.toUri(0)) &&
info.title.equals(((TextView) mGesturesPrompt.getCurrentView()).getText())) {
return;
}