diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2014-11-17 22:23:57 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2014-11-17 22:02:38 +0000 |
commit | 468b86b64baf6f1c60154ab6a0fd82d93ff66d33 (patch) | |
tree | efe3a8d1e67001ce3ccbcc059d0f6ce10dbe19ae | |
parent | 878734c325693f0a71df88e091645bd05fe21f3b (diff) | |
download | android_packages_apps_CMFileManager-468b86b64baf6f1c60154ab6a0fd82d93ff66d33.tar.gz android_packages_apps_CMFileManager-468b86b64baf6f1c60154ab6a0fd82d93ff66d33.tar.bz2 android_packages_apps_CMFileManager-468b86b64baf6f1c60154ab6a0fd82d93ff66d33.zip |
cmfm: Fix FC with hardware menu
JIRA: NIGHTLIES-364
https://jira.cyanogenmod.org/browse/NIGHTLIES-364
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Change-Id: I6c3f56f841f7ec69004cd4a280fdd191a47e4844
-rw-r--r-- | src/com/cyanogenmod/filemanager/activities/NavigationActivity.java | 62 |
1 files changed, 5 insertions, 57 deletions
diff --git a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java index 6770acfa..72149e70 100644 --- a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java @@ -417,8 +417,6 @@ public class NavigationActivity extends Activity private boolean mExitFlag = false; private long mExitBackTimeout = -1; - private View mOptionsAnchorView; - private int mOrientation; /** @@ -1535,7 +1533,11 @@ public class NavigationActivity extends Activity @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_MENU) { - showOverflowPopUp(this.mOptionsAnchorView); + if (mDrawerLayout.isDrawerOpen(mDrawer)) { + mDrawerLayout.closeDrawer(mDrawer); + } else { + mDrawerLayout.openDrawer(mDrawer); + } return true; } if (keyCode == KeyEvent.KEYCODE_BACK) { @@ -1632,10 +1634,6 @@ public class NavigationActivity extends Activity openSearch(); break; - case R.id.ab_overflow: - showOverflowPopUp(view); - break; - default: break; } @@ -1852,56 +1850,6 @@ public class NavigationActivity extends Activity } /** - * Method that shows a popup with the activity main menu. - * - * @param anchor The action button that was pressed - */ - private void showOverflowPopUp(View anchor) { - SimpleMenuListAdapter adapter = - new HighlightedSimpleMenuListAdapter(this, R.menu.navigation); - Menu menu = adapter.getMenu(); - int cc = this.mActionBar.getChildCount(); - for (int i = 0, j = this.mActionBar.getChildCount() - 1; i < cc; i++, j--) { - View child = this.mActionBar.getChildAt(i); - boolean visible = child.getVisibility() == View.VISIBLE; - if (visible) { - menu.removeItem(menu.getItem(j).getItemId()); - } - } - - final ListPopupWindow popup = DialogHelper.createListPopupWindow(this, adapter, anchor); - popup.setOnItemClickListener(new OnItemClickListener() { - @Override - public void onItemClick( - final AdapterView<?> parent, final View v, final int position, final long id) { - - final int itemId = (int)id; - NavigationActivity.this.mHandler.post(new Runnable() { - @Override - public void run() { - popup.dismiss(); - switch (itemId) { - case R.id.mnu_settings: - //Settings - openSettings(); - break; - - case R.id.mnu_search: - //Search - openSearch(); - popup.dismiss(); - break; - default: - break; - } - } - }); - } - }); - popup.show(); - } - - /** * Method that show the information of a filesystem mount point. * * @param mp The mount point info |