aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java10
-rw-r--r--src/github/daneren2005/dsub/fragments/SettingsFragment.java3
-rw-r--r--src/github/daneren2005/dsub/util/Constants.java2
-rw-r--r--src/github/daneren2005/dsub/util/Util.java4
4 files changed, 12 insertions, 7 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
index 74ef4894..d9686c98 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
@@ -114,10 +114,12 @@ public class SubsonicFragmentActivity extends SubsonicActivity {
if (findViewById(R.id.fragment_container) != null && savedInstanceState == null) {
String fragmentType = getIntent().getStringExtra(Constants.INTENT_EXTRA_FRAGMENT_TYPE);
boolean firstRun = false;
- if(fragmentType == null && Util.isOpenToLibrary(this)) {
- fragmentType = "Artist";
- getIntent().putExtra(Constants.INTENT_EXTRA_FRAGMENT_TYPE, fragmentType);
- firstRun = true;
+ if(fragmentType == null) {
+ fragmentType = Util.openToTab(this);
+ if(fragmentType != null) {
+ getIntent().putExtra(Constants.INTENT_EXTRA_FRAGMENT_TYPE, fragmentType);
+ firstRun = true;
+ }
}
currentFragment = getNewFragment(fragmentType);
diff --git a/src/github/daneren2005/dsub/fragments/SettingsFragment.java b/src/github/daneren2005/dsub/fragments/SettingsFragment.java
index 8dfca3b7..8402e29a 100644
--- a/src/github/daneren2005/dsub/fragments/SettingsFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SettingsFragment.java
@@ -88,6 +88,7 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
private String internalSSID;
private String internalSSIDDisplay;
private EditTextPreference cacheSize;
+ private ListPreference openToTab;
private int serverCount = 3;
private SharedPreferences settings;
@@ -182,6 +183,7 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
replayGainBump = this.findPreference(Constants.PREFERENCES_KEY_REPLAY_GAIN_BUMP);
replayGainUntagged = this.findPreference(Constants.PREFERENCES_KEY_REPLAY_GAIN_UNTAGGED);
cacheSize = (EditTextPreference) this.findPreference(Constants.PREFERENCES_KEY_CACHE_SIZE);
+ openToTab = (ListPreference) this.findPreference(Constants.PREFERENCES_KEY_OPEN_TO_TAB);
settings = Util.getPreferences(context);
serverCount = settings.getInt(Constants.PREFERENCES_KEY_SERVER_COUNT, 1);
@@ -308,6 +310,7 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
pauseDisconnect.setSummary(pauseDisconnect.getEntry());
videoPlayer.setSummary(videoPlayer.getEntry());
syncInterval.setSummary(syncInterval.getEntry());
+ openToTab.setSummary(openToTab.getEntry());
try {
if(megabyteFromat == null) {
megabyteFromat = new DecimalFormat(getResources().getString(R.string.util_bytes_format_megabyte));
diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java
index 50070d6f..7298c7b4 100644
--- a/src/github/daneren2005/dsub/util/Constants.java
+++ b/src/github/daneren2005/dsub/util/Constants.java
@@ -136,7 +136,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 PREFERENCES_KEY_OPEN_TO_TAB = "openToTab";
public static final String PREFERENCES_KEY_OVERRIDE_SYSTEM_LANGUAGE = "overrideSystemLanguage";
public static final String PREFERENCES_KEY_PLAY_NOW_AFTER = "playNowAfter";
public static final String PREFERENCES_KEY_LARGE_ALBUM_ART = "largeAlbumArt";
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index c90548b9..01588bf2 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -414,9 +414,9 @@ public final class Util {
}
}
- public static boolean isOpenToLibrary(Context context) {
+ public static String openToTab(Context context) {
SharedPreferences prefs = getPreferences(context);
- return prefs.getBoolean(Constants.PREFERENCES_KEY_OPEN_TO_LIBRARY, false);
+ return prefs.getString(Constants.PREFERENCES_KEY_OPEN_TO_TAB, null);
}
public static String getVideoPlayerType(Context context) {