diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-14 14:51:25 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-14 14:51:25 -0700 |
commit | 949b3eb9d3ced2a068fcec5a96a2d8b0e90d2fa2 (patch) | |
tree | 30aa30b8d6b040aabe3e6ca8f50de065adf5c3cc /src/com/android/launcher | |
parent | 6f227eba4bdf96102e6dda24ff6c9961a6c41c38 (diff) | |
parent | 7b4ef330d9675733bc950c07e8907d8a00966de8 (diff) | |
download | android_packages_apps_Trebuchet-949b3eb9d3ced2a068fcec5a96a2d8b0e90d2fa2.tar.gz android_packages_apps_Trebuchet-949b3eb9d3ced2a068fcec5a96a2d8b0e90d2fa2.tar.bz2 android_packages_apps_Trebuchet-949b3eb9d3ced2a068fcec5a96a2d8b0e90d2fa2.zip |
Merge change 7136 into donut
* changes:
Fix the lock issue on Home. This was caused by onPrepareDialog().
Diffstat (limited to 'src/com/android/launcher')
-rw-r--r-- | src/com/android/launcher/Launcher.java | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/com/android/launcher/Launcher.java b/src/com/android/launcher/Launcher.java index 8863bd935..000ce1485 100644 --- a/src/com/android/launcher/Launcher.java +++ b/src/com/android/launcher/Launcher.java @@ -2014,14 +2014,14 @@ public final class Launcher extends Activity implements View.OnClickListener, On protected void onPrepareDialog(int id, Dialog dialog) { switch (id) { case DIALOG_CREATE_SHORTCUT: - mWorkspace.lock(); break; case DIALOG_RENAME_FOLDER: - mWorkspace.lock(); - EditText input = (EditText) dialog.findViewById(R.id.folder_name); - final CharSequence text = mFolderInfo.title; - input.setText(text); - input.setSelection(0, text.length()); + if (mFolderInfo != null) { + EditText input = (EditText) dialog.findViewById(R.id.folder_name); + final CharSequence text = mFolderInfo.title; + input.setText(text); + input.setSelection(0, text.length()); + } break; } } @@ -2090,7 +2090,15 @@ public final class Launcher extends Activity implements View.OnClickListener, On } ); builder.setView(layout); - return builder.create(); + + final AlertDialog dialog = builder.create(); + dialog.setOnShowListener(new DialogInterface.OnShowListener() { + public void onShow(DialogInterface dialog) { + mWorkspace.lock(); + } + }); + + return dialog; } private void changeFolderName() { @@ -2133,7 +2141,9 @@ public final class Launcher extends Activity implements View.OnClickListener, On * appropriate activity. */ private class CreateShortcut implements DialogInterface.OnClickListener, - DialogInterface.OnCancelListener, DialogInterface.OnDismissListener { + DialogInterface.OnCancelListener, DialogInterface.OnDismissListener, + DialogInterface.OnShowListener { + private AddAdapter mAdapter; Dialog createDialog() { @@ -2150,6 +2160,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On AlertDialog dialog = builder.create(); dialog.setOnCancelListener(this); dialog.setOnDismissListener(this); + dialog.setOnShowListener(this); return dialog; } @@ -2239,6 +2250,10 @@ public final class Launcher extends Activity implements View.OnClickListener, On } } } + + public void onShow(DialogInterface dialog) { + mWorkspace.lock(); + } } /** |