diff options
author | John Reck <jreck@google.com> | 2010-12-07 17:38:34 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2010-12-07 17:40:03 -0800 |
commit | d4893b0263f751f188f62ee3d64b3c5e129c98ed (patch) | |
tree | a06e70c71950c3cdd0cfea75605b68728641457c /src/com/android/browser/ShortcutActivity.java | |
parent | ffce12cded5227cc94752de75e3f00acdbf9c90f (diff) | |
download | packages_apps_Browser-d4893b0263f751f188f62ee3d64b3c5e129c98ed.zip packages_apps_Browser-d4893b0263f751f188f62ee3d64b3c5e129c98ed.tar.gz packages_apps_Browser-d4893b0263f751f188f62ee3d64b3c5e129c98ed.tar.bz2 |
Adds a cancel button to ShortcutActivity dialog
Bug: 3167402
Adds a cancel button to the ShortcutActivity when it is being
shown as a dialog (when large)
Change-Id: I6e47db8770cd18f69d534c361ff8fc90128e8dad
Diffstat (limited to 'src/com/android/browser/ShortcutActivity.java')
-rw-r--r-- | src/com/android/browser/ShortcutActivity.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/com/android/browser/ShortcutActivity.java b/src/com/android/browser/ShortcutActivity.java index 786c6e1..33e192a 100644 --- a/src/com/android/browser/ShortcutActivity.java +++ b/src/com/android/browser/ShortcutActivity.java @@ -21,9 +21,11 @@ import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; +import android.view.View; +import android.view.View.OnClickListener; public class ShortcutActivity extends Activity - implements BookmarksPageCallbacks { + implements BookmarksPageCallbacks, OnClickListener { private BrowserBookmarksPage mBookmarks; @@ -32,14 +34,16 @@ public class ShortcutActivity extends Activity super.onCreate(savedInstanceState); // TODO: Is this needed? setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); - mBookmarks = BrowserBookmarksPage.newInstance(this, null, null); + setContentView(R.layout.pick_bookmark); + mBookmarks = (BrowserBookmarksPage) getFragmentManager() + .findFragmentById(R.id.bookmarks); mBookmarks.setEnableContextMenu(false); mBookmarks.setBreadCrumbMaxVisible(2); mBookmarks.setBreadCrumbUseBackButton(true); - getFragmentManager() - .openTransaction() - .add(android.R.id.content, mBookmarks) - .commit(); + View cancel = findViewById(R.id.cancel); + if (cancel != null) { + cancel.setOnClickListener(this); + } } // BookmarksPageCallbacks @@ -70,4 +74,13 @@ public class ShortcutActivity extends Activity @Override public void onFolderChanged(int level, Uri uri) { } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.cancel: + finish(); + break; + } + } } |