diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-11-02 00:07:56 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-11-02 00:07:56 -0700 |
commit | 5da5d9db0171f58d313fc27f7115cc7869def281 (patch) | |
tree | fd02386d5974e95e5c48d82ffcb1569b0202b080 | |
parent | 51391b1c9d6b34ddf1c5d89f07e9c1858a5ebfd7 (diff) | |
download | dsub-5da5d9db0171f58d313fc27f7115cc7869def281.tar.gz dsub-5da5d9db0171f58d313fc27f7115cc7869def281.tar.bz2 dsub-5da5d9db0171f58d313fc27f7115cc7869def281.zip |
#162 Highlight top level currently selected
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicActivity.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 4c92d11c..3576c12f 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -81,6 +81,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte DrawerLayout drawer;
ActionBarDrawerToggle drawerToggle;
ListView drawerList;
+ View lastSelectedView = null;
@Override
protected void onCreate(Bundle bundle) {
@@ -165,6 +166,12 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte } else if("Exit".equals(drawerItemsDescriptions[position])) {
exit();
}
+
+ if(lastSelectedView != view) {
+ lastSelectedView.setBackgroundResource(android.R.color.transparent);
+ view.setBackgroundResource(R.color.dividerColor);
+ lastSelectedView = view;
+ }
}
});
@@ -177,6 +184,11 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte @Override
public void onDrawerOpened(View view) {
+ if(lastSelectedView == null) {
+ lastSelectedView = drawerList.getChildAt(0);
+ lastSelectedView.setBackgroundResource(R.color.dividerColor);
+ }
+
getSupportActionBar().setTitle(R.string.common_appname);
getSupportActionBar().setDisplayShowCustomEnabled(false);
}
|