From e4ab715a425bdf7fff81a4125c81c8e268eb0d70 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sun, 29 Dec 2013 13:46:58 -0800 Subject: #173 Forgot to add setting to disable share tab --- res/values/strings.xml | 2 ++ res/xml/settings.xml | 6 ++++++ 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 @@ Whether or not to display the podcast listing in the pull out drawer Bookmarks Enabled Whether or not to display the bookmarks listing in the pull out drawer + Shares Enabled + Whether or not to display the shares listing in the pull out drawer Sync Sync Enabled Whether or not playlists or podcasts are periodically checked for changes 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"/> + + 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 backStack = new ArrayList(); @@ -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; } } -- cgit v1.2.3