aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--subsonic-android/res/values/strings.xml2
-rw-r--r--subsonic-android/res/xml/settings.xml6
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java5
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/util/Constants.java1
4 files changed, 13 insertions, 1 deletions
diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml
index 9ad821a6..10e5bd4c 100644
--- a/subsonic-android/res/values/strings.xml
+++ b/subsonic-android/res/values/strings.xml
@@ -277,6 +277,8 @@
<string name="settings.gapless_playback">Gapless Playback</string>
<string name="settings.gapless_playback_summary">The Galaxy S3 seems to be experiencing freezes/other weird issue since the introduction of gapless playback. Turn this off to fix the issue.</string>
<string name="settings.chat_refresh">Chat Refresh Rate (Secs)</string>
+ <string name="settings.chat_enabled">Chat Enabled</string>
+ <string name="settings.chat_enabled_summary">Whether or not to display the chat tab</string>
<string name="shuffle.startYear">Start Year:</string>
<string name="shuffle.endYear">End Year:</string>
diff --git a/subsonic-android/res/xml/settings.xml b/subsonic-android/res/xml/settings.xml
index 49c8a634..17a51621 100644
--- a/subsonic-android/res/xml/settings.xml
+++ b/subsonic-android/res/xml/settings.xml
@@ -131,6 +131,12 @@
<PreferenceCategory
android:title="@string/button_bar.chat">
+
+ <CheckBoxPreference
+ android:title="@string/settings.chat_enabled"
+ android:summary="@string/settings.chat_enabled_summary"
+ android:key="chatEnabled"
+ android:defaultValue="true"/>
<EditTextPreference
android:title="@string/settings.chat_refresh"
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java
index 16036bf1..059db330 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java
@@ -152,7 +152,10 @@ public class MainActivity extends SubsonicActivity {
addTab("Home", MainFragment.class, null);
addTab("Library", SelectArtistFragment.class, null);
addTab("Playlists", SelectPlaylistFragment.class, null);
- addTab("Chat", ChatFragment.class, null);
+ SharedPreferences prefs = Util.getPreferences(this);
+ if(prefs.getBoolean(Constants.PREFERENCES_KEY_CHAT_ENABLED, true)) {
+ addTab("Chat", ChatFragment.class, null);
+ }
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setHomeButtonEnabled(false);
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/Constants.java b/subsonic-android/src/github/daneren2005/dsub/util/Constants.java
index e82b8111..29c9a1aa 100644
--- a/subsonic-android/src/github/daneren2005/dsub/util/Constants.java
+++ b/subsonic-android/src/github/daneren2005/dsub/util/Constants.java
@@ -102,6 +102,7 @@ public final class Constants {
public static final String PREFERENCES_KEY_GAPLESS_PLAYBACK = "gaplessPlayback";
public static final String PREFERENCES_KEY_SHUFFLE_MODE = "shuffleMode";
public static final String PREFERENCES_KEY_CHAT_REFRESH = "chatRefreshRate";
+ public static final String PREFERENCES_KEY_CHAT_ENABLED = "chatEnabled";
public static final String MAIN_BACK_STACK = "backStackIds";
public static final String MAIN_BACK_STACK_SIZE = "backStackIdsSize";