diff options
author | Romain Guy <romainguy@google.com> | 2009-04-28 15:18:25 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2009-04-28 15:18:25 -0700 |
commit | 5a94139ff6f5378901f8530f8dd3833d218e966d (patch) | |
tree | bd0adf9c85cadf7d7be2c78acc02bbfc35afa408 /src/com/android/launcher/Launcher.java | |
parent | 71b0594a6fc7339281add91d2ac61b181f89a2af (diff) | |
download | android_packages_apps_Trebuchet-5a94139ff6f5378901f8530f8dd3833d218e966d.tar.gz android_packages_apps_Trebuchet-5a94139ff6f5378901f8530f8dd3833d218e966d.tar.bz2 android_packages_apps_Trebuchet-5a94139ff6f5378901f8530f8dd3833d218e966d.zip |
Fixes #1780990. Do not save the open state of the drawer when the user leaves Home by launching an application.
Diffstat (limited to 'src/com/android/launcher/Launcher.java')
-rw-r--r-- | src/com/android/launcher/Launcher.java | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/com/android/launcher/Launcher.java b/src/com/android/launcher/Launcher.java index 3bf96aae8..575497565 100644 --- a/src/com/android/launcher/Launcher.java +++ b/src/com/android/launcher/Launcher.java @@ -71,7 +71,6 @@ import android.view.View.OnLongClickListener; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.GridView; -import android.widget.ListView; import android.widget.SlidingDrawer; import android.widget.TextView; import android.widget.Toast; @@ -353,7 +352,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On } // Make sure that the search gadget (if any) is in its normal place. - stopSearch(false); + stopSearch(); } @Override @@ -767,9 +766,11 @@ public final class Launcher extends Activity implements View.OnClickListener, On super.onSaveInstanceState(outState); } - if (mDrawer.isOpened()) { + // When the drawer is opened and we are saving the state because of a + // configuration change + if (mDrawer.isOpened() && getChangingConfigurations() != 0) { outState.putBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, true); - } + } if (mAddItemCellInfo != null && mAddItemCellInfo.valid && mWaitingForResult) { final CellLayout.CellInfo addItemCellInfo = mAddItemCellInfo; @@ -841,9 +842,10 @@ public final class Launcher extends Activity implements View.OnClickListener, On /** * Show the search dialog immediately, without changing the search widget. - * See {@link Activity.startSearch()} for the arguments. + * + * @see Activity#startSearch(String, boolean, android.os.Bundle, boolean) */ - public void showSearchDialog(String initialQuery, boolean selectInitialQuery, + void showSearchDialog(String initialQuery, boolean selectInitialQuery, Bundle appSearchData, boolean globalSearch) { if (initialQuery == null) { @@ -866,7 +868,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On searchManager.setOnCancelListener(new SearchManager.OnCancelListener() { public void onCancel() { searchManager.setOnCancelListener(null); - stopSearch(true); + stopSearch(); } }); } @@ -877,11 +879,8 @@ public final class Launcher extends Activity implements View.OnClickListener, On /** * Cancel search dialog if it is open. - * - * @param animate Whether to animate the search gadget (if any) when restoring it - * to its original position. */ - public void stopSearch(boolean animate) { + void stopSearch() { // Close search dialog SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); if (searchManager.isVisible()) { @@ -913,8 +912,8 @@ public final class Launcher extends Activity implements View.OnClickListener, On .setAlphabeticShortcut('N'); final Intent settings = new Intent(android.provider.Settings.ACTION_SETTINGS); - settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK - | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | + Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); menu.add(0, MENU_SETTINGS, 0, R.string.menu_settings) .setIcon(android.R.drawable.ic_menu_preferences).setAlphabeticShortcut('P') |