diff options
author | Michael Kolb <kolby@google.com> | 2011-12-05 18:04:12 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-05 18:04:12 -0800 |
commit | cf824c593d415aa63c00e6e1e902dd143f018af6 (patch) | |
tree | 26069730df2982d50ed0b3e6bdc5f62165bf887b | |
parent | 7b58357727083f90946bf413a904ff26a858301b (diff) | |
parent | 0d0245ffd51825f90a9df883667a71e500da03fa (diff) | |
download | android_packages_apps_Gello-cf824c593d415aa63c00e6e1e902dd143f018af6.tar.gz android_packages_apps_Gello-cf824c593d415aa63c00e6e1e902dd143f018af6.tar.bz2 android_packages_apps_Gello-cf824c593d415aa63c00e6e1e902dd143f018af6.zip |
am 0d0245ff: Add Bookmarks option to phone menu
* commit '0d0245ffd51825f90a9df883667a71e500da03fa':
Add Bookmarks option to phone menu
-rw-r--r-- | res/menu/browser.xml | 5 | ||||
-rw-r--r-- | src/com/android/browser/PhoneUi.java | 4 | ||||
-rw-r--r-- | src/com/android/browser/XLargeUi.java | 12 |
3 files changed, 21 insertions, 0 deletions
diff --git a/res/menu/browser.xml b/res/menu/browser.xml index bf95574a..bd40c51e 100644 --- a/res/menu/browser.xml +++ b/res/menu/browser.xml @@ -39,6 +39,11 @@ android:title="@string/new_incognito_tab" android:icon="@drawable/ic_new_incognito_holo_dark" /> <item + android:id="@+id/bookmarks_menu_id" + android:title="@string/bookmarks" + android:icon="@drawable/ic_bookmarks_holo_dark" + android:showAsAction="never" /> + <item android:id="@+id/add_bookmark_menu_id" android:title="@string/save_to_bookmarks" android:icon="@drawable/ic_bookmark_on_holo_dark" diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index 37d0b341..4da0668a 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -194,6 +194,10 @@ public class PhoneUi extends BaseUi { @Override public void updateMenuState(Tab tab, Menu menu) { + MenuItem bm = menu.findItem(R.id.bookmarks_menu_id); + if (bm != null) { + bm.setVisible(!showingNavScreen()); + } MenuItem abm = menu.findItem(R.id.add_bookmark_menu_id); if (abm != null) { abm.setVisible((tab != null) && !tab.isSnapshot() && !showingNavScreen()); diff --git a/src/com/android/browser/XLargeUi.java b/src/com/android/browser/XLargeUi.java index 556e88d1..c828df42 100644 --- a/src/com/android/browser/XLargeUi.java +++ b/src/com/android/browser/XLargeUi.java @@ -30,6 +30,8 @@ import android.util.Log; import android.view.ActionMode; import android.view.Gravity; import android.view.KeyEvent; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.webkit.WebChromeClient.CustomViewCallback; @@ -145,6 +147,16 @@ public class XLargeUi extends BaseUi { } } + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + MenuItem bm = menu.findItem(R.id.bookmarks_menu_id); + if (bm != null) { + bm.setVisible(false); + } + return true; + } + + // WebView callbacks @Override |