From e0aa0774ae962afdcfbfe4cd40d3c77aa55c61fb Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 24 May 2013 08:48:16 -0700 Subject: Added option to disable chat menu --- .../src/github/daneren2005/dsub/activity/MainActivity.java | 5 ++++- subsonic-android/src/github/daneren2005/dsub/util/Constants.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'subsonic-android/src') 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"; -- cgit v1.2.3