From 50f996b85834970689ff667f1c53c038d0c089de Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 4 Oct 2013 22:38:48 -0700 Subject: #90 Make disconnect pause optional --- res/xml/settings.xml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'res/xml') diff --git a/res/xml/settings.xml b/res/xml/settings.xml index eb139b83..e7917344 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -110,6 +110,13 @@ android:entryValues="@array/tempLossValues" android:entries="@array/tempLossNames"/> + + Date: Wed, 9 Oct 2013 22:07:01 -0700 Subject: Closes #125 Break preferences into groups --- res/values/strings.xml | 4 +- res/xml/settings.xml | 408 +++++++++++---------- .../dsub/activity/SettingsActivity.java | 11 +- 3 files changed, 221 insertions(+), 202 deletions(-) (limited to 'res/xml') diff --git a/res/values/strings.xml b/res/values/strings.xml index 13035da4..5702271a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -290,7 +290,7 @@ Search history cleared Other settings Scrobble to Last.fm - Remember to set up your Last.fm user and password on the DSub server + Remember to set up your Last.fm user and password on the Subsonic server Hide from other Hide music files from other apps. Takes effect next time Android scans your phone for music. @@ -329,6 +329,8 @@ HTTP Live Stream (HLS) (Requires Subsonic 4.8+) Direct Transcode (Requires video -> mp4 or similar setup on Server) Flash (Requires Plugin) + Cache/Network + Playback Shuffle By Start Year: diff --git a/res/xml/settings.xml b/res/xml/settings.xml index e7917344..bbfbf620 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -1,216 +1,234 @@ + android:title="@string/settings.title"> - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:title="@string/settings.servers_title"> + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + android:title="@string/settings.max_bitrate_wifi" + android:key="maxBitrateWifi" + android:defaultValue="0" + android:entryValues="@array/maxBitrateValues" + android:entries="@array/maxBitrateNames"/> + android:entryValues="@array/maxBitrateValues" + android:entries="@array/maxBitrateNames"/> + + + + - - - - - + + + + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/github/daneren2005/dsub/activity/SettingsActivity.java b/src/github/daneren2005/dsub/activity/SettingsActivity.java index 06a99ce6..12ee7694 100644 --- a/src/github/daneren2005/dsub/activity/SettingsActivity.java +++ b/src/github/daneren2005/dsub/activity/SettingsActivity.java @@ -98,8 +98,8 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer tempLoss = (ListPreference) findPreference(Constants.PREFERENCES_KEY_TEMP_LOSS); pauseDisconnect = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PAUSE_DISCONNECT); bufferLength = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_BUFFER_LENGTH); - addServerPreference = (Preference) findPreference(Constants.PREFERENCES_KEY_SERVER_ADD); serversCategory = (PreferenceCategory) findPreference(Constants.PREFERENCES_KEY_SERVER_KEY); + addServerPreference = (Preference) findPreference(Constants.PREFERENCES_KEY_SERVER_ADD); chatRefreshRate = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CHAT_REFRESH); videoPlayer = (ListPreference) findPreference(Constants.PREFERENCES_KEY_VIDEO_PLAYER); @@ -143,7 +143,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer return false; } }); - + addServerPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { @@ -151,9 +151,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer String instance = String.valueOf(serverCount); Preference addServerPreference = findPreference(Constants.PREFERENCES_KEY_SERVER_ADD); - serversCategory.removePreference(addServerPreference); serversCategory.addPreference(addServer(serverCount)); - serversCategory.addPreference(addServerPreference); SharedPreferences.Editor editor = settings.edit(); editor.putInt(Constants.PREFERENCES_KEY_SERVER_COUNT, serverCount); @@ -165,13 +163,12 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer } }); - serversCategory.removePreference(addServerPreference); + 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.addPreference(addServerPreference); SharedPreferences prefs = Util.getPreferences(this); prefs.registerOnSharedPreferenceChangeListener(this); @@ -359,6 +356,8 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer screen.addPreference(serverTestConnectionPreference); screen.addPreference(serverOpenBrowser); + screen.setOrder(instance); + return screen; } -- cgit v1.2.3 From e1cf77e0ee66701dc979f4c3f5e38ce0508f5645 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 11 Oct 2013 19:10:47 -0700 Subject: Closes #130 Add option to hide widget while inactive --- res/layout/appwidget4x1.xml | 3 ++- res/layout/appwidget4x2.xml | 3 ++- res/layout/appwidget4x3.xml | 3 ++- res/layout/appwidget4x4.xml | 3 ++- res/values/strings.xml | 2 ++ res/xml/settings.xml | 6 +++++ .../dsub/provider/DSubWidgetProvider.java | 27 +++++++++++----------- 7 files changed, 29 insertions(+), 18 deletions(-) (limited to 'res/xml') diff --git a/res/layout/appwidget4x1.xml b/res/layout/appwidget4x1.xml index 5e55aa37..68fecb9a 100644 --- a/res/layout/appwidget4x1.xml +++ b/res/layout/appwidget4x1.xml @@ -5,7 +5,8 @@ android:minWidth="250dp" android:minHeight="40dp" android:background="@drawable/appwidget_bg" - android:orientation="horizontal" > + android:orientation="horizontal" + android:id="@+id/widget_root"> + android:orientation="horizontal" + android:id="@+id/widget_root"> + android:orientation="vertical" + android:id="@+id/widget_root"> + android:background="@drawable/appwidget_bg" + android:id="@+id/widget_root"> Flash (Requires Plugin) Cache/Network Playback + Hide Widget + Hide widget after exiting app Shuffle By Start Year: diff --git a/res/xml/settings.xml b/res/xml/settings.xml index bbfbf620..8f6759c0 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -37,6 +37,12 @@ android:key="displayTrack" android:defaultValue="false"/> + + + + + + + diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 68f398bc..135a76a2 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -71,7 +71,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte private String[] drawerItemsDescriptions; private String[] drawerItems; private boolean drawerIdle = true; - private boolean[] enabledItems = {true, true}; + private boolean[] enabledItems = {true, true, true}; private boolean destroyed = false; private boolean finished = false; protected List backStack = new ArrayList(); @@ -152,23 +152,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte drawerList.setOnItemClickListener(new ListView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - if("Home".equals(drawerItemsDescriptions[position])) { - startFragmentActivity(""); - } else if("Library".equals(drawerItemsDescriptions[position])) { - startFragmentActivity("Artist"); - } else if("Playlists".equals(drawerItemsDescriptions[position])) { - startFragmentActivity("Playlist"); - } else if("Podcasts".equals(drawerItemsDescriptions[position])) { - startFragmentActivity("Podcast"); - } else if("Chat".equals(drawerItemsDescriptions[position])) { - startFragmentActivity("Chat"); - } else if("Now Playing".equals(drawerItemsDescriptions[position])) { - startActivity(DownloadActivity.class); - } else if("Settings".equals(drawerItemsDescriptions[position])) { - startActivity(SettingsActivity.class); - } else if("Exit".equals(drawerItemsDescriptions[position])) { - exit(); - } + startFragmentActivity(drawerItemsDescriptions[position]); if(lastSelectedView != view) { lastSelectedView.setBackgroundResource(android.R.color.transparent); @@ -372,9 +356,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte private void populateDrawer() { SharedPreferences prefs = Util.getPreferences(this); boolean podcastsEnabled = prefs.getBoolean(Constants.PREFERENCES_KEY_PODCASTS_ENABLED, true); + boolean bookmarksEnabled = prefs.getBoolean(Constants.PREFERENCES_KEY_BOOKMARKS_ENABLED, true); boolean chatEnabled = prefs.getBoolean(Constants.PREFERENCES_KEY_CHAT_ENABLED, true); - if(drawerItems == null || !enabledItems[0] == podcastsEnabled || !enabledItems[1] == chatEnabled) { + if(drawerItems == null || !enabledItems[0] == podcastsEnabled || !enabledItems[1] == bookmarksEnabled || !enabledItems[2] == chatEnabled) { drawerItems = getResources().getStringArray(R.array.drawerItems); drawerItemsDescriptions = getResources().getStringArray(R.array.drawerItemsDescriptions); @@ -389,14 +374,21 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte drawerItemsDescriptionsList.remove(3 - alreadyRemoved); alreadyRemoved++; } - - // Selectively remove chat listing: [4] - if(!chatEnabled) { + + // Selectively remove bookmarks listing [4] + if(!bookmarksEnabled) { drawerItemsList.remove(4 - alreadyRemoved); drawerItemsDescriptionsList.remove(4 - alreadyRemoved); alreadyRemoved++; } + // Selectively remove chat listing: [5] + if(!chatEnabled) { + drawerItemsList.remove(5 - alreadyRemoved); + drawerItemsDescriptionsList.remove(5 - alreadyRemoved); + alreadyRemoved++; + } + // Put list back together if(alreadyRemoved > 0) { drawerItems = drawerItemsList.toArray(new String[0]); @@ -405,7 +397,8 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte drawerList.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, drawerItems)); enabledItems[0] = podcastsEnabled; - enabledItems[1] = chatEnabled; + enabledItems[1] = bookmarksEnabled; + enabledItems[2] = chatEnabled; } } diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index 9c006ae1..5fe7333d 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -44,6 +44,7 @@ import github.daneren2005.dsub.fragments.ChatFragment; import github.daneren2005.dsub.fragments.MainFragment; import github.daneren2005.dsub.fragments.SearchFragment; import github.daneren2005.dsub.fragments.SelectArtistFragment; +import github.daneren2005.dsub.fragments.SelectBookmarkFragment; import github.daneren2005.dsub.fragments.SelectDirectoryFragment; import github.daneren2005.dsub.fragments.SelectPlaylistFragment; import github.daneren2005.dsub.fragments.SelectPodcastsFragment; @@ -332,6 +333,8 @@ public class SubsonicFragmentActivity extends SubsonicActivity { return new ChatFragment(); } else if("Podcast".equals(fragmentType)) { return new SelectPodcastsFragment(); + } else if("Bookmark".equals(fragmentType)) { + return new SelectBookmarkFragment(); } else { return new MainFragment(); } diff --git a/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java b/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java index cf57ce58..b0969b29 100644 --- a/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java @@ -80,7 +80,7 @@ public class SelectBookmarkFragment extends SubsonicFragment implements AdapterV @Override public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) { - menuInflater.inflate(R.menu.select_genres, menu); + menuInflater.inflate(R.menu.abstract_top_menu, menu); } @Override @@ -94,7 +94,7 @@ public class SelectBookmarkFragment extends SubsonicFragment implements AdapterV @Override protected void refresh(final boolean refresh) { - setTitle(R.string.main_albums_genres); + setTitle(R.string.button_bar_bookmarks); bookmarkListView.setVisibility(View.INVISIBLE); BackgroundTask> task = new TabBackgroundTask>(this) { diff --git a/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java b/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java index 9ae229b8..79889c2c 100644 --- a/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java @@ -81,7 +81,7 @@ public class SelectPlaylistFragment extends SubsonicFragment implements AdapterV @Override public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) { - menuInflater.inflate(R.menu.select_playlist, menu); + menuInflater.inflate(R.menu.abstract_top_menu, menu); } @Override diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java index fece424b..efcaf2d3 100644 --- a/src/github/daneren2005/dsub/util/Constants.java +++ b/src/github/daneren2005/dsub/util/Constants.java @@ -121,6 +121,7 @@ public final class Constants { public static final String PREFERENCES_KEY_PAUSE_DISCONNECT = "pauseOnDisconnect"; public static final String PREFERENCES_KEY_HIDE_WIDGET = "hideWidget"; public static final String PREFERENCES_KEY_PODCASTS_ENABLED = "podcastsEnabled"; + public static final String PREFERENCES_KEY_BOOKMARKS_ENABLED = "bookmarksEnabled"; public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount"; public static final String OFFLINE_SCROBBLE_ID = "scrobbleID"; -- cgit v1.2.3