diff options
author | John Reck <jreck@google.com> | 2011-08-11 17:36:41 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-11 17:36:41 -0700 |
commit | 4da81c8ec8fa457f091c709ff0986353f7ffe08f (patch) | |
tree | 6ad42e6708ccc33ffb14b0bf26191e75df89d0bf | |
parent | 3844ef8ce0908597ea5b472a817b4e22bf22d4e9 (diff) | |
parent | eac25cd7ae17cd626fe55060dcd0a003e6171ad7 (diff) | |
download | packages_apps_Browser-4da81c8ec8fa457f091c709ff0986353f7ffe08f.zip packages_apps_Browser-4da81c8ec8fa457f091c709ff0986353f7ffe08f.tar.gz packages_apps_Browser-4da81c8ec8fa457f091c709ff0986353f7ffe08f.tar.bz2 |
Merge "Menu shuffling"
-rw-r--r-- | res/menu/browser.xml | 27 | ||||
-rw-r--r-- | res/menu/ua_switcher.xml | 9 | ||||
-rw-r--r-- | src/com/android/browser/Controller.java | 2 | ||||
-rw-r--r-- | src/com/android/browser/NavigationBarBase.java | 5 | ||||
-rw-r--r-- | src/com/android/browser/PhoneUi.java | 4 |
5 files changed, 23 insertions, 24 deletions
diff --git a/res/menu/browser.xml b/res/menu/browser.xml index d5bdf04..d3dc7d0 100644 --- a/res/menu/browser.xml +++ b/res/menu/browser.xml @@ -39,36 +39,23 @@ 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_history_holo_dark" - android:alphabeticShortcut="b" - android:visible="@bool/menu_show_bookmarks" /> - <item android:id="@+id/add_bookmark_menu_id" android:title="@string/save_to_bookmarks" android:icon="@drawable/ic_bookmark_on_holo_dark" android:alphabeticShortcut="d" android:visible="@bool/menu_show_bookmarks" /> <item - android:id="@+id/find_menu_id" - android:title="@*android:string/find_on_page" - android:icon="@*android:drawable/ic_menu_find" - android:alphabeticShortcut="f" /> + android:id="@+id/bookmarks_menu_id" + android:title="@string/bookmarks" + android:icon="@drawable/ic_bookmarks_history_holo_dark" + android:alphabeticShortcut="b" + android:visible="@bool/menu_show_bookmarks" /> <item android:id="@+id/share_page_menu_id" android:title="@string/share_page" android:icon="@drawable/ic_share_holo_dark" android:alphabeticShortcut="s" /> <item - android:id="@+id/save_snapshot_menu_id" - android:title="@string/menu_save_snapshot" /> - <item - android:id="@+id/page_info_menu_id" - android:title="@string/page_info" - android:icon="@drawable/ic_pageinfo_holo_dark" - android:alphabeticShortcut="g" /> - <item android:id="@+id/view_downloads_menu_id" android:title="@string/menu_view_download" android:icon="@drawable/ic_downloads_holo_dark" @@ -118,6 +105,10 @@ android:alphabeticShortcut="l" /> <item android:id="@+id/close_menu_id" android:alphabeticShortcut="w" /> + <item android:id="@+id/find_menu_id" + android:alphabeticShortcut="f" /> + <item android:id="@+id/page_info_menu_id" + android:alphabeticShortcut="g" /> </group> <!-- these items are toggled in and out of @+id/stop_reload_menu_id --> <item android:id="@+id/stop_menu_id" diff --git a/res/menu/ua_switcher.xml b/res/menu/ua_switcher.xml index 5076fb2..51236de 100644 --- a/res/menu/ua_switcher.xml +++ b/res/menu/ua_switcher.xml @@ -23,5 +23,14 @@ android:id="@+id/ua_desktop_menu_id" android:checkable="true" android:title="@string/ua_switcher_desktop" /> + <item + android:id="@+id/find_menu_id" + android:title="@*android:string/find_on_page"/> + <item + android:id="@+id/save_snapshot_menu_id" + android:title="@string/menu_save_snapshot" /> + <item + android:id="@+id/page_info_menu_id" + android:title="@string/page_info" /> </menu> diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 7c93e9f..cafbafb 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1518,8 +1518,6 @@ public class Controller counter.setVisible(showDebugSettings); counter.setEnabled(showDebugSettings); - MenuItem saveSnapshot = menu.findItem(R.id.save_snapshot_menu_id); - saveSnapshot.setVisible(tab != null && !tab.isSnapshot()); mUi.updateMenuState(tab, menu); } diff --git a/src/com/android/browser/NavigationBarBase.java b/src/com/android/browser/NavigationBarBase.java index e6eed18..aa8b79f 100644 --- a/src/com/android/browser/NavigationBarBase.java +++ b/src/com/android/browser/NavigationBarBase.java @@ -121,6 +121,11 @@ public class NavigationBarBase extends LinearLayout implements OnClickListener, popup.getMenuInflater().inflate(R.menu.ua_switcher, menu); menu.findItem(R.id.ua_mobile_menu_id).setChecked(!desktop); menu.findItem(R.id.ua_desktop_menu_id).setChecked(desktop); + Tab tab = mUiController.getCurrentTab(); + MenuItem saveSnapshot = menu.findItem(R.id.save_snapshot_menu_id); + saveSnapshot.setVisible(tab != null && !tab.isSnapshot()); + MenuItem find = menu.findItem(R.id.find_menu_id); + find.setVisible(tab != null && !tab.isSnapshot()); popup.setOnMenuItemClickListener(this); popup.show(); } diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index f33dbef..7321267 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -180,10 +180,6 @@ public class PhoneUi extends BaseUi { if (nt != null) { nt.setVisible(mNavScreen == null); } - MenuItem find = menu.findItem(R.id.find_menu_id); - if (find != null) { - find.setVisible(((tab != null) && !tab.isSnapshot())); - } MenuItem abm = menu.findItem(R.id.add_bookmark_menu_id); if (abm != null) { abm.setVisible((tab != null) && !tab.isSnapshot()); |