diff options
Diffstat (limited to 'src/com/cyanogenmod')
-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 |