diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-11-10 20:53:25 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-11-10 20:53:25 -0800 |
commit | 4656ce51bad7e2a7ac538c7dea3c6a29e284b84f (patch) | |
tree | e5795b6a3828c4dc940ca98b1518f10fb93ed5f4 /src/github/daneren2005 | |
parent | 8ea01fa72b44a0a47e07001344dee20edc87e148 (diff) | |
download | dsub-4656ce51bad7e2a7ac538c7dea3c6a29e284b84f.tar.gz dsub-4656ce51bad7e2a7ac538c7dea3c6a29e284b84f.tar.bz2 dsub-4656ce51bad7e2a7ac538c7dea3c6a29e284b84f.zip |
Fixed drawer icons to be themed, added settings to drawer
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicActivity.java | 24 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 3 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 3c884683..0ac2aa19 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -158,12 +158,17 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte drawerList.setOnItemClickListener(new ListView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- startFragmentActivity(drawerItemsDescriptions[position]);
+ if("Settings".equals(drawerItemsDescriptions[position])) {
+ startActivity(new Intent(SubsonicActivity.this, SettingsActivity.class));
+ drawer.closeDrawers();
+ } else {
+ startFragmentActivity(drawerItemsDescriptions[position]);
- if(lastSelectedView != view) {
- lastSelectedView.setBackgroundResource(android.R.color.transparent);
- view.setBackgroundResource(R.color.dividerColor);
- lastSelectedView = view;
+ if(lastSelectedView != view) {
+ lastSelectedView.setBackgroundResource(android.R.color.transparent);
+ view.setBackgroundResource(R.color.dividerColor);
+ lastSelectedView = view;
+ }
}
}
});
@@ -383,10 +388,15 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte List<String> drawerItemsDescriptionsList = new ArrayList<String>(Arrays.asList(drawerItemsDescriptions));
List<Integer> drawerItemsIconsList = new ArrayList<Integer>();
- TypedArray typedArray = getResources().obtainTypedArray(R.array.drawerItemIcons);
+ int[] arrayAttr = {R.attr.drawerItemsIcons};
+ TypedArray arrayType = obtainStyledAttributes(arrayAttr);
+ int arrayId = arrayType.getResourceId(0, 0);
+ TypedArray iconType = getResources().obtainTypedArray(arrayId);
for(int i = 0; i < drawerItemsList.size(); i++) {
- drawerItemsIconsList.add(typedArray.getResourceId(i, 0));
+ drawerItemsIconsList.add(iconType.getResourceId(i, 0));
}
+ iconType.recycle();
+ arrayType.recycle();
// Selectively remove podcast listing [3]
if(!podcastsEnabled) {
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 18c9476a..5965db0b 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -144,9 +144,6 @@ public class SubsonicFragment extends Fragment { case R.id.menu_exit:
exit();
return true;
- case R.id.menu_settings:
- startActivity(new Intent(context, SettingsActivity.class));
- return true;
}
return false;
|