diff options
-rw-r--r-- | res/values/strings.xml | 2 | ||||
-rw-r--r-- | res/xml/settings.xml | 6 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicActivity.java | 9 |
3 files changed, 13 insertions, 4 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 21d54fe5..6cd0ec40 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -365,6 +365,8 @@ <string name="settings.podcasts_enabled_summary">Whether or not to display the podcast listing in the pull out drawer</string>
<string name="settings.bookmarks_enabled">Bookmarks Enabled</string>
<string name="settings.bookmarks_enabled_summary">Whether or not to display the bookmarks listing in the pull out drawer</string>
+ <string name="settings.shares_enabled">Shares Enabled</string>
+ <string name="settings.shares_enabled_summary">Whether or not to display the shares listing in the pull out drawer</string>
<string name="settings.sync_title">Sync</string>
<string name="settings.sync_enabled">Sync Enabled</string>
<string name="settings.sync_enabled_summary">Whether or not playlists or podcasts are periodically checked for changes</string>
diff --git a/res/xml/settings.xml b/res/xml/settings.xml index d9430282..5d1a1ce6 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -116,6 +116,12 @@ android:summary="@string/settings.bookmarks_enabled_summary" android:key="bookmarksEnabled" android:defaultValue="true"/> + + <CheckBoxPreference + android:title="@string/settings.shares_enabled" + android:summary="@string/settings.shares_enabled_summary" + android:key="sharedEnabled" + android:defaultValue="true"/> </PreferenceCategory> </PreferenceScreen> diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 77a592bb..b7e5eac8 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -80,7 +80,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte private String[] drawerItemsDescriptions;
private String[] drawerItems;
private boolean drawerIdle = true;
- private boolean[] enabledItems = {true, true, true};
+ private boolean[] enabledItems = {true, true, true, true};
private boolean destroyed = false;
private boolean finished = false;
protected List<SubsonicFragment> backStack = new ArrayList<SubsonicFragment>();
@@ -378,7 +378,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte boolean sharedEnabled = prefs.getBoolean(Constants.PREFERENCES_KEY_SHARED_ENABLED, true) && !Util.isOffline(this);
boolean chatEnabled = prefs.getBoolean(Constants.PREFERENCES_KEY_CHAT_ENABLED, true) && !Util.isOffline(this);
- if(drawerItems == null || !enabledItems[0] == podcastsEnabled || !enabledItems[1] == bookmarksEnabled || !enabledItems[2] == chatEnabled) {
+ if(drawerItems == null || !enabledItems[0] == podcastsEnabled || !enabledItems[1] == bookmarksEnabled || !enabledItems[2] == sharedEnabled || !enabledItems[3] == chatEnabled) {
drawerItems = getResources().getStringArray(R.array.drawerItems);
drawerItemsDescriptions = getResources().getStringArray(R.array.drawerItemsDescriptions);
@@ -415,7 +415,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte }
// Selectively remove shared listing [5]
- if(!bookmarksEnabled) {
+ if(!sharedEnabled) {
drawerItemsList.remove(5 - alreadyRemoved);
drawerItemsDescriptionsList.remove(5 - alreadyRemoved);
drawerItemsIconsList.remove(5 - alreadyRemoved);
@@ -439,7 +439,8 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte drawerList.setAdapter(new DrawerAdapter(this, drawerItemsList, drawerItemsIconsList));
enabledItems[0] = podcastsEnabled;
enabledItems[1] = bookmarksEnabled;
- enabledItems[2] = chatEnabled;
+ enabledItems[2] = sharedEnabled;
+ enabledItems[3] = chatEnabled;
}
}
|