diff options
30 files changed, 558 insertions, 582 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 5e0b77e3..25734167 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="github.daneren2005.dsub"
android:installLocation="internalOnly"
- android:versionCode="130"
- android:versionName="4.8.2">
+ android:versionCode="133"
+ android:versionName="4.8.5">
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="github.daneren2005.dsub"
diff --git a/project.properties b/project.properties index 819e411a..cfa8bb97 100644 --- a/project.properties +++ b/project.properties @@ -8,7 +8,7 @@ # project structure. # Project target. -target=android-19 +target=android-21 android.library.reference.1=DragSortListView/library android.library.reference.2=../../../../Program Files (x86)/Android/android-sdk/extras/android/support/v7/appcompat android.library.reference.3=../../../../Program Files (x86)/Android/android-sdk/extras/android/support/v7/mediarouter diff --git a/res/drawable-hdpi/btn_check_buttonless_off.png b/res/drawable-hdpi/btn_check_buttonless_off.png Binary files differdeleted file mode 100644 index d705b420..00000000 --- a/res/drawable-hdpi/btn_check_buttonless_off.png +++ /dev/null diff --git a/res/drawable-hdpi/btn_check_buttonless_on.png b/res/drawable-hdpi/btn_check_buttonless_on.png Binary files differdeleted file mode 100644 index a2612d7d..00000000 --- a/res/drawable-hdpi/btn_check_buttonless_on.png +++ /dev/null diff --git a/res/drawable-hdpi/ic_drawer.png b/res/drawable-hdpi/ic_drawer.png Binary files differdeleted file mode 100644 index eb90af58..00000000 --- a/res/drawable-hdpi/ic_drawer.png +++ /dev/null diff --git a/res/drawable-mdpi/ic_drawer.png b/res/drawable-mdpi/ic_drawer.png Binary files differdeleted file mode 100644 index 1681d12c..00000000 --- a/res/drawable-mdpi/ic_drawer.png +++ /dev/null diff --git a/res/drawable-xhdpi/ic_drawer.png b/res/drawable-xhdpi/ic_drawer.png Binary files differdeleted file mode 100644 index daba1451..00000000 --- a/res/drawable-xhdpi/ic_drawer.png +++ /dev/null diff --git a/res/drawable-xxhdpi/ic_drawer.png b/res/drawable-xxhdpi/ic_drawer.png Binary files differdeleted file mode 100644 index 9c4685d6..00000000 --- a/res/drawable-xxhdpi/ic_drawer.png +++ /dev/null diff --git a/res/drawable/btn_check.xml b/res/drawable/btn_check.xml deleted file mode 100644 index f363a2d2..00000000 --- a/res/drawable/btn_check.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2008 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - - <item android:state_checked="true" - android:drawable="@drawable/btn_check_buttonless_on" /> - - <item android:state_checked="false" - android:drawable="@drawable/btn_check_buttonless_off" /> - - <item - android:drawable="@drawable/btn_check_buttonless_off" /> - -</selector> diff --git a/res/layout/song_list_item.xml b/res/layout/song_list_item.xml index d433df69..1ea118ad 100644 --- a/res/layout/song_list_item.xml +++ b/res/layout/song_list_item.xml @@ -10,7 +10,7 @@ android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center_vertical"
- android:checkMark="@drawable/btn_check"
+ android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:paddingLeft="3dip"/>
<LinearLayout android:orientation="vertical"
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index e49d6197..777ef4fd 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -192,8 +192,6 @@ <string name="download.jukebox_server_too_old">Control remoto no soportado. Por favor, actualice su servidor Subsonic.</string> <string name="download.jukebox_offline">Control remoto no disponible en modo offline.</string> <string name="download.jukebox_not_authorized">Control remoto no permitido. Por favor, active el modo jukebox en <b>Users > Settings</b> en su servidor Subsonic.</string> - <string name="download.show_downloading">Mostrar descargas</string> - <string name="download.show_now_playing">Mostrar reproduciendo ahora</string> <string name="download.timer_length">Temporizador</string> <string name="download.start_timer">Iniciar temporizador</string> <string name="download.stop_timer">Detener temporizador</string> diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index 6e0ff106..4b82ac85 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -560,6 +560,11 @@ <string name="tasker.start_playing_shuffled">Lejátszás indítása kevert sorrendben</string>
<string name="tasker.start_playing_title">Tasker -> DSub indítása</string>
<string name="tasker.edit_shuffle_mode">Indítás kevert sorrendben: </string>
+ <string name="tasker.edit_shuffle_start_year">Kevert sorrend kezdő év:</string>
+ <string name="tasker.edit_shuffle_end_year">Kevert sorrend utolsó év:</string>
+ <string name="tasker.edit_shuffle_genre">Kevert sorrend műfaja:</string>
+ <string name="tasker.edit_server_offline">Offline kapcsoló: </string>
+ <string name="tasker.edit_do_nothing">Ne csináljon semmit</string>
<plurals name="select_album_n_songs">
<item quantity="zero">Nincsenek dalok</item>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 5a009228..03f10808 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -129,8 +129,6 @@ <string name="download.jukebox_server_too_old">Удаленное управление не поддерживается. Пожалуйста, обновите Ваш сервер Subsonic.</string>
<string name="download.jukebox_offline">Удаленное управление не поддерживается в оффлайн режиме.</string>
<string name="download.jukebox_not_authorized">Удаленное управление запрещено. Пожалуйста, активируйте режим jukebox в разделе <b>Настройки > Проигрыватели</b> на вашем сервере Subsonic.</string>
- <string name="download.show_downloading">Показать закачки</string>
- <string name="download.show_now_playing">Показать воспроизведение</string>
<string name="download.timer_length">Длительность</string>
<string name="download.start_timer">Запустить таймер</string>
<string name="download.stop_timer">Остановить таймер</string>
diff --git a/res/values/themes.xml b/res/values/themes.xml index 129c0612..70f30e56 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -31,11 +31,12 @@ <item name="drawerItemsIcons">@array/drawerItemIconsLight</item> <item name="android:textViewStyle">@style/DSub.TextViewStyle</item> <item name="android:buttonStyle">@style/DSub.ButtonStyle.Light</item> + <item name="drawerArrowStyle">@style/DSub.DrawerArrow</item> + <item name="colorAccent">@color/cyan</item> </style> <style name="Theme.DSub.Dark" parent="@style/Theme.AppCompat"> <item name="actionBarStyle">@style/Widget.DSub.ActionBarStyle.Dark</item> <item name="android:actionBarStyle">@style/Widget.DSub.ActionBarStyle.Dark</item> - <item name="android:textColorSecondary">@color/cyan</item> <item name="offline_icon">@drawable/main_offline_dark</item> <item name="media_button_backward">@drawable/media_backward_dark</item> <item name="media_button_forward">@drawable/media_forward_dark</item> @@ -64,42 +65,14 @@ <item name="drawerItemsIcons">@array/drawerItemIconsDark</item> <item name="android:textViewStyle">@style/DSub.TextViewStyle</item> <item name="android:buttonStyle">@style/DSub.ButtonStyle.Dark</item> + <item name="drawerArrowStyle">@style/DSub.DrawerArrow</item> + <item name="colorAccent">@color/cyan</item> </style> <style name="Theme.DSub.Black" parent="Theme.DSub.Dark"> <item name="android:windowBackground">@android:color/black</item> </style> - <style name="Theme.DSub.Holo" parent="@style/Theme.AppCompat"> - <item name="actionBarStyle">@style/Widget.DSub.ActionBarStyle.Holo</item> - <item name="android:actionBarStyle">@style/Widget.DSub.ActionBarStyle.Holo</item> + <style name="Theme.DSub.Holo" parent="Theme.DSub.Dark"> <item name="android:windowBackground">@drawable/background</item> - <item name="offline_icon">@drawable/main_offline_dark</item> - <item name="media_button_backward">@drawable/media_backward_dark</item> - <item name="media_button_forward">@drawable/media_forward_dark</item> - <item name="media_button_pause">@drawable/media_pause_dark</item> - <item name="media_button_repeat_off">@drawable/media_repeat_off</item> - <item name="media_button_start">@drawable/media_start_dark</item> - <item name="media_button_stop">@drawable/media_stop_dark</item> - <item name="chat_send">@drawable/ic_menu_chat_send_dark</item> - <item name="add">@drawable/ic_action_add_dark</item> - <item name="download_none">@drawable/download_none_dark</item> - <item name="shuffle">@drawable/ic_menu_shuffle_dark</item> - <item name="refresh">@drawable/ic_menu_refresh_dark</item> - <item name="search">@drawable/ic_menu_search_dark</item> - <item name="remove">@drawable/ic_menu_remove_dark</item> - <item name="save">@drawable/ic_menu_save_dark</item> - <item name="volume">@drawable/ic_action_volume_dark</item> - <item name="toggle_list">@drawable/action_toggle_list_dark</item> - <item name="select_server">@drawable/main_select_server_dark</item> - <item name="downloading">@drawable/downloading_dark</item> - <item name="bookmark">@drawable/ic_menu_bookmark_dark</item> - <item name="share">@drawable/ic_menu_share_dark</item> - <item name="add_person">@drawable/ic_menu_add_person_dark</item> - <item name="password">@drawable/ic_menu_password_dark</item> - <item name="rating_bad">@drawable/ic_action_rating_bad_dark</item> - <item name="rating_good">@drawable/ic_action_rating_good_dark</item> - <item name="drawerItemsIcons">@array/drawerItemIconsDark</item> - <item name="android:textViewStyle">@style/DSub.TextViewStyle</item> - <item name="android:buttonStyle">@style/DSub.ButtonStyle.Dark</item> </style> <style name="Widget.DSub.ActionBarStyle.Light" parent="Widget.AppCompat.Light.ActionBar.Solid"> @@ -108,20 +81,13 @@ <item name="backgroundStacked">@android:color/transparent</item> <item name="android:backgroundStacked">@android:color/transparent</item> </style> - + <style name="Widget.DSub.ActionBarStyle.Dark" parent="Widget.AppCompat.ActionBar.Solid"> <item name="background">@android:color/transparent</item> <item name="android:background">@android:color/transparent</item> <item name="backgroundStacked">@android:color/transparent</item> <item name="android:backgroundStacked">@android:color/transparent</item> </style> - - <style name="Widget.DSub.ActionBarStyle.Holo" parent="Widget.AppCompat.ActionBar.Solid"> - <item name="background">@android:color/transparent</item> - <item name="android:background">@android:color/transparent</item> - <item name="backgroundStacked">@android:color/transparent</item> - <item name="android:backgroundStacked">@android:color/transparent</item> - </style> <style name="DSub.TextViewStyle" parent="android:Widget.TextView"> </style> @@ -134,4 +100,8 @@ </style> <style name="DSub.ButtonStyle.Light" parent="android:Widget.Holo.Light.Button"> </style> + + <style name="DSub.DrawerArrow" parent="Widget.AppCompat.DrawerArrowToggle"> + <item name="spinBars">true</item> + </style> </resources> diff --git a/res/xml/changelog.xml b/res/xml/changelog.xml index 9c3e5040..17316fbc 100644 --- a/res/xml/changelog.xml +++ b/res/xml/changelog.xml @@ -1,5 +1,20 @@ <?xml version="1.0" encoding="utf-8"?> <changelog> + <release version="4.8.5" versioncode="133" releasedate="11/26/2014"> + <change>Fix crash on GB</change> + <change>Fix some theme issues</change> + </release> + <release version="4.8.4" versioncode="132" releasedate="11/22/2014"> + <change>Partial Material Theme update</change> + <change>Make playing notification public for Lolipop</change> + <change>Fix Lolipop connectivity issues for some users</change> + <change>Fix cache from playlist view downloading starred songs instead</change> + <change>Fix remove from playlist not showing up on MusicCabinet servers</change> + </release> + <release version="4.8.3" versioncode="131" releasedate="11/14/2014"> + <change>Fix color on Lolipop lockscreen notification</change> + <change>Various bug fixes</change> + </release> <release version="4.8.2" versioncode="130" releasedate="11/2/2014"> <change>Improve automatic bookmark logic</change> <change>Tasker: Toggle online/offline</change> diff --git a/res/xml/settings.xml b/res/xml/settings.xml index d0dcdc43..10ea66fe 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -4,419 +4,423 @@ 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:title="@string/menu.settings"> - <PreferenceCategory - android:key="server" + <PreferenceScreen android:title="@string/settings.servers_title"> - <Preference - android:key="serverAdd" - android:order="1000000" - android:title="@string/settings.servers_add"/> - </PreferenceCategory> - - </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.track_title" - android:summary="@string/settings.track_summary" - android:key="displayTrack" - android:defaultValue="false"/> - - <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.open_to_library" - android:summary="@string/settings.open_to_library_summary" - android:key="openToLibrary" - 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_next" - android:summary="@string/settings.menu_options.play_next_summary" - android:key="showPlayNext" - android:defaultValue="true"/> - - <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.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> - - <PreferenceScreen - android:title="@string/settings.drawer_items_title"> - - <PreferenceCategory + <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> + + <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.track_title" + android:summary="@string/settings.track_summary" + android:key="displayTrack" + android:defaultValue="false"/> + + <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.open_to_library" + android:summary="@string/settings.open_to_library_summary" + android:key="openToLibrary" + 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_next" + android:summary="@string/settings.menu_options.play_next_summary" + android:key="showPlayNext" + android:defaultValue="true"/> + + <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.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> + + <PreferenceScreen 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> - - <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"> - - <github.daneren2005.dsub.view.SeekBarPreference - android:title="@string/settings.cache_size" - android:key="cacheSize" - android:defaultValue="2000" - android:dialogLayout="@layout/seekbar_preference" - myns:max="20000" - myns:display="%.0f MB"/> - - <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> - - <PreferenceScreen - android:title="@string/settings.sync_title"> - <PreferenceCategory - android:title="@string/settings.sync_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> - <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> - - <PreferenceScreen - android:title="@string/settings.playback_title"> - - <PreferenceCategory - android:title="@string/settings.playback_title"> + <PreferenceCategory + android:title="@string/button_bar.chat"> <github.daneren2005.dsub.view.SeekBarPreference - android:title="@string/settings.playlist_random_size_title" - android:key="randomSize" - android:defaultValue="20" + android:title="@string/settings.chat_refresh" + android:key="chatRefreshRate" + android:defaultValue="30" android:dialogLayout="@layout/seekbar_preference" - myns:max="100"/> + myns:max="120" + myns:display="%.0f seconds"/> + </PreferenceCategory> + </PreferenceScreen> + + <PreferenceScreen + android:title="@string/settings.cache_screen_title"> + + <PreferenceCategory + android:title="@string/settings.network_title"> <ListPreference - android:title="@string/settings.temp_loss_title" - android:key="tempLoss" - android:defaultValue="1" - android:entryValues="@array/tempLossValues" - android:entries="@array/tempLossNames"/> + 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.disconnect_pause_title" - android:key="pauseOnDisconnect" + android:title="@string/settings.max_video_bitrate_wifi" + android:key="maxVideoBitrateWifi" android:defaultValue="0" - android:entryValues="@array/disconnectPauseValues" - android:entries="@array/disconnectPauseNames"/> + 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"> + + <github.daneren2005.dsub.view.SeekBarPreference + android:title="@string/settings.cache_size" + android:key="cacheSize" + android:defaultValue="2000" + android:dialogLayout="@layout/seekbar_preference" + myns:max="20000" + myns:display="%.0f MB"/> + + <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> + + <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.persistent_title" - android:summary="@string/settings.persistent_summary" - android:key="persistentNotification" + android:title="@string/settings.sync_most_recent" + android:summary="@string/settings.sync_most_recent_summary" + android:key="syncMostRecent" android:defaultValue="false"/> + </PreferenceCategory> + </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.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="false"/> + </PreferenceCategory> + + <PreferenceCategory + android:title="@string/settings.video_title"> + + <ListPreference + android:title="@string/settings.video_player" + android:key="videoPlayer" + android:defaultValue="raw" + android:entryValues="@array/videoPlayerValues" + android:entries="@array/videoPlayerNames"/> + </PreferenceCategory> + + <PreferenceCategory + android:title="@string/settings.replay_gain"> <CheckBoxPreference - android:title="@string/settings.play_now_after" - android:summary="@string/settings.play_now_after_summary" - android:key="playNowAfter" + android:title="@string/settings.replay_gain" + android:summary="@string/settings.replay_gain_summary" + android:key="replayGain" android:defaultValue="false"/> - </PreferenceCategory> - - <PreferenceCategory - android:title="@string/settings.video_title"> - - <ListPreference - android:title="@string/settings.video_player" - android:key="videoPlayer" - android:defaultValue="raw" - android:entryValues="@array/videoPlayerValues" - android:entries="@array/videoPlayerNames"/> - </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.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"/> - </PreferenceCategory> - </PreferenceScreen> + + <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.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"/> + </PreferenceCategory> + </PreferenceScreen> + </PreferenceCategory> </PreferenceScreen> diff --git a/src/github/daneren2005/dsub/activity/SettingsActivity.java b/src/github/daneren2005/dsub/activity/SettingsActivity.java index 0dd68fcb..6218dd74 100644 --- a/src/github/daneren2005/dsub/activity/SettingsActivity.java +++ b/src/github/daneren2005/dsub/activity/SettingsActivity.java @@ -227,7 +227,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer update(); - if(Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + if(Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH && getActionBar() != null) { getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); } @@ -292,11 +292,10 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer Object manager = managerConstructor.newInstance(this); Method m = managerClass.getMethod("dataChanged"); m.invoke(manager); - Log.d(TAG, "Backup requested"); } catch(ClassNotFoundException e) { - Log.d(TAG, "No backup manager found"); + Log.e(TAG, "No backup manager found"); } catch(Throwable t) { - Log.d(TAG, "Scheduling backup failed " + t); + Log.e(TAG, "Scheduling backup failed " + t); t.printStackTrace(); } } @@ -588,13 +587,13 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer previousInstance = Util.getActiveServer(SettingsActivity.this); testingConnection = true; - Util.setActiveServer(SettingsActivity.this, instance); + MusicService musicService = MusicServiceFactory.getMusicService(SettingsActivity.this); try { - MusicService musicService = MusicServiceFactory.getMusicService(SettingsActivity.this); + musicService.setInstance(instance); musicService.ping(SettingsActivity.this, this); return musicService.isLicenseValid(SettingsActivity.this, null); } finally { - Util.setActiveServer(SettingsActivity.this, previousInstance); + musicService.setInstance(null); testingConnection = false; } } diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index c3f8e4a7..a1e4d9ae 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -28,7 +28,7 @@ import android.media.AudioManager; import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
-import android.support.v4.app.ActionBarDrawerToggle;
+import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
@@ -101,8 +101,8 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte protected void onCreate(Bundle bundle) {
setUncaughtExceptionHandler();
applyTheme();
- super.onCreate(bundle);
applyFullscreen();
+ super.onCreate(bundle);
startService(new Intent(this, DownloadService.class));
setVolumeControlStream(AudioManager.STREAM_MUSIC);
@@ -201,7 +201,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte });
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
- drawerToggle = new ActionBarDrawerToggle(this, drawer, R.drawable.ic_drawer, R.string.common_appname, R.string.common_appname) {
+ drawerToggle = new ActionBarDrawerToggle(this, drawer, R.string.common_appname, R.string.common_appname) {
@Override
public void onDrawerClosed(View view) {
setTitle(currentFragment.getTitle());
@@ -221,7 +221,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte drawerAdapter.setDownloadVisible(true);
}
- if(lastSelectedView == null) {
+ if(lastSelectedView == null && drawerList.getCount() > lastSelectedPosition) {
lastSelectedView = (TextView) drawerList.getChildAt(lastSelectedPosition).findViewById(R.id.drawer_name);
if(lastSelectedView != null) {
lastSelectedView.setTextAppearance(SubsonicActivity.this, R.style.DSub_TextViewStyle_Bold);
diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java index b6daea98..ce5b1281 100644 --- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -236,7 +236,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis previousButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
new SilentBackgroundTask<Void>(context) {
@Override
protected Void doInBackground() throws Throwable {
@@ -262,7 +262,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis nextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
new SilentBackgroundTask<Boolean>(context) {
@Override
protected Boolean doInBackground() throws Throwable {
@@ -328,7 +328,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
new SilentBackgroundTask<Void>(context) {
@Override
protected Void doInBackground() throws Throwable {
@@ -507,7 +507,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis playlistView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, final int position, long id) {
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
new SilentBackgroundTask<Void>(context) {
@Override
protected Void doInBackground() throws Throwable {
@@ -543,7 +543,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis DownloadService downloadService = getDownloadService();
if (downloadService != null && context.getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, false)) {
context.getIntent().removeExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE);
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
downloadService.setShufflePlayEnabled(true);
}
@@ -1077,7 +1077,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis if (state == PAUSED || state == COMPLETED || state == STOPPED) {
service.start();
} else if (state == STOPPED || state == IDLE) {
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
int current = service.getCurrentPlayingIndex();
// TODO: Use play() method.
if (current == -1) {
@@ -1495,7 +1495,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis if(action > 0) {
final int performAction = action;
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
new SilentBackgroundTask<Void>(context) {
@Override
protected Void doInBackground() throws Throwable {
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index a8b4ab38..a71924cf 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -863,7 +863,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter }
final List<Entry> songs = getSelectedSongs();
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
// Conditions for using play now button
if(!append && !save && autoplay && !playNext && !shuffle) {
@@ -905,6 +905,10 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter checkLicenseAndTrialPeriod(onValid);
}
private void downloadBackground(final boolean save) {
+ if(playlistId != null) {
+ selectAll(true, false);
+ }
+
List<Entry> songs = getSelectedSongs();
if(songs.isEmpty()) {
// Get both songs and albums
@@ -918,7 +922,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter return;
}
- warnIfNetworkOrStorageUnavailable();
+ warnIfStorageUnavailable();
LoadingTask<Void> onValid = new LoadingTask<Void>(context) {
@Override
protected Void doInBackground() throws Throwable {
diff --git a/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java b/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java index caf9079f..8c16edd5 100644 --- a/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java @@ -156,7 +156,7 @@ public class SelectPlaylistFragment extends SelectListFragment<Playlist> { Bundle args = new Bundle();
args.putString(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID, playlist.getId());
args.putString(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME, playlist.getName());
- if(ServerInfo.checkServerVersion(context, "1.8") && playlist.getOwner() != null && playlist.getOwner().equals(UserUtil.getCurrentUsername(context))) {
+ if(ServerInfo.checkServerVersion(context, "1.8") && (playlist.getOwner() != null && playlist.getOwner().equals(UserUtil.getCurrentUsername(context)) || playlist.getId().indexOf(".m3u") != -1)) {
args.putBoolean(Constants.INTENT_EXTRA_NAME_PLAYLIST_OWNER, true);
}
fragment.setArguments(args);
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 5cab2497..1856cc6a 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -617,11 +617,9 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR R.color.holo_red_light);
}
- protected void warnIfNetworkOrStorageUnavailable() {
+ protected void warnIfStorageUnavailable() {
if (!Util.isExternalStoragePresent()) {
Util.toast(context, R.string.select_album_no_sdcard);
- } else if (!Util.isOffline(context) && !Util.isNetworkConnected(context)) {
- Util.toast(context, R.string.select_album_no_network);
}
}
@@ -889,7 +887,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR return false;
}
- if (!append) {
+ if (!append && !background) {
downloadService.clear();
}
if(!background) {
@@ -934,13 +932,13 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR @Override
protected void done(Boolean result) {
+ warnIfStorageUnavailable();
+
if(playNowOverride) {
playNow(songs);
return;
}
- warnIfNetworkOrStorageUnavailable();
-
if(result) {
Util.startActivityWithoutTransition(context, DownloadActivity.class);
}
diff --git a/src/github/daneren2005/dsub/provider/DSubSearchProvider.java b/src/github/daneren2005/dsub/provider/DSubSearchProvider.java index 01f08565..30490f17 100644 --- a/src/github/daneren2005/dsub/provider/DSubSearchProvider.java +++ b/src/github/daneren2005/dsub/provider/DSubSearchProvider.java @@ -147,7 +147,13 @@ public class DSubSearchProvider extends ContentProvider { cursor.addRow(new Object[]{entry.getId().hashCode(), entry.getTitle(), entry.getArtist(), entry.getId(), entry.getTitle(), icon}); } else { String icon = RESOURCE_PREFIX + R.drawable.ic_action_song; - cursor.addRow(new Object[]{entry.getId().hashCode(), entry.getTitle(), entry.getArtist(), "so-" + entry.getParent(), entry.getTitle(), icon}); + String id; + if(Util.isTagBrowsing(getContext())) { + id = entry.getAlbumId(); + } else { + id = entry.getParent(); + } + cursor.addRow(new Object[]{entry.getId().hashCode(), entry.getTitle(), entry.getArtist(), "so-" + id, entry.getTitle(), icon}); } } } diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 4cbf2317..8b45fba4 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -309,6 +309,8 @@ public class DownloadService extends Service { public synchronized void download(List<MusicDirectory.Entry> songs, boolean save, boolean autoplay, boolean playNext, boolean shuffle, int start, int position) { setShufflePlayEnabled(false); int offset = 1; + boolean noNetwork = !Util.isOffline(this) && !Util.isNetworkConnected(this); + boolean warnNetwork = false; if (songs.isEmpty()) { return; @@ -321,6 +323,11 @@ public class DownloadService extends Service { if(song != null) { DownloadFile downloadFile = new DownloadFile(this, song, save); addToDownloadList(downloadFile, getCurrentPlayingIndex() + offset); + if(noNetwork && !warnNetwork) { + if(!downloadFile.isCompleteFileAvailable()) { + warnNetwork = true; + } + } offset++; } } @@ -332,6 +339,11 @@ public class DownloadService extends Service { for (MusicDirectory.Entry song : songs) { DownloadFile downloadFile = new DownloadFile(this, song, save); addToDownloadList(downloadFile, -1); + if(noNetwork && !warnNetwork) { + if(!downloadFile.isCompleteFileAvailable()) { + warnNetwork = true; + } + } } if(!autoplay && (size - 1) == index) { setNextPlaying(); @@ -343,6 +355,9 @@ public class DownloadService extends Service { if(shuffle) { shuffle(); } + if(warnNetwork) { + Util.toast(this, R.string.select_album_no_network); + } if (autoplay) { play(start, true, position); @@ -378,6 +393,10 @@ public class DownloadService extends Service { } revision++; + if(!Util.isOffline(this) && !Util.isNetworkConnected(this)) { + Util.toast(this, R.string.select_album_no_network); + } + checkDownloads(); lifecycleSupport.serializeDownloadQueue(); } @@ -560,6 +579,9 @@ public class DownloadService extends Service { } else { mediaRouter.removeOnlineProviders(); } + if(shufflePlay) { + setShufflePlayEnabled(false); + } lifecycleSupport.post(new Runnable() { @Override @@ -1166,7 +1188,16 @@ public class DownloadService extends Service { while(isRunning) { try { if(mediaPlayer != null && playerState == STARTED) { - cachedPosition = mediaPlayer.getCurrentPosition(); + int newPosition = mediaPlayer.getCurrentPosition(); + + // If sudden jump in position, something is wrong + if(subtractNextPosition == 0 && newPosition > (cachedPosition + 5000)) { + // Only 1 second should have gone by, subtract the rest + subtractPosition += (newPosition - cachedPosition) - 1000; + } + + cachedPosition = newPosition; + if(subtractNextPosition > 0) { // Subtraction amount is current position - how long ago onCompletionListener was called subtractPosition = cachedPosition - (int) (System.currentTimeMillis() - subtractNextPosition); @@ -1205,7 +1236,7 @@ public class DownloadService extends Service { public void setSuggestedPlaylistName(String name, String id) { this.suggestedPlaylistName = name; this.suggestedPlaylistId = id; - + SharedPreferences.Editor editor = Util.getPreferences(this).edit(); editor.putString(Constants.PREFERENCES_KEY_PLAYLIST_NAME, name); editor.putString(Constants.PREFERENCES_KEY_PLAYLIST_ID, id); @@ -1255,7 +1286,7 @@ public class DownloadService extends Service { // Don't try again, just resetup media player and continue on controller = null; } - + // Restart from same position and state we left off in play(getCurrentPlayingIndex(), false, pos); } @@ -1484,7 +1515,7 @@ public class DownloadService extends Service { if (start || autoPlayStart) { mediaPlayer.start(); setPlayerState(STARTED); - + // Disable autoPlayStart after done autoPlayStart = false; } else { diff --git a/src/github/daneren2005/dsub/service/OfflineMusicService.java b/src/github/daneren2005/dsub/service/OfflineMusicService.java index c26a2fc4..887ad84f 100644 --- a/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -320,6 +320,10 @@ public class OfflineMusicService implements MusicService { for(File songFile : FileUtil.listMediaFiles(albumFile)) { String songName = getName(songFile); + if(songName == null) { + continue; + } + if(songFile.isDirectory()) { recursiveAlbumSearch(artistName, songFile, criteria, context, albums, songs); } diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java index db1504f0..c7ca2708 100644 --- a/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -598,7 +598,7 @@ public class RESTMusicService implements MusicService { @Override public String getCoverArtUrl(Context context, MusicDirectory.Entry entry) throws Exception { StringBuilder builder = new StringBuilder(getRestUrl(context, "getCoverArt")); - builder.append("&id=").append(entry.getId()); + builder.append("&id=").append(entry.getCoverArt()); return builder.toString(); } diff --git a/src/github/daneren2005/dsub/service/ssl/SSLSocketFactory.java b/src/github/daneren2005/dsub/service/ssl/SSLSocketFactory.java index 2f11730a..3b1203c7 100644 --- a/src/github/daneren2005/dsub/service/ssl/SSLSocketFactory.java +++ b/src/github/daneren2005/dsub/service/ssl/SSLSocketFactory.java @@ -49,6 +49,7 @@ import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; import java.io.IOException; +import java.lang.reflect.Array; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; @@ -58,8 +59,13 @@ import java.security.KeyManagementException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; +import java.security.Provider; import java.security.SecureRandom; +import java.security.Security; import java.security.UnrecoverableKeyException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** * Layered socket factory for TLS/SSL connections. @@ -144,8 +150,6 @@ import java.security.UnrecoverableKeyException; public class SSLSocketFactory implements LayeredSocketFactory { private static final String TAG = SSLSocketFactory.class.getSimpleName(); public static final String TLS = "TLS"; - public static final String SSL = "SSL"; - public static final String SSLV2 = "SSLv2"; public static final X509HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER = new AllowAllHostnameVerifier(); @@ -343,16 +347,18 @@ public class SSLSocketFactory implements LayeredSocketFactory { @SuppressWarnings("cast") public Socket createSocket(final HttpParams params) throws IOException { // the cast makes sure that the factory is working as expected - SSLSocket sslsocket = (SSLSocket) this.socketfactory.createSocket(); - sslsocket.setEnabledProtocols(sslsocket.getSupportedProtocols()); - return sslsocket; + SSLSocket sslSocket = (SSLSocket) this.socketfactory.createSocket(); + sslSocket.setEnabledProtocols(getProtocols(sslSocket)); + sslSocket.setEnabledCipherSuites(getCiphers(sslSocket)); + return sslSocket; } @SuppressWarnings("cast") public Socket createSocket() throws IOException { // the cast makes sure that the factory is working as expected SSLSocket sslSocket = (SSLSocket) this.socketfactory.createSocket(); - sslSocket.setEnabledProtocols(sslSocket.getSupportedProtocols()); + sslSocket.setEnabledProtocols(getProtocols(sslSocket)); + sslSocket.setEnabledCipherSuites(getCiphers(sslSocket)); return sslSocket; } @@ -444,7 +450,8 @@ public class SSLSocketFactory implements LayeredSocketFactory { port, autoClose ); - sslSocket.setEnabledProtocols(sslSocket.getSupportedProtocols()); + sslSocket.setEnabledProtocols(getProtocols(sslSocket)); + sslSocket.setEnabledCipherSuites(getCiphers(sslSocket)); if (this.hostnameVerifier != null) { this.hostnameVerifier.verify(host, sslSocket); } @@ -500,7 +507,8 @@ public class SSLSocketFactory implements LayeredSocketFactory { final String host, int port, boolean autoClose) throws IOException, UnknownHostException { SSLSocket sslSocket = (SSLSocket) this.socketfactory.createSocket(socket, host, port, autoClose); - sslSocket.setEnabledProtocols(sslSocket.getSupportedProtocols()); + sslSocket.setEnabledProtocols(getProtocols(sslSocket)); + sslSocket.setEnabledCipherSuites(getCiphers(sslSocket)); setHostName(sslSocket, host); return sslSocket; } @@ -513,4 +521,29 @@ public class SSLSocketFactory implements LayeredSocketFactory { Log.w(TAG, "SNI not useable", e); } } + + private String[] getProtocols(SSLSocket sslSocket) { + String[] protocols = sslSocket.getEnabledProtocols(); + + // Remove SSLv3 if it is not the only option + if(protocols.length > 1) { + List<String> protocolList = new ArrayList(Arrays.asList(protocols)); + protocolList.remove("SSLv3"); + protocols = protocolList.toArray(new String[protocolList.size()]); + } + + return protocols; + } + + private String[] getCiphers(SSLSocket sslSocket) { + String[] ciphers = sslSocket.getEnabledCipherSuites(); + + List<String> enabledCiphers = new ArrayList(Arrays.asList(ciphers)); + // On Android 5.0 release, Jetty doesn't seem to play nice with these ciphers + enabledCiphers.remove("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); + enabledCiphers.remove("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"); + + ciphers = enabledCiphers.toArray(new String[enabledCiphers.size()]); + return ciphers; + } } diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java index 54888b59..7afeec93 100644 --- a/src/github/daneren2005/dsub/util/FileUtil.java +++ b/src/github/daneren2005/dsub/util/FileUtil.java @@ -438,12 +438,17 @@ public class FileUtil { } public static void unpinSong(Context context, File saveFile) { + // Don't try to unpin a song which isn't actually pinned + if(saveFile.getName().contains(".complete")) { + return; + } + // Unpin file, rename to .complete File completeFile = new File(saveFile.getParent(), FileUtil.getBaseName(saveFile.getName()) + ".complete." + FileUtil.getExtension(saveFile.getName())); if(!saveFile.renameTo(completeFile)) { - Log.w(TAG, "Failed to rename " + saveFile + " to " + completeFile); + Log.w(TAG, "Failed to upin " + saveFile + " to " + completeFile); } else { try { new MediaStoreService(context).renameInMediaStore(completeFile, saveFile); diff --git a/src/github/daneren2005/dsub/util/Notifications.java b/src/github/daneren2005/dsub/util/Notifications.java index 520c4a6c..3eace1dd 100644 --- a/src/github/daneren2005/dsub/util/Notifications.java +++ b/src/github/daneren2005/dsub/util/Notifications.java @@ -69,6 +69,9 @@ public final class Notifications { notification.bigContentView = expandedContentView;
notification.priority = Notification.PRIORITY_HIGH;
}
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ notification.visibility = Notification.VISIBILITY_PUBLIC;
+ }
RemoteViews smallContentView = new RemoteViews(context.getPackageName(), R.layout.notification);
setupViews(smallContentView, context, song, false, playing, remote);
@@ -133,14 +136,6 @@ public final class Notifications { rv.setTextViewText(R.id.notification_artist, arist);
rv.setTextViewText(R.id.notification_album, album);
- Pair<Integer, Integer> colors = getNotificationTextColors(context);
- if (colors.getFirst() != null) {
- rv.setTextColor(R.id.notification_title, colors.getFirst());
- }
- if (colors.getSecond() != null) {
- rv.setTextColor(R.id.notification_artist, colors.getSecond());
- }
-
boolean persistent = Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_PERSISTENT_NOTIFICATION, false);
if(persistent) {
if(expanded) {
@@ -341,44 +336,4 @@ public final class Notifications { notificationManager.notify(stringId, builder.build());
}
}
-
- /**
- * Resolves the default text color for notifications.
- *
- * Based on http://stackoverflow.com/questions/4867338/custom-notification-layouts-and-text-colors/7320604#7320604
- */
- private static Pair<Integer, Integer> getNotificationTextColors(Context context) {
- if (NOTIFICATION_TEXT_COLORS.getFirst() == null && NOTIFICATION_TEXT_COLORS.getSecond() == null) {
- try {
- Notification notification = new Notification();
- String title = "title";
- String content = "content";
- notification.setLatestEventInfo(context, title, content, null);
- LinearLayout group = new LinearLayout(context);
- ViewGroup event = (ViewGroup) notification.contentView.apply(context, group);
- findNotificationTextColors(event, title, content);
- group.removeAllViews();
- } catch (Exception x) {
- Log.w(TAG, "Failed to resolve notification text colors.", x);
- }
- }
- return NOTIFICATION_TEXT_COLORS;
- }
-
- private static void findNotificationTextColors(ViewGroup group, String title, String content) {
- for (int i = 0; i < group.getChildCount(); i++) {
- if (group.getChildAt(i) instanceof TextView) {
- TextView textView = (TextView) group.getChildAt(i);
- String text = textView.getText().toString();
- if (title.equals(text)) {
- NOTIFICATION_TEXT_COLORS.setFirst(textView.getTextColors().getDefaultColor());
- }
- else if (content.equals(text)) {
- NOTIFICATION_TEXT_COLORS.setSecond(textView.getTextColors().getDefaultColor());
- }
- }
- else if (group.getChildAt(i) instanceof ViewGroup)
- findNotificationTextColors((ViewGroup) group.getChildAt(i), title, content);
- }
- }
}
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java index 0b3f03b3..e9724ded 100644 --- a/src/github/daneren2005/dsub/util/Util.java +++ b/src/github/daneren2005/dsub/util/Util.java @@ -20,9 +20,6 @@ package github.daneren2005.dsub.util; import android.annotation.TargetApi; import android.app.Activity; import android.app.AlertDialog; -import android.app.Notification; -import android.app.NotificationManager; -import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; @@ -42,33 +39,19 @@ import android.net.NetworkInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Environment; -import android.os.Handler; -import android.support.v4.app.NotificationCompat; import android.text.Html; import android.text.SpannableString; import android.text.method.LinkMovementMethod; import android.text.util.Linkify; import android.util.Log; import android.view.Gravity; -import android.view.View; -import android.view.ViewGroup; -import android.view.KeyEvent; -import android.widget.LinearLayout; -import android.widget.RemoteViews; import android.widget.TextView; import android.widget.Toast; import github.daneren2005.dsub.R; -import github.daneren2005.dsub.activity.SubsonicActivity; -import github.daneren2005.dsub.activity.SubsonicFragmentActivity; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.domain.PlayerState; import github.daneren2005.dsub.domain.RepeatMode; -import github.daneren2005.dsub.domain.ServerInfo; -import github.daneren2005.dsub.domain.User; -import github.daneren2005.dsub.domain.Version; -import github.daneren2005.dsub.provider.DSubWidgetProvider; import github.daneren2005.dsub.receiver.MediaButtonIntentReceiver; -import github.daneren2005.dsub.service.DownloadFile; import github.daneren2005.dsub.service.DownloadService; import github.daneren2005.dsub.service.MediaStoreService; @@ -77,8 +60,6 @@ import org.apache.http.HttpEntity; import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -90,8 +71,6 @@ import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Arrays; import java.util.Locale; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; /** * @author Sindre Mehus |