aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-08-27 18:04:30 -0700
committerScott Jackson <daneren2005@gmail.com>2015-08-27 18:04:30 -0700
commit3e8c34bdebe67c83cc8108efd5d87348640001de (patch)
tree25aa82fb6afc469b1dfc3bdf1be8847a15ed29df /app
parenta74a93210233eb26c23552d0af4c44d848bca2ce (diff)
downloaddsub-3e8c34bdebe67c83cc8108efd5d87348640001de.tar.gz
dsub-3e8c34bdebe67c83cc8108efd5d87348640001de.tar.bz2
dsub-3e8c34bdebe67c83cc8108efd5d87348640001de.zip
Some code cleanup on when to display what in drawer toggle
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java7
-rw-r--r--app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java15
2 files changed, 6 insertions, 16 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
index f336d178..f7cdd92c 100644
--- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -818,11 +818,12 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
if(currentFragment == null || currentFragment.getTitle() == null) {
return;
}
- if(spinnerAdapter == null) {
+ if(spinnerAdapter == null || getSupportActionBar().getCustomView() == null) {
createCustomActionBarView();
}
if(backStack.size() > 0) {
+ createCustomActionBarView();
spinnerAdapter.clear();
for(int i = 0; i < backStack.size(); i++) {
CharSequence title = backStack.get(i).getTitle();
@@ -842,9 +843,13 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
if(!isTv()) {
getSupportActionBar().setDisplayShowCustomEnabled(true);
}
+
+ drawerToggle.setDrawerIndicatorEnabled(false);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} else if(!isTv()) {
getSupportActionBar().setTitle(currentFragment.getTitle());
getSupportActionBar().setDisplayShowCustomEnabled(false);
+ drawerToggle.setDrawerIndicatorEnabled(true);
}
}
diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
index 56b14ca9..7808d8c0 100644
--- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
+++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
@@ -190,16 +190,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
nowPlayingToolbar.setVisibility(View.GONE);
nowPlayingFragment.setPrimaryFragment(false);
setSupportActionBar(mainToolbar);
-
- if(getSupportActionBar().getCustomView() == null) {
- createCustomActionBarView();
- }
recreateSpinner();
- if(drawerToggle != null && backStack.size() > 0) {
- drawerToggle.setDrawerIndicatorEnabled(false);
- } else {
- drawerToggle.setDrawerIndicatorEnabled(true);
- }
}
@Override
@@ -488,9 +479,6 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
trans.commit();
} else {
super.replaceFragment(fragment, tag, replaceCurrent);
- if (drawerToggle != null) {
- drawerToggle.setDrawerIndicatorEnabled(false);
- }
}
}
@Override
@@ -507,9 +495,6 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
supportInvalidateOptionsMenu();
} else {
super.removeCurrent();
- if (drawerToggle != null && backStack.isEmpty()) {
- drawerToggle.setDrawerIndicatorEnabled(true);
- }
}
}