aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2014-11-17 22:23:57 +0100
committerJorge Ruesga <jorge@ruesga.com>2014-11-17 22:26:05 +0100
commit4191e0d9e355c5373c5d662fb87e2e6d858d8fd0 (patch)
treeefe3a8d1e67001ce3ccbcc059d0f6ce10dbe19ae
parent3240c35dd327ff94654f68ade1c51719182e6b5c (diff)
downloadandroid_packages_apps_CMFileManager-4191e0d9e355c5373c5d662fb87e2e6d858d8fd0.tar.gz
android_packages_apps_CMFileManager-4191e0d9e355c5373c5d662fb87e2e6d858d8fd0.tar.bz2
android_packages_apps_CMFileManager-4191e0d9e355c5373c5d662fb87e2e6d858d8fd0.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.java62
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