aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-11-27 11:53:21 -0800
committerScott Jackson <daneren2005@gmail.com>2015-11-27 11:53:21 -0800
commit32e04ec3166362b3232d72232a66f2cc1f0ab0a3 (patch)
treebe5ff34f945e84aae4d5546fbf678f6879508457 /app
parente09c70e5d112bd6b7142892b25697212a745e963 (diff)
downloaddsub-32e04ec3166362b3232d72232a66f2cc1f0ab0a3.tar.gz
dsub-32e04ec3166362b3232d72232a66f2cc1f0ab0a3.tar.bz2
dsub-32e04ec3166362b3232d72232a66f2cc1f0ab0a3.zip
#580, #596 Make setting open up a normal new fragment
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java7
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/PreferenceCompatFragment.java29
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java308
-rw-r--r--app/src/main/res/xml/settings.xml489
-rw-r--r--app/src/main/res/xml/settings_appearance.xml146
-rw-r--r--app/src/main/res/xml/settings_cache.xml99
-rw-r--r--app/src/main/res/xml/settings_drawer.xml51
-rw-r--r--app/src/main/res/xml/settings_playback.xml142
-rw-r--r--app/src/main/res/xml/settings_servers.xml14
-rw-r--r--app/src/main/res/xml/settings_sync.xml50
10 files changed, 720 insertions, 615 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
index 632b4c55..e63692f6 100644
--- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
+++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java
@@ -611,7 +611,12 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
sessionInitialized = true;
}
private void loadSettings() {
- PreferenceManager.setDefaultValues(this, R.xml.settings, false);
+ PreferenceManager.setDefaultValues(this, R.xml.settings_appearance, false);
+ PreferenceManager.setDefaultValues(this, R.xml.settings_cache, false);
+ PreferenceManager.setDefaultValues(this, R.xml.settings_drawer, false);
+ PreferenceManager.setDefaultValues(this, R.xml.settings_sync, false);
+ PreferenceManager.setDefaultValues(this, R.xml.settings_playback, false);
+
SharedPreferences prefs = Util.getPreferences(this);
if (!prefs.contains(Constants.PREFERENCES_KEY_CACHE_LOCATION) || prefs.getString(Constants.PREFERENCES_KEY_CACHE_LOCATION, null) == null) {
resetCacheLocation(prefs);
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/PreferenceCompatFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/PreferenceCompatFragment.java
index 9f413b3b..201a1fdb 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/PreferenceCompatFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/PreferenceCompatFragment.java
@@ -29,6 +29,7 @@ import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -40,7 +41,8 @@ import java.lang.reflect.Method;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.util.Constants;
-public class PreferenceCompatFragment extends SubsonicFragment {
+public abstract class PreferenceCompatFragment extends SubsonicFragment {
+ private static final String TAG = PreferenceCompatFragment.class.getSimpleName();
private static final int FIRST_REQUEST_CODE = 100;
private static final int MSG_BIND_PREFERENCES = 1;
private static final String PREFERENCES_TAG = "android:preferences";
@@ -114,10 +116,25 @@ public class PreferenceCompatFragment extends SubsonicFragment {
setPreferenceScreen(screen);
}
- public void addPreferencesFromResource(int resId) {
+ public PreferenceScreen addPreferencesFromResource(int resId) {
requirePreferenceManager();
PreferenceScreen screen = inflateFromResource(getActivity(), resId, getPreferenceScreen());
setPreferenceScreen(screen);
+
+ for(int i = 0; i < screen.getPreferenceCount(); i++) {
+ Preference preference = screen.getPreference(i);
+ if(preference instanceof PreferenceScreen && preference.getKey() != null) {
+ preference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ onStartNewFragment(preference.getKey());
+ return false;
+ }
+ });
+ }
+ }
+
+ return screen;
}
public Preference findPreference(CharSequence key) {
@@ -139,7 +156,7 @@ public class PreferenceCompatFragment extends SubsonicFragment {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- getListView().setScrollBarStyle(0);
+ getListView().setScrollBarStyle(View.SCROLLBAR_POSITION_DEFAULT);
if (mHavePrefs) {
bindPreferences();
}
@@ -168,7 +185,8 @@ public class PreferenceCompatFragment extends SubsonicFragment {
int res = this.getArguments().getInt(Constants.INTENT_EXTRA_FRAGMENT_TYPE, 0);
if(res != 0) {
- addPreferencesFromResource(res);
+ PreferenceScreen preferenceScreen = addPreferencesFromResource(res);
+ onInitPreferences(preferenceScreen);
}
}
@@ -310,4 +328,7 @@ public class PreferenceCompatFragment extends SubsonicFragment {
}
return preferenceScreen;
}
+
+ protected abstract void onInitPreferences(PreferenceScreen preferenceScreen);
+ protected abstract void onStartNewFragment(String name);
}
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
index 925d69d7..0030ea4a 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
@@ -102,16 +102,6 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
}
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
- View root = super.onCreateView(inflater, container, bundle);
-
- this.setTitle(getResources().getString(R.string.settings_title));
- initSettings();
-
- return root;
- }
-
- @Override
public void onDestroy() {
super.onDestroy();
@@ -120,6 +110,33 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
}
@Override
+ protected void onStartNewFragment(String name) {
+ SettingsFragment newFragment = new SettingsFragment();
+ Bundle args = new Bundle();
+
+ int xml = 0;
+ if("appearance".equals(name)) {
+ xml = R.xml.settings_appearance;
+ } else if("drawer".equals(name)) {
+ xml = R.xml.settings_drawer;
+ } else if("cache".equals(name)) {
+ xml = R.xml.settings_cache;
+ } else if("sync".equals(name)) {
+ xml = R.xml.settings_sync;
+ } else if("playback".equals(name)) {
+ xml = R.xml.settings_playback;
+ } else if("servers".equals(name)) {
+ xml = R.xml.settings_servers;
+ }
+
+ if(xml != 0) {
+ args.putInt(Constants.INTENT_EXTRA_FRAGMENT_TYPE, xml);
+ newFragment.setArguments(args);
+ replaceFragment(newFragment);
+ }
+ }
+
+ @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
// Random error I have no idea how to reproduce
if(sharedPreferences == null) {
@@ -162,9 +179,12 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
scheduleBackup();
}
- private void initSettings() {
+ @Override
+ protected void onInitPreferences(PreferenceScreen preferenceScreen) {
+ this.setTitle(preferenceScreen.getTitle());
+
internalSSID = Util.getSSID(context);
- if(internalSSID == null) {
+ if (internalSSID == null) {
internalSSID = "";
}
internalSSIDDisplay = context.getResources().getString(R.string.settings_server_local_network_ssid_hint, internalSSID);
@@ -200,87 +220,93 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
settings = Util.getPreferences(context);
serverCount = settings.getInt(Constants.PREFERENCES_KEY_SERVER_COUNT, 1);
- this.findPreference("clearCache").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
- @Override
- public boolean onPreferenceClick(Preference preference) {
- Util.confirmDialog(context, R.string.common_delete, R.string.common_confirm_message_cache, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- new LoadingTask<Void>(context, false) {
- @Override
- protected Void doInBackground() throws Throwable {
- FileUtil.deleteMusicDirectory(context);
- FileUtil.deleteSerializedCache(context);
- FileUtil.deleteArtworkCache(context);
- FileUtil.deleteAvatarCache(context);
- return null;
- }
-
- @Override
- protected void done(Void result) {
- Util.toast(context, R.string.settings_cache_clear_complete);
- }
-
- @Override
- protected void error(Throwable error) {
- Util.toast(context, getErrorMessage(error), false);
- }
- }.execute();
- }
- });
- return false;
- }
- });
+ if(cacheSize != null) {
+ this.findPreference("clearCache").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ Util.confirmDialog(context, R.string.common_delete, R.string.common_confirm_message_cache, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ new LoadingTask<Void>(context, false) {
+ @Override
+ protected Void doInBackground() throws Throwable {
+ FileUtil.deleteMusicDirectory(context);
+ FileUtil.deleteSerializedCache(context);
+ FileUtil.deleteArtworkCache(context);
+ FileUtil.deleteAvatarCache(context);
+ return null;
+ }
+
+ @Override
+ protected void done(Void result) {
+ Util.toast(context, R.string.settings_cache_clear_complete);
+ }
+
+ @Override
+ protected void error(Throwable error) {
+ Util.toast(context, getErrorMessage(error), false);
+ }
+ }.execute();
+ }
+ });
+ return false;
+ }
+ });
+ }
- addServerPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
- @Override
- public boolean onPreferenceClick(Preference preference) {
- serverCount++;
- String instance = String.valueOf(serverCount);
- serversCategory.addPreference(addServer(serverCount));
-
- SharedPreferences.Editor editor = settings.edit();
- editor.putInt(Constants.PREFERENCES_KEY_SERVER_COUNT, serverCount);
- // Reset set folder ID
- editor.putString(Constants.PREFERENCES_KEY_MUSIC_FOLDER_ID + instance, null);
- editor.commit();
+ if(syncEnabled != null) {
+ this.findPreference(Constants.PREFERENCES_KEY_SYNC_ENABLED).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ Boolean syncEnabled = (Boolean) newValue;
- serverSettings.put(instance, new ServerSettings(instance));
+ Account account = new Account(Constants.SYNC_ACCOUNT_NAME, Constants.SYNC_ACCOUNT_TYPE);
+ ContentResolver.setSyncAutomatically(account, Constants.SYNC_ACCOUNT_PLAYLIST_AUTHORITY, syncEnabled);
+ ContentResolver.setSyncAutomatically(account, Constants.SYNC_ACCOUNT_PODCAST_AUTHORITY, syncEnabled);
- return true;
- }
- });
+ return true;
+ }
+ });
+ syncInterval.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ Integer syncInterval = Integer.parseInt(((String) newValue));
- this.findPreference(Constants.PREFERENCES_KEY_SYNC_ENABLED).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- Boolean syncEnabled = (Boolean) newValue;
+ Account account = new Account(Constants.SYNC_ACCOUNT_NAME, Constants.SYNC_ACCOUNT_TYPE);
+ ContentResolver.addPeriodicSync(account, Constants.SYNC_ACCOUNT_PLAYLIST_AUTHORITY, new Bundle(), 60L * syncInterval);
+ ContentResolver.addPeriodicSync(account, Constants.SYNC_ACCOUNT_PODCAST_AUTHORITY, new Bundle(), 60L * syncInterval);
- Account account = new Account(Constants.SYNC_ACCOUNT_NAME, Constants.SYNC_ACCOUNT_TYPE);
- ContentResolver.setSyncAutomatically(account, Constants.SYNC_ACCOUNT_PLAYLIST_AUTHORITY, syncEnabled);
- ContentResolver.setSyncAutomatically(account, Constants.SYNC_ACCOUNT_PODCAST_AUTHORITY, syncEnabled);
+ return true;
+ }
+ });
+ }
- return true;
- }
- });
- syncInterval.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- Integer syncInterval = Integer.parseInt(((String) newValue));
+ if(serversCategory != null) {
+ addServerPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ serverCount++;
+ String instance = String.valueOf(serverCount);
+ serversCategory.addPreference(addServer(serverCount));
- Account account = new Account(Constants.SYNC_ACCOUNT_NAME, Constants.SYNC_ACCOUNT_TYPE);
- ContentResolver.addPeriodicSync(account, Constants.SYNC_ACCOUNT_PLAYLIST_AUTHORITY, new Bundle(), 60L * syncInterval);
- ContentResolver.addPeriodicSync(account, Constants.SYNC_ACCOUNT_PODCAST_AUTHORITY, new Bundle(), 60L * syncInterval);
+ SharedPreferences.Editor editor = settings.edit();
+ editor.putInt(Constants.PREFERENCES_KEY_SERVER_COUNT, serverCount);
+ // Reset set folder ID
+ editor.putString(Constants.PREFERENCES_KEY_MUSIC_FOLDER_ID + instance, null);
+ editor.commit();
- return true;
- }
- });
+ serverSettings.put(instance, new ServerSettings(instance));
+
+ return true;
+ }
+ });
- serversCategory.setOrderingAsAdded(false);
- for (int i = 1; i <= serverCount; i++) {
- String instance = String.valueOf(i);
- serversCategory.addPreference(addServer(i));
- serverSettings.put(instance, new ServerSettings(instance));
+ serversCategory.setOrderingAsAdded(false);
+ for (int i = 1; i <= serverCount; i++) {
+ String instance = String.valueOf(i);
+ serversCategory.addPreference(addServer(i));
+ serverSettings.put(instance, new ServerSettings(instance));
+ }
}
SharedPreferences prefs = Util.getPreferences(context);
@@ -309,61 +335,77 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
return;
}
- theme.setSummary(theme.getEntry());
- maxBitrateWifi.setSummary(maxBitrateWifi.getEntry());
- maxBitrateMobile.setSummary(maxBitrateMobile.getEntry());
- maxVideoBitrateWifi.setSummary(maxVideoBitrateWifi.getEntry());
- maxVideoBitrateMobile.setSummary(maxVideoBitrateMobile.getEntry());
- networkTimeout.setSummary(networkTimeout.getEntry());
- cacheLocation.setSummary(cacheLocation.getText());
- preloadCountWifi.setSummary(preloadCountWifi.getEntry());
- preloadCountMobile.setSummary(preloadCountMobile.getEntry());
- keepPlayedCount.setSummary(keepPlayedCount.getEntry());
- tempLoss.setSummary(tempLoss.getEntry());
- 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));
- }
-
- cacheSize.setSummary(megabyteFromat.format((double) Integer.parseInt(cacheSize.getText())).replace(".00", ""));
- } catch(Exception e) {
- Log.e(TAG, "Failed to format cache size", e);
- cacheSize.setSummary(cacheSize.getText());
+ if(theme != null) {
+ theme.setSummary(theme.getEntry());
+ openToTab.setSummary(openToTab.getEntry());
}
- if(syncEnabled.isChecked()) {
- if(!syncInterval.isEnabled()) {
- syncInterval.setEnabled(true);
- syncWifi.setEnabled(true);
- syncNotification.setEnabled(true);
- syncStarred.setEnabled(true);
- syncMostRecent.setEnabled(true);
+
+ if(cacheSize != null) {
+ maxBitrateWifi.setSummary(maxBitrateWifi.getEntry());
+ maxBitrateMobile.setSummary(maxBitrateMobile.getEntry());
+ maxVideoBitrateWifi.setSummary(maxVideoBitrateWifi.getEntry());
+ maxVideoBitrateMobile.setSummary(maxVideoBitrateMobile.getEntry());
+ networkTimeout.setSummary(networkTimeout.getEntry());
+ cacheLocation.setSummary(cacheLocation.getText());
+ preloadCountWifi.setSummary(preloadCountWifi.getEntry());
+ preloadCountMobile.setSummary(preloadCountMobile.getEntry());
+
+ try {
+ if(megabyteFromat == null) {
+ megabyteFromat = new DecimalFormat(getResources().getString(R.string.util_bytes_format_megabyte));
+ }
+
+ cacheSize.setSummary(megabyteFromat.format((double) Integer.parseInt(cacheSize.getText())).replace(".00", ""));
+ } catch(Exception e) {
+ Log.e(TAG, "Failed to format cache size", e);
+ cacheSize.setSummary(cacheSize.getText());
}
- } else {
- if(syncInterval.isEnabled()) {
- syncInterval.setEnabled(false);
- syncWifi.setEnabled(false);
- syncNotification.setEnabled(false);
- syncStarred.setEnabled(false);
- syncMostRecent.setEnabled(false);
+ }
+
+ if(keepPlayedCount != null) {
+ keepPlayedCount.setSummary(keepPlayedCount.getEntry());
+ tempLoss.setSummary(tempLoss.getEntry());
+ pauseDisconnect.setSummary(pauseDisconnect.getEntry());
+ videoPlayer.setSummary(videoPlayer.getEntry());
+
+ if(replayGain.isChecked()) {
+ replayGainType.setEnabled(true);
+ replayGainBump.setEnabled(true);
+ replayGainUntagged.setEnabled(true);
+ } else {
+ replayGainType.setEnabled(false);
+ replayGainBump.setEnabled(false);
+ replayGainUntagged.setEnabled(false);
}
+ replayGainType.setSummary(replayGainType.getEntry());
}
- if(replayGain.isChecked()) {
- replayGainType.setEnabled(true);
- replayGainBump.setEnabled(true);
- replayGainUntagged.setEnabled(true);
- } else {
- replayGainType.setEnabled(false);
- replayGainBump.setEnabled(false);
- replayGainUntagged.setEnabled(false);
+
+ if(syncEnabled != null) {
+ syncInterval.setSummary(syncInterval.getEntry());
+
+ if(syncEnabled.isChecked()) {
+ if(!syncInterval.isEnabled()) {
+ syncInterval.setEnabled(true);
+ syncWifi.setEnabled(true);
+ syncNotification.setEnabled(true);
+ syncStarred.setEnabled(true);
+ syncMostRecent.setEnabled(true);
+ }
+ } else {
+ if(syncInterval.isEnabled()) {
+ syncInterval.setEnabled(false);
+ syncWifi.setEnabled(false);
+ syncNotification.setEnabled(false);
+ syncStarred.setEnabled(false);
+ syncMostRecent.setEnabled(false);
+ }
+ }
}
- replayGainType.setSummary(replayGainType.getEntry());
- for (ServerSettings ss : serverSettings.values()) {
- ss.update();
+ if(serversCategory != null) {
+ for (ServerSettings ss : serverSettings.values()) {
+ ss.update();
+ }
}
}
diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml
index 084811a1..ac247c8f 100644
--- a/app/src/main/res/xml/settings.xml
+++ b/app/src/main/res/xml/settings.xml
@@ -1,499 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
-
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:myns="http://schemas.android.com/apk/res/github.daneren2005.dsub"
android:title="@string/settings.title">
<PreferenceScreen
- android:title="@string/settings.servers_title">
-
- <PreferenceCategory
- android:key="server"
- android:title="@string/settings.servers_title">
-
- <Preference
- android:key="serverAdd"
- android:order="1000000"
- android:title="@string/settings.servers_add"/>
- </PreferenceCategory>
-
+ android:title="@string/settings.servers_title"
+ android:key="servers">
</PreferenceScreen>
<PreferenceScreen
- android:title="@string/settings.appearance_title">
-
- <PreferenceCategory
- android:title="@string/settings.appearance_title">
-
- <ListPreference
- android:title="@string/settings.theme_title"
- android:key="theme"
- android:defaultValue="light"
- android:entryValues="@array/themeValues"
- android:entries="@array/themeNames"/>
-
- <CheckBoxPreference
- android:title="@string/settings.theme_fullscreen"
- android:summary="@string/settings.theme_fullscreen_summary"
- android:key="fullScreen"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/settings.color_action_bar"
- android:summary="@string/settings.color_action_bar.summary"
- android:key="colorActionBar"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.track_title"
- android:summary="@string/settings.track_summary"
- android:key="displayTrack"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.hide_widget_title"
- android:summary="@string/settings.hide_widget_summary"
- android:key="hideWidget"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/settings.custom_sort"
- android:summary="@string/settings.custom_sort_summary"
- android:key="customSortEnabled"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.rename_duplicates"
- android:summary="@string/settings.rename_duplicates_summary"
- android:key="renameDuplicates"
- android:defaultValue="true"/>
-
- <ListPreference
- android:title="@string/settings.open_to_tab"
- android:summary="@string/settings.open_to_tab_summary"
- android:key="openToTab"
- android:entryValues="@array/defaultDrawerItemsDescriptions"
- android:entries="@array/defaultDrawerItems"
- android:defaultValue="Home"/>
-
- <CheckBoxPreference
- android:title="@string/settings.disable_exit_prompt"
- android:summary="@string/settings.disable_exit_prompt_summary"
- android:key="disableExitPrompt"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/settings.override_system_language"
- android:summary="@string/settings.override_system_language_summary"
- android:key="overrideSystemLanguage"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/settings.large_album_art"
- android:summary="@string/settings.large_album_art_summary"
- android:key="largeAlbumArt"
- android:defaultValue="true"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/settings.menu_options.title">
-
- <CheckBoxPreference
- android:title="@string/common.play_now"
- android:summary="@string/settings.menu_options.play_now_summary"
- android:key="showPlayNow"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/common.play_shuffled"
- android:summary="@string/settings.menu_options.play_shuffled_summary"
- android:key="showPlayShuffled"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/common.play_next"
- android:summary="@string/settings.menu_options.play_next_summary"
- android:key="showPlayNext"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/common.play_last"
- android:summary="@string/settings.menu_options.play_last_summary"
- android:key="showPlayLast"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/common.download"
- android:summary="@string/settings.menu_options.download_summary"
- android:key="showDownload"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/common.pin"
- android:summary="@string/settings.menu_options.pin_summary"
- android:key="showPin"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/common.delete"
- android:summary="@string/settings.menu_options.delete_summary"
- android:key="showDelete"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/common.star"
- android:summary="@string/settings.menu_options.star_summary"
- android:key="showStar"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/menu.share"
- android:summary="@string/settings.menu_options.shared_summary"
- android:key="showShared"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/menu.rate"
- android:summary="@string/settings.menu_options.rate_summary"
- android:key="showRating"
- android:defaultValue="true"/>
- </PreferenceCategory>
+ android:title="@string/settings.appearance_title"
+ android:key="appearance">
</PreferenceScreen>
<PreferenceScreen
- android:title="@string/settings.drawer_items_title">
-
- <PreferenceCategory
- android:title="@string/settings.drawer_items_title">
-
- <CheckBoxPreference
- android:title="@string/settings.podcasts_enabled"
- android:summary="@string/settings.podcasts_enabled_summary"
- android:key="podcastsEnabled"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.bookmarks_enabled"
- android:summary="@string/settings.bookmarks_enabled_summary"
- android:key="bookmarksEnabled"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.shares_enabled"
- android:summary="@string/settings.shares_enabled_summary"
- android:key="sharedEnabled"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.chat_enabled"
- android:summary="@string/settings.chat_enabled_summary"
- android:key="chatEnabled"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.admin_enabled"
- android:summary="@string/settings.admin_enabled_summary"
- android:key="adminEnabled"
- android:defaultValue="true"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/button_bar.chat">
-
- <github.daneren2005.dsub.view.SeekBarPreference
- android:title="@string/settings.chat_refresh"
- android:key="chatRefreshRate"
- android:defaultValue="30"
- android:dialogLayout="@layout/seekbar_preference"
- myns:max="120"
- myns:display="%.0f seconds"/>
- </PreferenceCategory>
+ android:title="@string/settings.drawer_items_title"
+ android:key="drawer">
</PreferenceScreen>
<PreferenceScreen
- android:title="@string/settings.cache_screen_title">
-
- <PreferenceCategory
- android:title="@string/settings.network_title">
-
- <ListPreference
- android:title="@string/settings.max_bitrate_wifi"
- android:key="maxBitrateWifi"
- android:defaultValue="0"
- android:entryValues="@array/maxBitrateValues"
- android:entries="@array/maxBitrateNames"/>
-
- <ListPreference
- android:title="@string/settings.max_bitrate_mobile"
- android:key="maxBitrateMobile"
- android:defaultValue="0"
- android:entryValues="@array/maxBitrateValues"
- android:entries="@array/maxBitrateNames"/>
-
- <ListPreference
- android:title="@string/settings.max_video_bitrate_wifi"
- android:key="maxVideoBitrateWifi"
- android:defaultValue="0"
- android:entryValues="@array/maxVideoBitrateValues"
- android:entries="@array/maxVideoBitrateNames"/>
-
- <ListPreference
- android:title="@string/settings.max_video_bitrate_mobile"
- android:key="maxVideoBitrateMobile"
- android:defaultValue="0"
- android:entryValues="@array/maxVideoBitrateValues"
- android:entries="@array/maxVideoBitrateNames"/>
-
- <CheckBoxPreference
- android:title="@string/settings.wifi_required_title"
- android:summary="@string/settings.wifi_required_summary"
- android:key="wifiRequiredForDownload"
- android:defaultValue="false"/>
-
- <ListPreference
- android:title="@string/settings.network_timeout_title"
- android:key="networkTimeout"
- android:defaultValue="15000"
- android:entryValues="@array/networkTimeoutValues"
- android:entries="@array/networkTimeoutNames"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/settings.cache_title">
-
- <EditTextPreference
- android:title="@string/settings.cache_size"
- android:key="cacheSize"
- android:defaultValue="2000"
- android:digits="0123456789"/>
-
- <EditTextPreference
- android:title="@string/settings.cache_location"
- android:key="cacheLocation"/>
-
- <ListPreference
- android:title="@string/settings.preload_wifi"
- android:key="preloadCountWifi"
- android:defaultValue="3"
- android:entryValues="@array/preloadCountValues"
- android:entries="@array/preloadCountNames"/>
-
- <ListPreference
- android:title="@string/settings.preload_mobile"
- android:key="preloadCountMobile"
- android:defaultValue="3"
- android:entryValues="@array/preloadCountValues"
- android:entries="@array/preloadCountNames"/>
-
- <Preference
- android:key="clearCache"
- android:title="@string/settings.cache_clear"
- android:persistent="false"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/settings.other_title">
-
- <CheckBoxPreference
- android:title="@string/settings.hide_media_title"
- android:summary="@string/settings.hide_media_summary"
- android:key="hideMedia"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/settings.screen_lit_title"
- android:summary="@string/settings.screen_lit_summary"
- android:key="screenLitOnDownload"
- android:defaultValue="true"/>
- </PreferenceCategory>
+ android:title="@string/settings.cache_screen_title"
+ android:key="cache">
</PreferenceScreen>
<PreferenceScreen
- android:title="@string/settings.sync_title">
- <PreferenceCategory
- android:title="@string/settings.sync_title">
-
- <CheckBoxPreference
- android:title="@string/settings.sync_enabled"
- android:summary="@string/settings.sync_enabled_summary"
- android:key="syncEnabled"
- android:defaultValue="true"/>
-
- <ListPreference
- android:title="@string/settings.sync_interval"
- android:key="syncInterval"
- android:defaultValue="60"
- android:entryValues="@array/syncIntervalValues"
- android:entries="@array/syncIntervalNames"/>
-
- <CheckBoxPreference
- android:title="@string/settings.sync_wifi"
- android:summary="@string/settings.sync_wifi_summary"
- android:key="syncWifi"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.sync_notification"
- android:summary="@string/settings.sync_notification_summary"
- android:key="syncNotification"
- android:defaultValue="true"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/settings.other_title">
-
- <CheckBoxPreference
- android:title="@string/settings.sync_starred"
- android:summary="@string/settings.sync_starred_summary"
- android:key="syncStarred"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/settings.sync_most_recent"
- android:summary="@string/settings.sync_most_recent_summary"
- android:key="syncMostRecent"
- android:defaultValue="false"/>
- </PreferenceCategory>
+ android:title="@string/settings.sync_title"
+ android:key="sync">
</PreferenceScreen>
<PreferenceScreen
- android:title="@string/settings.playback_title">
-
- <PreferenceCategory
- android:title="@string/settings.playback_title">
-
- <github.daneren2005.dsub.view.SeekBarPreference
- android:title="@string/settings.playlist_random_size_title"
- android:key="randomSize"
- android:defaultValue="20"
- android:dialogLayout="@layout/seekbar_preference"
- myns:max="100"/>
-
- <ListPreference
- android:title="@string/settings.keep_played_count_title"
- android:key="keepPlayedCount"
- android:defaultValue="0"
- android:entryValues="@array/keepPlayedCountValues"
- android:entries="@array/keepPlayedCountNames"/>
-
- <ListPreference
- android:title="@string/settings.temp_loss_title"
- android:key="tempLoss"
- android:defaultValue="1"
- android:entryValues="@array/tempLossValues"
- android:entries="@array/tempLossNames"/>
-
- <ListPreference
- android:title="@string/settings.disconnect_pause_title"
- android:key="pauseOnDisconnect"
- android:defaultValue="0"
- android:entryValues="@array/disconnectPauseValues"
- android:entries="@array/disconnectPauseNames"/>
-
- <CheckBoxPreference
- android:title="@string/settings.persistent_title"
- android:summary="@string/settings.persistent_summary"
- android:key="persistentNotification"
- android:defaultValue="false"/>
-
- <CheckBoxPreference
- android:title="@string/settings.play_now_after"
- android:summary="@string/settings.play_now_after_summary"
- android:key="playNowAfter"
- android:defaultValue="true"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/settings.video_title">
-
- <ListPreference
- android:title="@string/settings.video_player"
- android:key="videoPlayer"
- android:defaultValue="hls"
- android:entryValues="@array/videoPlayerValues"
- android:entries="@array/videoPlayerNames"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/settings.casting">
-
- <CheckBoxPreference
- android:title="@string/settings.casting_proxy"
- android:summary="@string/settings.casting_proxy_summary"
- android:key="castProxy"
- android:defaultValue="false"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/settings.replay_gain">
-
- <CheckBoxPreference
- android:title="@string/settings.replay_gain"
- android:summary="@string/settings.replay_gain_summary"
- android:key="replayGain"
- android:defaultValue="false"/>
-
- <ListPreference
- android:title="@string/settings.replay_gain_type"
- android:key="replayGainType"
- android:defaultValue="1"
- android:entryValues="@array/replayGainTypeValues"
- android:entries="@array/replayGainTypeNames"/>
-
- <github.daneren2005.dsub.view.SeekBarPreference
- android:key="replayGainBump2"
- android:dialogLayout="@layout/seekbar_preference"
- android:title="@string/settings.replay_gain_bump"
- android:defaultValue="150"
- myns:max="150"
- myns:min="-150"
- myns:stepSize="10"
- myns:display="%+.1f dB"/>
-
- <github.daneren2005.dsub.view.SeekBarPreference
- android:key="replayGainUntagged2"
- android:dialogLayout="@layout/seekbar_preference"
- android:title="@string/settings.replay_gain_untagged"
- android:defaultValue="150"
- myns:max="0"
- myns:min="-150"
- myns:stepSize="10"
- myns:display="%+.1f dB"/>
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/settings.other_title">
-
- <CheckBoxPreference
- android:title="@string/settings.shuffle_by_album"
- android:key="shuffleByAlbum"
- android:defaultValue="true"
- android:summaryOn="@string/settings.shuffle_by_album.true"
- android:summaryOff="@string/settings.shuffle_by_album.false"/>
-
- <CheckBoxPreference
- android:title="@string/settings.scrobble_title"
- android:summary="@string/settings.scrobble_summary"
- android:key="scrobble"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.media_button_title"
- android:summary="@string/settings.media_button_summary"
- android:key="mediaButtons"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.gapless_playback"
- android:summary="@string/settings.gapless_playback_summary"
- android:key="gaplessPlayback"
- android:defaultValue="true"/>
-
- <CheckBoxPreference
- android:title="@string/settings.start_on_headphones"
- android:summary="@string/settings.start_on_headphones_summary"
- android:key="startOnHeadphones"
- android:defaultValue="false"/>
- </PreferenceCategory>
+ android:title="@string/settings.playback_title"
+ android:key="playback">
</PreferenceScreen>
</PreferenceScreen>
diff --git a/app/src/main/res/xml/settings_appearance.xml b/app/src/main/res/xml/settings_appearance.xml
new file mode 100644
index 00000000..5e355526
--- /dev/null
+++ b/app/src/main/res/xml/settings_appearance.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:myns="http://schemas.android.com/apk/res/github.daneren2005.dsub"
+ android:title="@string/settings.appearance_title">
+
+ <PreferenceCategory
+ android:title="@string/settings.theme_title">
+
+ <ListPreference
+ android:title="@string/settings.theme_title"
+ android:key="theme"
+ android:defaultValue="light"
+ android:entryValues="@array/themeValues"
+ android:entries="@array/themeNames"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.theme_fullscreen"
+ android:summary="@string/settings.theme_fullscreen_summary"
+ android:key="fullScreen"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.color_action_bar"
+ android:summary="@string/settings.color_action_bar.summary"
+ android:key="colorActionBar"
+ android:defaultValue="true"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.appearance_title">
+
+ <CheckBoxPreference
+ android:title="@string/settings.track_title"
+ android:summary="@string/settings.track_summary"
+ android:key="displayTrack"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.hide_widget_title"
+ android:summary="@string/settings.hide_widget_summary"
+ android:key="hideWidget"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.custom_sort"
+ android:summary="@string/settings.custom_sort_summary"
+ android:key="customSortEnabled"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.rename_duplicates"
+ android:summary="@string/settings.rename_duplicates_summary"
+ android:key="renameDuplicates"
+ android:defaultValue="true"/>
+
+ <ListPreference
+ android:title="@string/settings.open_to_tab"
+ android:summary="@string/settings.open_to_tab_summary"
+ android:key="openToTab"
+ android:entryValues="@array/defaultDrawerItemsDescriptions"
+ android:entries="@array/defaultDrawerItems"
+ android:defaultValue="Home"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.disable_exit_prompt"
+ android:summary="@string/settings.disable_exit_prompt_summary"
+ android:key="disableExitPrompt"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.override_system_language"
+ android:summary="@string/settings.override_system_language_summary"
+ android:key="overrideSystemLanguage"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.large_album_art"
+ android:summary="@string/settings.large_album_art_summary"
+ android:key="largeAlbumArt"
+ android:defaultValue="true"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.menu_options.title">
+
+ <CheckBoxPreference
+ android:title="@string/common.play_now"
+ android:summary="@string/settings.menu_options.play_now_summary"
+ android:key="showPlayNow"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/common.play_shuffled"
+ android:summary="@string/settings.menu_options.play_shuffled_summary"
+ android:key="showPlayShuffled"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/common.play_next"
+ android:summary="@string/settings.menu_options.play_next_summary"
+ android:key="showPlayNext"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/common.play_last"
+ android:summary="@string/settings.menu_options.play_last_summary"
+ android:key="showPlayLast"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/common.download"
+ android:summary="@string/settings.menu_options.download_summary"
+ android:key="showDownload"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/common.pin"
+ android:summary="@string/settings.menu_options.pin_summary"
+ android:key="showPin"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/common.delete"
+ android:summary="@string/settings.menu_options.delete_summary"
+ android:key="showDelete"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/common.star"
+ android:summary="@string/settings.menu_options.star_summary"
+ android:key="showStar"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/menu.share"
+ android:summary="@string/settings.menu_options.shared_summary"
+ android:key="showShared"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/menu.rate"
+ android:summary="@string/settings.menu_options.rate_summary"
+ android:key="showRating"
+ android:defaultValue="true"/>
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/settings_cache.xml b/app/src/main/res/xml/settings_cache.xml
new file mode 100644
index 00000000..bb5710b2
--- /dev/null
+++ b/app/src/main/res/xml/settings_cache.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:myns="http://schemas.android.com/apk/res/github.daneren2005.dsub"
+ android:title="@string/settings.cache_screen_title">
+
+ <PreferenceCategory
+ android:title="@string/settings.network_title">
+
+ <ListPreference
+ android:title="@string/settings.max_bitrate_wifi"
+ android:key="maxBitrateWifi"
+ android:defaultValue="0"
+ android:entryValues="@array/maxBitrateValues"
+ android:entries="@array/maxBitrateNames"/>
+
+ <ListPreference
+ android:title="@string/settings.max_bitrate_mobile"
+ android:key="maxBitrateMobile"
+ android:defaultValue="0"
+ android:entryValues="@array/maxBitrateValues"
+ android:entries="@array/maxBitrateNames"/>
+
+ <ListPreference
+ android:title="@string/settings.max_video_bitrate_wifi"
+ android:key="maxVideoBitrateWifi"
+ android:defaultValue="0"
+ android:entryValues="@array/maxVideoBitrateValues"
+ android:entries="@array/maxVideoBitrateNames"/>
+
+ <ListPreference
+ android:title="@string/settings.max_video_bitrate_mobile"
+ android:key="maxVideoBitrateMobile"
+ android:defaultValue="0"
+ android:entryValues="@array/maxVideoBitrateValues"
+ android:entries="@array/maxVideoBitrateNames"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.wifi_required_title"
+ android:summary="@string/settings.wifi_required_summary"
+ android:key="wifiRequiredForDownload"
+ android:defaultValue="false"/>
+
+ <ListPreference
+ android:title="@string/settings.network_timeout_title"
+ android:key="networkTimeout"
+ android:defaultValue="15000"
+ android:entryValues="@array/networkTimeoutValues"
+ android:entries="@array/networkTimeoutNames"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.cache_title">
+
+ <EditTextPreference
+ android:title="@string/settings.cache_size"
+ android:key="cacheSize"
+ android:defaultValue="2000"
+ android:digits="0123456789"/>
+
+ <EditTextPreference
+ android:title="@string/settings.cache_location"
+ android:key="cacheLocation"/>
+
+ <ListPreference
+ android:title="@string/settings.preload_wifi"
+ android:key="preloadCountWifi"
+ android:defaultValue="3"
+ android:entryValues="@array/preloadCountValues"
+ android:entries="@array/preloadCountNames"/>
+
+ <ListPreference
+ android:title="@string/settings.preload_mobile"
+ android:key="preloadCountMobile"
+ android:defaultValue="3"
+ android:entryValues="@array/preloadCountValues"
+ android:entries="@array/preloadCountNames"/>
+
+ <Preference
+ android:key="clearCache"
+ android:title="@string/settings.cache_clear"
+ android:persistent="false"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.other_title">
+
+ <CheckBoxPreference
+ android:title="@string/settings.hide_media_title"
+ android:summary="@string/settings.hide_media_summary"
+ android:key="hideMedia"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.screen_lit_title"
+ android:summary="@string/settings.screen_lit_summary"
+ android:key="screenLitOnDownload"
+ android:defaultValue="true"/>
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/settings_drawer.xml b/app/src/main/res/xml/settings_drawer.xml
new file mode 100644
index 00000000..a874881a
--- /dev/null
+++ b/app/src/main/res/xml/settings_drawer.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:myns="http://schemas.android.com/apk/res/github.daneren2005.dsub"
+ android:title="@string/settings.drawer_items_title">
+
+ <PreferenceCategory
+ android:title="@string/settings.drawer_items_title">
+
+ <CheckBoxPreference
+ android:title="@string/settings.podcasts_enabled"
+ android:summary="@string/settings.podcasts_enabled_summary"
+ android:key="podcastsEnabled"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.bookmarks_enabled"
+ android:summary="@string/settings.bookmarks_enabled_summary"
+ android:key="bookmarksEnabled"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.shares_enabled"
+ android:summary="@string/settings.shares_enabled_summary"
+ android:key="sharedEnabled"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.chat_enabled"
+ android:summary="@string/settings.chat_enabled_summary"
+ android:key="chatEnabled"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.admin_enabled"
+ android:summary="@string/settings.admin_enabled_summary"
+ android:key="adminEnabled"
+ android:defaultValue="true"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/button_bar.chat">
+
+ <github.daneren2005.dsub.view.SeekBarPreference
+ android:title="@string/settings.chat_refresh"
+ android:key="chatRefreshRate"
+ android:defaultValue="30"
+ android:dialogLayout="@layout/seekbar_preference"
+ myns:max="120"
+ myns:display="%.0f seconds"/>
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/settings_playback.xml b/app/src/main/res/xml/settings_playback.xml
new file mode 100644
index 00000000..3c505b6e
--- /dev/null
+++ b/app/src/main/res/xml/settings_playback.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:myns="http://schemas.android.com/apk/res/github.daneren2005.dsub"
+ android:title="@string/settings.playback_title">
+
+ <PreferenceCategory
+ android:title="@string/settings.playback_title">
+
+ <github.daneren2005.dsub.view.SeekBarPreference
+ android:title="@string/settings.playlist_random_size_title"
+ android:key="randomSize"
+ android:defaultValue="20"
+ android:dialogLayout="@layout/seekbar_preference"
+ myns:max="100"/>
+
+ <ListPreference
+ android:title="@string/settings.keep_played_count_title"
+ android:key="keepPlayedCount"
+ android:defaultValue="0"
+ android:entryValues="@array/keepPlayedCountValues"
+ android:entries="@array/keepPlayedCountNames"/>
+
+ <ListPreference
+ android:title="@string/settings.temp_loss_title"
+ android:key="tempLoss"
+ android:defaultValue="1"
+ android:entryValues="@array/tempLossValues"
+ android:entries="@array/tempLossNames"/>
+
+ <ListPreference
+ android:title="@string/settings.disconnect_pause_title"
+ android:key="pauseOnDisconnect"
+ android:defaultValue="0"
+ android:entryValues="@array/disconnectPauseValues"
+ android:entries="@array/disconnectPauseNames"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.persistent_title"
+ android:summary="@string/settings.persistent_summary"
+ android:key="persistentNotification"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.play_now_after"
+ android:summary="@string/settings.play_now_after_summary"
+ android:key="playNowAfter"
+ android:defaultValue="true"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.video_title">
+
+ <ListPreference
+ android:title="@string/settings.video_player"
+ android:key="videoPlayer"
+ android:defaultValue="hls"
+ android:entryValues="@array/videoPlayerValues"
+ android:entries="@array/videoPlayerNames"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.casting">
+
+ <CheckBoxPreference
+ android:title="@string/settings.casting_proxy"
+ android:summary="@string/settings.casting_proxy_summary"
+ android:key="castProxy"
+ android:defaultValue="false"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.replay_gain">
+
+ <CheckBoxPreference
+ android:title="@string/settings.replay_gain"
+ android:summary="@string/settings.replay_gain_summary"
+ android:key="replayGain"
+ android:defaultValue="false"/>
+
+ <ListPreference
+ android:title="@string/settings.replay_gain_type"
+ android:key="replayGainType"
+ android:defaultValue="1"
+ android:entryValues="@array/replayGainTypeValues"
+ android:entries="@array/replayGainTypeNames"/>
+
+ <github.daneren2005.dsub.view.SeekBarPreference
+ android:key="replayGainBump2"
+ android:dialogLayout="@layout/seekbar_preference"
+ android:title="@string/settings.replay_gain_bump"
+ android:defaultValue="150"
+ myns:max="150"
+ myns:min="-150"
+ myns:stepSize="10"
+ myns:display="%+.1f dB"/>
+
+ <github.daneren2005.dsub.view.SeekBarPreference
+ android:key="replayGainUntagged2"
+ android:dialogLayout="@layout/seekbar_preference"
+ android:title="@string/settings.replay_gain_untagged"
+ android:defaultValue="150"
+ myns:max="0"
+ myns:min="-150"
+ myns:stepSize="10"
+ myns:display="%+.1f dB"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.other_title">
+
+ <CheckBoxPreference
+ android:title="@string/settings.shuffle_by_album"
+ android:key="shuffleByAlbum"
+ android:defaultValue="true"
+ android:summaryOn="@string/settings.shuffle_by_album.true"
+ android:summaryOff="@string/settings.shuffle_by_album.false"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.scrobble_title"
+ android:summary="@string/settings.scrobble_summary"
+ android:key="scrobble"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.media_button_title"
+ android:summary="@string/settings.media_button_summary"
+ android:key="mediaButtons"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.gapless_playback"
+ android:summary="@string/settings.gapless_playback_summary"
+ android:key="gaplessPlayback"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.start_on_headphones"
+ android:summary="@string/settings.start_on_headphones_summary"
+ android:key="startOnHeadphones"
+ android:defaultValue="false"/>
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/settings_servers.xml b/app/src/main/res/xml/settings_servers.xml
new file mode 100644
index 00000000..a81cab1e
--- /dev/null
+++ b/app/src/main/res/xml/settings_servers.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ android:title="@string/settings.servers_title">
+
+ <PreferenceCategory
+ android:key="server"
+ android:title="@string/settings.servers_title">
+
+ <Preference
+ android:key="serverAdd"
+ android:order="1000000"
+ android:title="@string/settings.servers_add"/>
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/settings_sync.xml b/app/src/main/res/xml/settings_sync.xml
new file mode 100644
index 00000000..1fad10de
--- /dev/null
+++ b/app/src/main/res/xml/settings_sync.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:myns="http://schemas.android.com/apk/res/github.daneren2005.dsub"
+ android:title="@string/settings.sync_title">
+
+ <PreferenceCategory
+ android:title="@string/settings.sync_title">
+
+ <CheckBoxPreference
+ android:title="@string/settings.sync_enabled"
+ android:summary="@string/settings.sync_enabled_summary"
+ android:key="syncEnabled"
+ android:defaultValue="true"/>
+
+ <ListPreference
+ android:title="@string/settings.sync_interval"
+ android:key="syncInterval"
+ android:defaultValue="60"
+ android:entryValues="@array/syncIntervalValues"
+ android:entries="@array/syncIntervalNames"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.sync_wifi"
+ android:summary="@string/settings.sync_wifi_summary"
+ android:key="syncWifi"
+ android:defaultValue="true"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.sync_notification"
+ android:summary="@string/settings.sync_notification_summary"
+ android:key="syncNotification"
+ android:defaultValue="true"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:title="@string/settings.other_title">
+
+ <CheckBoxPreference
+ android:title="@string/settings.sync_starred"
+ android:summary="@string/settings.sync_starred_summary"
+ android:key="syncStarred"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
+ android:title="@string/settings.sync_most_recent"
+ android:summary="@string/settings.sync_most_recent_summary"
+ android:key="syncMostRecent"
+ android:defaultValue="false"/>
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file