diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-10-27 22:50:47 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-10-27 22:50:47 -0700 |
commit | 20f03e6dcf8574130e18d5d0bb506bedcb3c450a (patch) | |
tree | 17045a555be30ed46b26d7a00624fe144e0a1816 /src/github | |
parent | 1beffd3861d94e07717317fe336032e64e5da2b4 (diff) | |
download | dsub-20f03e6dcf8574130e18d5d0bb506bedcb3c450a.tar.gz dsub-20f03e6dcf8574130e18d5d0bb506bedcb3c450a.tar.bz2 dsub-20f03e6dcf8574130e18d5d0bb506bedcb3c450a.zip |
Show up when decending down fragments
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicActivity.java | 8 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java | 19 |
2 files changed, 22 insertions, 5 deletions
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 @@ -250,6 +250,12 @@ public class SubsonicFragmentActivity extends SubsonicActivity { }
@Override
+ public void setContentView(int viewId) {
+ super.setContentView(viewId);
+ drawerToggle.setDrawerIndicatorEnabled(true);
+ }
+
+ @Override
public boolean onOptionsItemSelected(MenuItem item) {
if(super.onOptionsItemSelected(item)) {
return true;
@@ -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) {
|