From 20f03e6dcf8574130e18d5d0bb506bedcb3c450a Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sun, 27 Oct 2013 22:50:47 -0700 Subject: Show up when decending down fragments --- .../daneren2005/dsub/activity/SubsonicActivity.java | 8 +++----- .../dsub/activity/SubsonicFragmentActivity.java | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'src/github') diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index b041e18c..4f6af4d5 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -208,9 +208,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte } }; drawer.setDrawerListener(drawerToggle); - if(this.getClass() != SubsonicFragmentActivity.class) { - drawerToggle.setDrawerIndicatorEnabled(false); - } + drawerToggle.setDrawerIndicatorEnabled(false); } @Override @@ -255,7 +253,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte if(drawerToggle.onOptionsItemSelected(item)) { return true; } else if(item.getItemId() == android.R.id.home) { - finish(); + onBackPressed(); return true; } @@ -365,7 +363,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte trans.commit(); recreateSpinner(); } - private void removeCurrent() { + protected void removeCurrent() { if(currentFragment != null) { currentFragment.setPrimaryFragment(false); } diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index e3975703..5e3835a3 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -249,6 +249,12 @@ public class SubsonicFragmentActivity extends SubsonicActivity { executorService.shutdown(); } + @Override + public void setContentView(int viewId) { + super.setContentView(viewId); + drawerToggle.setDrawerIndicatorEnabled(true); + } + @Override public boolean onOptionsItemSelected(MenuItem item) { if(super.onOptionsItemSelected(item)) { @@ -269,6 +275,19 @@ public class SubsonicFragmentActivity extends SubsonicActivity { } } } + + @Override + public void replaceFragment(SubsonicFragment fragment, int id, int tag) { + super.replaceFragment(fragment, id, tag); + drawerToggle.setDrawerIndicatorEnabled(false); + } + @Override + protected void removeCurrent() { + super.removeCurrent(); + if(backStack.isEmpty()) { + drawerToggle.setDrawerIndicatorEnabled(true); + } + } @Override public void startFragmentActivity(String fragmentType) { -- cgit v1.2.3