aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-11-08 19:45:26 -0800
committerScott Jackson <daneren2005@gmail.com>2013-11-08 19:45:26 -0800
commit7e29cd25020392fa66c792e756bee3b1a29cbf65 (patch)
tree34a1796f5522fd01369b106686c97e516a7723ff /src
parent1d6294de8292f6945534f3ed4819b86d11c6ea75 (diff)
downloaddsub-7e29cd25020392fa66c792e756bee3b1a29cbf65.tar.gz
dsub-7e29cd25020392fa66c792e756bee3b1a29cbf65.tar.bz2
dsub-7e29cd25020392fa66c792e756bee3b1a29cbf65.zip
Added a basic menu for when drawer is pulled out
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicActivity.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index 135a76a2..71b2b790 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -85,6 +85,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
ActionBarDrawerToggle drawerToggle;
ListView drawerList;
View lastSelectedView = null;
+ boolean drawerOpen = false;
@Override
protected void onCreate(Bundle bundle) {
@@ -169,6 +170,9 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
setTitle(currentFragment.getTitle());
drawerIdle = true;
+ drawerOpen = false;
+
+ invalidateOptionsMenu();
}
@Override
@@ -182,6 +186,9 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
getSupportActionBar().setDisplayShowCustomEnabled(false);
drawerIdle = true;
+ drawerOpen = true;
+
+ invalidateOptionsMenu();
}
@Override
@@ -272,8 +279,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- if(currentFragment != null) {
- MenuInflater menuInflater = getMenuInflater();
+ MenuInflater menuInflater = getMenuInflater();
+ if(drawerOpen == true) {
+ menuInflater.inflate(R.menu.drawer_menu, menu);
+ } else if(currentFragment != null) {
currentFragment.onCreateOptionsMenu(menu, menuInflater);
}
return true;