diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-02-26 14:56:28 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-02-26 14:56:28 -0800 |
commit | 228a90ccdf5427972bcd99e723e5ecfdfd77d64b (patch) | |
tree | 996ad0659a2ebb61fddea9ff4041f61d92037770 | |
parent | 43abbff91ac4ed65476d245ff4be929d0aff6149 (diff) | |
download | dsub-228a90ccdf5427972bcd99e723e5ecfdfd77d64b.tar.gz dsub-228a90ccdf5427972bcd99e723e5ecfdfd77d64b.tar.bz2 dsub-228a90ccdf5427972bcd99e723e5ecfdfd77d64b.zip |
#293 Add option to open directly to library
-rw-r--r-- | res/values/strings.xml | 2 | ||||
-rw-r--r-- | res/xml/settings.xml | 6 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java | 3 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/util/Constants.java | 1 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/util/Util.java | 7 |
5 files changed, 18 insertions, 1 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 1b5f3f9e..a80f0c67 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -277,6 +277,8 @@ <string name="settings.track_summary">Display Track # in front of songs if one exists</string>
<string name="settings.custom_sort">Custom Sort</string>
<string name="settings.custom_sort_summary">Override default server sorting to sort by disc number and by year.</string>
+ <string name="settings.open_to_library">Open To Library</string>
+ <string name="settings.open_to_library_summary">Open directly to the library screen instead of opening to home.</string>
<string name="settings.network_title">Network</string>
<string name="settings.max_bitrate_wifi">Max Audio bitrate - Wi-Fi</string>
<string name="settings.max_bitrate_mobile">Max Audio bitrate - Mobile</string>
diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 573da94b..749fc100 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -55,6 +55,12 @@ android:key="customSortEnabled" android:defaultValue="true"/> + <CheckBoxPreference + android:title="@string/settings.open_to_library" + android:summary="@string/settings.open_to_library_summary" + android:key="openToLibrary" + android:defaultValue="false"/> + </PreferenceCategory> <PreferenceCategory diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index a1fd04f9..a17e8bb7 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -101,6 +101,9 @@ public class SubsonicFragmentActivity extends SubsonicActivity { if (findViewById(R.id.fragment_container) != null && savedInstanceState == null) {
String fragmentType = getIntent().getStringExtra(Constants.INTENT_EXTRA_FRAGMENT_TYPE);
+ if(fragmentType == null && Util.isOpenToLibrary(this) {
+ fragmentType = "Artist";
+ }
currentFragment = getNewFragment(fragmentType);
if("".equals(fragmentType) || fragmentType == null) {
diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java index 1818c266..0ed86bc8 100644 --- a/src/github/daneren2005/dsub/util/Constants.java +++ b/src/github/daneren2005/dsub/util/Constants.java @@ -137,6 +137,7 @@ public final class Constants { public static final String PREFERENCES_KEY_MENU_SHARED = "showShared"; public static final String PREFERENCES_KEY_SHARED_ENABLED = "sharedEnabled"; public static final String PREFERENCES_KEY_BROWSE_TAGS = "browseTags"; + public static final String PREFERENCES_KEY_OPEN_TO_LIBRARY = "openToLibrary"; public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount"; public static final String OFFLINE_SCROBBLE_ID = "scrobbleID"; diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java index 6140444d..55143b99 100644 --- a/src/github/daneren2005/dsub/util/Util.java +++ b/src/github/daneren2005/dsub/util/Util.java @@ -392,7 +392,12 @@ public final class Util { SharedPreferences prefs = getPreferences(context); return prefs.getBoolean(Constants.PREFERENCES_KEY_BROWSE_TAGS + instance, false); } - + + public static boolean isOpenToLibrary(Context context) { + SharedPreferences prefs = getPreferences(context); + return prefs.getBoolean(Constants.PREFERENCES_KEY_OPEN_TO_LIBRARY, false); + } + public static String getVideoPlayerType(Context context) { SharedPreferences prefs = getPreferences(context); return prefs.getString(Constants.PREFERENCES_KEY_VIDEO_PLAYER, "raw"); |