diff options
author | Michael Kolb <kolby@google.com> | 2011-04-20 16:45:33 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-04-20 16:59:41 -0700 |
commit | fedb492d1ac1068e17028b6d4083d1a6b0578287 (patch) | |
tree | 0b8c336e13052d9e32eb5756dd8ef4975841abdd | |
parent | f205560dacc8a85f0443ca1949a68962404321e8 (diff) | |
download | packages_apps_Browser-fedb492d1ac1068e17028b6d4083d1a6b0578287.zip packages_apps_Browser-fedb492d1ac1068e17028b6d4083d1a6b0578287.tar.gz packages_apps_Browser-fedb492d1ac1068e17028b6d4083d1a6b0578287.tar.bz2 |
remove menu inflation hack
Change-Id: I481f35120cb753f3c2f8cce815cff2ab4597e16b
-rw-r--r-- | src/com/android/browser/BaseUi.java | 7 | ||||
-rw-r--r-- | src/com/android/browser/NavScreen.java | 7 | ||||
-rw-r--r-- | src/com/android/browser/PhoneUi.java | 8 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index 43bc7d6..1e0e183 100644 --- a/src/com/android/browser/BaseUi.java +++ b/src/com/android/browser/BaseUi.java @@ -17,6 +17,7 @@ package com.android.browser; import com.android.browser.Tab.LockIcon; +import com.android.internal.view.menu.MenuBuilder; import android.animation.ObjectAnimator; import android.app.Activity; @@ -776,4 +777,10 @@ public abstract class BaseUi implements UI, WebViewFactory { } } + protected Menu getMenu() { + MenuBuilder menu = new MenuBuilder(mActivity); + mActivity.getMenuInflater().inflate(R.menu.browser, menu); + return menu; + } + } diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java index 8b897df..a1fa639 100644 --- a/src/com/android/browser/NavScreen.java +++ b/src/com/android/browser/NavScreen.java @@ -86,7 +86,10 @@ public class NavScreen extends LinearLayout implements OnClickListener { requestLayout(); } - protected void showMenu(Menu menu) { + protected void showMenu() { + Menu menu = mUi.getMenu(); + menu.setGroupVisible(R.id.NAV_MENU, false); + MenuAdapter menuAdapter = new MenuAdapter(mContext); menuAdapter.setMenu(menu); ListPopupWindow popup = new ListPopupWindow(mContext); @@ -207,7 +210,7 @@ public class NavScreen extends LinearLayout implements OnClickListener { mUi.hideNavScreen(true); mUiController.openTabToHomePage(); } else if (mMore == v) { - mActivity.openOptionsMenu(); + showMenu(); } else if (mNewIncognito == v) { mUi.hideNavScreen(true); mUiController.openIncognitoTab(); diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index 3415e39..f2ace49 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -284,16 +284,12 @@ public class PhoneUi extends BaseUi { @Override public boolean onPrepareOptionsMenu(Menu menu) { - menu.setGroupVisible(R.id.NAV_MENU, false); if (mUseQuickControls) { + menu.setGroupVisible(R.id.NAV_MENU, false); mPieControl.onMenuOpened(menu); return false; - } else { - if (mNavScreen != null) { - mNavScreen.showMenu(menu); - } - return false; } + return true; } @Override |