summaryrefslogtreecommitdiff
path: root/Source/Android/src
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-05-26 22:29:40 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2013-05-26 22:29:40 -0500
commitf06fc78814dbc1a30a85c226fd8a9801dfdd34a0 (patch)
tree73e7a837a3cd7a22062bab2fc5cc51bc3ea90e2f /Source/Android/src
parent0bd8aaf9d428a59c761caecb50d56172824edbd5 (diff)
[Android] Properly open the navigation drawer when pressing menu or back in the game list.
Diffstat (limited to 'Source/Android/src')
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java35
1 files changed, 14 insertions, 21 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java
index ad2df58fa3..314e8e0ae5 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java
@@ -6,7 +6,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
-import android.view.MenuItem;
+import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
@@ -205,25 +205,18 @@ public class GameListView extends ListActivity {
mDrawer.setContentView(layoutResID);
onContentChanged();
}
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case android.R.id.home:
- mDrawer.toggleMenu();
- return true;
- }
-
- return super.onOptionsItemSelected(item);
- }
-
- @Override
- public void onBackPressed() {
- final int drawerState = mDrawer.getDrawerState();
- if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
- mDrawer.closeMenu();
- return;
- }
- super.onBackPressed();
- }
+ @Override
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
+ if (event.getAction() == KeyEvent.KEYCODE_MENU|| event.getAction() == KeyEvent.KEYCODE_BACK) {
+ final int drawerState = mDrawer.getDrawerState();
+ if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
+ mDrawer.closeMenu();
+ return true;
+ }
+ mDrawer.openMenu();
+ return true;
+ }
+ return false;
+ }
}