diff options
81 files changed, 652 insertions, 749 deletions
diff --git a/subsonic-android/AndroidManifest.xml b/subsonic-android/AndroidManifest.xml index 8956ef8d..1e2c4771 100644 --- a/subsonic-android/AndroidManifest.xml +++ b/subsonic-android/AndroidManifest.xml @@ -2,8 +2,8 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="github.daneren2005.dsub"
android:installLocation="auto"
- android:versionCode="10"
- android:versionName="3.3.5.1">
+ android:versionCode="11"
+ android:versionName="3.4">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
@@ -14,11 +14,11 @@ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
- <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14"/>
+ <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/>
<supports-screens android:anyDensity="true" android:xlargeScreens="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
- <application android:label="@string/common.appname" android:icon="@drawable/launch2" android:theme="@style/Wheat">
+ <application android:label="@string/common.appname" android:icon="@drawable/launch2" android:theme="@style/Theme.DSub.Light">
<activity android:name="github.daneren2005.dsub.activity.MainActivity"
android:label="DSub"
@@ -52,7 +52,7 @@ android:launchMode="singleTask"/>
<activity android:name="github.daneren2005.dsub.activity.SettingsActivity"
- android:theme="@android:style/Theme"
+ android:theme="@style/Theme.DSub.Dark"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTask"/>
diff --git a/subsonic-android/project.properties b/subsonic-android/project.properties index 8da376af..0b3adc12 100644 --- a/subsonic-android/project.properties +++ b/subsonic-android/project.properties @@ -9,3 +9,4 @@ # Project target. target=android-15 +android.library.reference.1=../../ActionBarSherlock diff --git a/subsonic-android/res/drawable-hdpi-v4/action_browse.png b/subsonic-android/res/drawable-hdpi-v4/action_browse.png Binary files differnew file mode 100644 index 00000000..54296909 --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_browse.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_compass.png b/subsonic-android/res/drawable-hdpi-v4/action_compass.png Binary files differnew file mode 100644 index 00000000..39760f89 --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_compass.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_exit.png b/subsonic-android/res/drawable-hdpi-v4/action_exit.png Binary files differnew file mode 100644 index 00000000..09e18dee --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_exit.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_moreoverflow.png b/subsonic-android/res/drawable-hdpi-v4/action_moreoverflow.png Binary files differnew file mode 100644 index 00000000..cb6ebdaf --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_moreoverflow.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_offline.png b/subsonic-android/res/drawable-hdpi-v4/action_offline.png Binary files differnew file mode 100644 index 00000000..a85f0931 --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_offline.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_remove_all.png b/subsonic-android/res/drawable-hdpi-v4/action_remove_all.png Binary files differnew file mode 100644 index 00000000..97b88837 --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_remove_all.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_save.png b/subsonic-android/res/drawable-hdpi-v4/action_save.png Binary files differnew file mode 100644 index 00000000..7bda97d6 --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_save.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_screen_on_off.png b/subsonic-android/res/drawable-hdpi-v4/action_screen_on_off.png Binary files differnew file mode 100644 index 00000000..c7168563 --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_screen_on_off.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_select.png b/subsonic-android/res/drawable-hdpi-v4/action_select.png Binary files differnew file mode 100644 index 00000000..e9e83e3d --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_select.png diff --git a/subsonic-android/res/drawable-hdpi-v4/action_share.png b/subsonic-android/res/drawable-hdpi-v4/action_share.png Binary files differnew file mode 100644 index 00000000..28376157 --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/action_share.png diff --git a/subsonic-android/res/drawable-hdpi-v4/btn_check_buttonless_off.png b/subsonic-android/res/drawable-hdpi-v4/btn_check_buttonless_off.png Binary files differnew file mode 100644 index 00000000..d705b420 --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/btn_check_buttonless_off.png diff --git a/subsonic-android/res/drawable-hdpi-v4/btn_check_buttonless_on.png b/subsonic-android/res/drawable-hdpi-v4/btn_check_buttonless_on.png Binary files differnew file mode 100644 index 00000000..a2612d7d --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/btn_check_buttonless_on.png diff --git a/subsonic-android/res/drawable-hdpi-v4/ic_menu_exit.png b/subsonic-android/res/drawable-hdpi-v4/ic_menu_exit.png Binary files differdeleted file mode 100644 index 28cad85e..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/ic_menu_exit.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/ic_menu_help.png b/subsonic-android/res/drawable-hdpi-v4/ic_menu_help.png Binary files differdeleted file mode 100644 index 7e14e95d..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/ic_menu_help.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/ic_menu_remove_all.png b/subsonic-android/res/drawable-hdpi-v4/ic_menu_remove_all.png Binary files differdeleted file mode 100644 index 112196be..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/ic_menu_remove_all.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/ic_menu_save.png b/subsonic-android/res/drawable-hdpi-v4/ic_menu_save.png Binary files differdeleted file mode 100644 index 34f6e01a..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/ic_menu_save.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/ic_menu_screen_on_off.png b/subsonic-android/res/drawable-hdpi-v4/ic_menu_screen_on_off.png Binary files differdeleted file mode 100644 index db9235fc..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/ic_menu_screen_on_off.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/ic_menu_settings.png b/subsonic-android/res/drawable-hdpi-v4/ic_menu_settings.png Binary files differdeleted file mode 100644 index 2ffcec52..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/ic_menu_settings.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/list_item_artist.9.png b/subsonic-android/res/drawable-hdpi-v4/list_item_artist.9.png Binary files differdeleted file mode 100644 index 7bddbcef..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/list_item_artist.9.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/list_item_more.9.png b/subsonic-android/res/drawable-hdpi-v4/list_item_more.9.png Binary files differnew file mode 100644 index 00000000..79ca860d --- /dev/null +++ b/subsonic-android/res/drawable-hdpi-v4/list_item_more.9.png diff --git a/subsonic-android/res/drawable-hdpi-v4/list_item_playlist.9.png b/subsonic-android/res/drawable-hdpi-v4/list_item_playlist.9.png Binary files differdeleted file mode 100644 index 7bddbcef..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/list_item_playlist.9.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/main_exit.png b/subsonic-android/res/drawable-hdpi-v4/main_exit.png Binary files differdeleted file mode 100644 index 9a8b2a5e..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/main_exit.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/main_help.png b/subsonic-android/res/drawable-hdpi-v4/main_help.png Binary files differdeleted file mode 100644 index cb063b00..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/main_help.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/main_select_server.png b/subsonic-android/res/drawable-hdpi-v4/main_select_server.png Binary files differindex ccecc1d9..c2cefead 100644 --- a/subsonic-android/res/drawable-hdpi-v4/main_select_server.png +++ b/subsonic-android/res/drawable-hdpi-v4/main_select_server.png diff --git a/subsonic-android/res/drawable-hdpi-v4/main_settings.png b/subsonic-android/res/drawable-hdpi-v4/main_settings.png Binary files differdeleted file mode 100644 index 81bca4ae..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/main_settings.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/main_shuffle.png b/subsonic-android/res/drawable-hdpi-v4/main_shuffle.png Binary files differdeleted file mode 100644 index 22ee1d50..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/main_shuffle.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/menu_browse.png b/subsonic-android/res/drawable-hdpi-v4/menu_browse.png Binary files differindex 70a59154..54296909 100644 --- a/subsonic-android/res/drawable-hdpi-v4/menu_browse.png +++ b/subsonic-android/res/drawable-hdpi-v4/menu_browse.png diff --git a/subsonic-android/res/drawable-hdpi-v4/menu_home.png b/subsonic-android/res/drawable-hdpi-v4/menu_home.png Binary files differindex 35cb52aa..3cec6246 100644 --- a/subsonic-android/res/drawable-hdpi-v4/menu_home.png +++ b/subsonic-android/res/drawable-hdpi-v4/menu_home.png diff --git a/subsonic-android/res/drawable-hdpi-v4/menu_now_playing.png b/subsonic-android/res/drawable-hdpi-v4/menu_now_playing.png Binary files differindex 10af07fe..6ce5629a 100644 --- a/subsonic-android/res/drawable-hdpi-v4/menu_now_playing.png +++ b/subsonic-android/res/drawable-hdpi-v4/menu_now_playing.png diff --git a/subsonic-android/res/drawable-hdpi-v4/menu_playlists.png b/subsonic-android/res/drawable-hdpi-v4/menu_playlists.png Binary files differindex 59345d5b..e9e83e3d 100644 --- a/subsonic-android/res/drawable-hdpi-v4/menu_playlists.png +++ b/subsonic-android/res/drawable-hdpi-v4/menu_playlists.png diff --git a/subsonic-android/res/drawable-hdpi-v4/menu_search.png b/subsonic-android/res/drawable-hdpi-v4/menu_search.png Binary files differdeleted file mode 100644 index f78234e4..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/menu_search.png +++ /dev/null diff --git a/subsonic-android/res/drawable-hdpi-v4/menubar_button_pressed.9.png b/subsonic-android/res/drawable-hdpi-v4/menubar_button_pressed.9.png Binary files differindex 4dff0907..e4b33935 100644 --- a/subsonic-android/res/drawable-hdpi-v4/menubar_button_pressed.9.png +++ b/subsonic-android/res/drawable-hdpi-v4/menubar_button_pressed.9.png diff --git a/subsonic-android/res/drawable-hdpi-v4/select_artist_folder.png b/subsonic-android/res/drawable-hdpi-v4/select_artist_folder.png Binary files differdeleted file mode 100644 index ccecc1d9..00000000 --- a/subsonic-android/res/drawable-hdpi-v4/select_artist_folder.png +++ /dev/null diff --git a/subsonic-android/res/drawable/action_help.png b/subsonic-android/res/drawable/action_help.png Binary files differdeleted file mode 100644 index aaf8304c..00000000 --- a/subsonic-android/res/drawable/action_help.png +++ /dev/null diff --git a/subsonic-android/res/drawable/action_play_all.png b/subsonic-android/res/drawable/action_play_all.png Binary files differdeleted file mode 100644 index 6ce5629a..00000000 --- a/subsonic-android/res/drawable/action_play_all.png +++ /dev/null diff --git a/subsonic-android/res/drawable/action_refresh.png b/subsonic-android/res/drawable/action_refresh.png Binary files differdeleted file mode 100644 index 9f30dc95..00000000 --- a/subsonic-android/res/drawable/action_refresh.png +++ /dev/null diff --git a/subsonic-android/res/drawable/action_search.png b/subsonic-android/res/drawable/action_search.png Binary files differdeleted file mode 100644 index 6bc3d426..00000000 --- a/subsonic-android/res/drawable/action_search.png +++ /dev/null diff --git a/subsonic-android/res/drawable/action_settings.png b/subsonic-android/res/drawable/action_settings.png Binary files differdeleted file mode 100644 index 1ab7722b..00000000 --- a/subsonic-android/res/drawable/action_settings.png +++ /dev/null diff --git a/subsonic-android/res/drawable/action_shuffle.png b/subsonic-android/res/drawable/action_shuffle.png Binary files differdeleted file mode 100644 index 0613965c..00000000 --- a/subsonic-android/res/drawable/action_shuffle.png +++ /dev/null diff --git a/subsonic-android/res/drawable/btn_check.xml b/subsonic-android/res/drawable/btn_check.xml new file mode 100644 index 00000000..f363a2d2 --- /dev/null +++ b/subsonic-android/res/drawable/btn_check.xml @@ -0,0 +1,28 @@ +<?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/subsonic-android/res/drawable/menu_browse.png b/subsonic-android/res/drawable/menu_browse.png Binary files differdeleted file mode 100644 index 3f1de60d..00000000 --- a/subsonic-android/res/drawable/menu_browse.png +++ /dev/null diff --git a/subsonic-android/res/drawable/menu_home.png b/subsonic-android/res/drawable/menu_home.png Binary files differdeleted file mode 100644 index 34943f66..00000000 --- a/subsonic-android/res/drawable/menu_home.png +++ /dev/null diff --git a/subsonic-android/res/drawable/menu_now_playing.png b/subsonic-android/res/drawable/menu_now_playing.png Binary files differdeleted file mode 100644 index 22f203a8..00000000 --- a/subsonic-android/res/drawable/menu_now_playing.png +++ /dev/null diff --git a/subsonic-android/res/drawable/menu_playlists.png b/subsonic-android/res/drawable/menu_playlists.png Binary files differdeleted file mode 100644 index c01733d9..00000000 --- a/subsonic-android/res/drawable/menu_playlists.png +++ /dev/null diff --git a/subsonic-android/res/drawable/menu_search.png b/subsonic-android/res/drawable/menu_search.png Binary files differdeleted file mode 100644 index 94446db9..00000000 --- a/subsonic-android/res/drawable/menu_search.png +++ /dev/null diff --git a/subsonic-android/res/drawable/menubar_button.xml b/subsonic-android/res/drawable/menubar_button.xml index 06c2c8e7..7a717780 100644 --- a/subsonic-android/res/drawable/menubar_button.xml +++ b/subsonic-android/res/drawable/menubar_button.xml @@ -2,7 +2,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" - android:drawable="@drawable/menubar_button_pressed"/> + android:drawable="@color/background_holo_light"/> <item android:state_enabled="true" android:drawable="@drawable/menubar_button_normal"/> diff --git a/subsonic-android/res/layout/action_bar.xml b/subsonic-android/res/layout/action_bar.xml deleted file mode 100644 index 2aaa4116..00000000 --- a/subsonic-android/res/layout/action_bar.xml +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="45dp"
- android:background="@drawable/menubar_button_disabled">
-
- <ImageView
- android:id="@+id/actionbar_home_icon"
- android:src="@drawable/main_header_icon2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentBottom="true"
- android:paddingLeft="4dip"
- android:paddingRight="4dip"
- android:paddingTop="2dip"
- android:paddingBottom="2dip"
- android:scaleType="centerInside"
- />
-
- <ImageButton
- android:id="@+id/action_button_4"
- android:src="@drawable/action_settings"
- android:layout_width="44dip"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
- android:scaleType="fitCenter"
- android:padding="5dp"
- android:background="@drawable/actionbar_button"
- />
-
- <ImageButton
- android:id="@+id/action_button_3"
- android:src="@drawable/action_help"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
- android:layout_toLeftOf="@id/action_button_4"
- android:scaleType="center"
- android:padding="5dp"
- android:background="@drawable/actionbar_button"
- />
-
- <ImageButton
- android:id="@+id/action_button_2"
- android:src="@drawable/action_search"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
- android:layout_toLeftOf="@id/action_button_3"
- android:scaleType="center"
- android:padding="5dp"
- android:background="@drawable/actionbar_button"
- />
-
- <ImageButton
- android:id="@+id/action_button_1"
- android:src="@drawable/action_shuffle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
- android:layout_toLeftOf="@id/action_button_2"
- android:scaleType="center"
- android:padding="5dp"
- android:background="@drawable/actionbar_button"
- />
-
- <TextView
- android:id="@+id/actionbar_title_text"
- android:text="Subsonic"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
- android:layout_toLeftOf="@id/action_button_1"
- android:layout_toRightOf="@id/actionbar_home_icon"
- android:gravity="center_vertical"
- android:textColor="#FFFFFF"
- android:textSize="18sp"
- android:textStyle="bold"
- android:shadowColor="#000000"
- android:shadowDx="1"
- android:shadowDy="1"
- android:shadowRadius="1"
- android:lineSpacingMultiplier="0.85"
- android:ellipsize="middle"
- android:inputType="none"
- />
-
-</RelativeLayout>
diff --git a/subsonic-android/res/layout/album_list_item.xml b/subsonic-android/res/layout/album_list_item.xml index aa2ac803..88f3cf8b 100644 --- a/subsonic-android/res/layout/album_list_item.xml +++ b/subsonic-android/res/layout/album_list_item.xml @@ -47,7 +47,7 @@ android:src="@android:drawable/star_big_off" />
<ImageView
- android:src="@drawable/list_item_artist"
+ android:src="@drawable/list_item_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
diff --git a/subsonic-android/res/layout/artist_list_item.xml b/subsonic-android/res/layout/artist_list_item.xml index 8aaa42d0..3c99ccbd 100644 --- a/subsonic-android/res/layout/artist_list_item.xml +++ b/subsonic-android/res/layout/artist_list_item.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" - android:drawableRight="@drawable/list_item_artist" + android:drawableRight="@drawable/list_item_more" android:drawablePadding="6dip" android:layout_width="fill_parent" android:layout_height="wrap_content" diff --git a/subsonic-android/res/layout/button_bar.xml b/subsonic-android/res/layout/button_bar.xml index 1d576775..52c78ba1 100644 --- a/subsonic-android/res/layout/button_bar.xml +++ b/subsonic-android/res/layout/button_bar.xml @@ -6,47 +6,42 @@ android:layout_width="fill_parent"
android:layout_height="wrap_content">
- <View
- android:layout_width="fill_parent"
- android:layout_height="1px"
- android:background="@color/dividerColor"/>
-
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
+ android:layout_height="48dp"
android:gravity="center_horizontal">
<ImageButton android:id="@+id/button_bar_home"
android:src="@drawable/menu_home"
android:contentDescription="@string/button_bar.home"
android:background="@drawable/menubar_button"
+ android:layout_height="match_parent"
android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="wrap_content"/>
+ android:layout_width="0dp"/>
<ImageButton android:id="@+id/button_bar_music"
android:src="@drawable/menu_browse"
android:contentDescription="@string/button_bar.browse"
android:background="@drawable/menubar_button"
+ android:layout_height="match_parent"
android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="wrap_content"/>
+ android:layout_width="0dp"/>
<ImageButton android:id="@+id/button_bar_playlists"
android:src="@drawable/menu_playlists"
android:contentDescription="@string/button_bar.playlists"
android:background="@drawable/menubar_button"
+ android:layout_height="match_parent"
android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="wrap_content"/>
+ android:layout_width="0dp"/>
<ImageButton android:id="@+id/button_bar_now_playing"
android:src="@drawable/menu_now_playing"
android:contentDescription="@string/button_bar.now_playing"
android:background="@drawable/menubar_button"
+ android:layout_height="match_parent"
android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="wrap_content"/>
+ android:layout_width="0dp"/>
</LinearLayout>
</LinearLayout>
diff --git a/subsonic-android/res/layout/main.xml b/subsonic-android/res/layout/main.xml index e151f319..56b013fe 100644 --- a/subsonic-android/res/layout/main.xml +++ b/subsonic-android/res/layout/main.xml @@ -4,12 +4,6 @@ android:layout_width="fill_parent"
android:layout_height="fill_parent">
- <include
- layout="@layout/action_bar"
- android:layout_width="fill_parent"
- android:layout_height="45dp"
- />
-
<View
android:layout_width="fill_parent"
android:layout_height="1px"
diff --git a/subsonic-android/res/layout/main_buttons.xml b/subsonic-android/res/layout/main_buttons.xml index a532c233..7fb511ac 100644 --- a/subsonic-android/res/layout/main_buttons.xml +++ b/subsonic-android/res/layout/main_buttons.xml @@ -48,16 +48,17 @@ android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="#EFEFEF"
- android:textStyle="bold"
- android:background="#A5A5A5"
+ android:textColor="@color/cyan"
android:gravity="center_vertical"
- android:paddingLeft="4dp"/>
+ android:paddingLeft="6dp"
+ android:textAllCaps="true"
+ android:textStyle="bold"
+ android:textSize="16sp"/>
<TextView
android:id="@+id/main_albums_newest"
android:text="@string/main.albums_newest"
- android:drawableRight="@drawable/list_item_artist"
+ android:drawableRight="@drawable/list_item_more"
android:drawablePadding="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@@ -69,7 +70,7 @@ <TextView
android:id="@+id/main_albums_recent"
android:text="@string/main.albums_recent"
- android:drawableRight="@drawable/list_item_artist"
+ android:drawableRight="@drawable/list_item_more"
android:drawablePadding="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@@ -81,7 +82,7 @@ <TextView
android:id="@+id/main_albums_frequent"
android:text="@string/main.albums_frequent"
- android:drawableRight="@drawable/list_item_artist"
+ android:drawableRight="@drawable/list_item_more"
android:drawablePadding="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@@ -93,7 +94,7 @@ <TextView
android:id="@+id/main_albums_highest"
android:text="@string/main.albums_highest"
- android:drawableRight="@drawable/list_item_artist"
+ android:drawableRight="@drawable/list_item_more"
android:drawablePadding="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@@ -117,7 +118,7 @@ <TextView
android:id="@+id/main_albums_random"
android:text="@string/main.albums_random"
- android:drawableRight="@drawable/list_item_artist"
+ android:drawableRight="@drawable/list_item_more"
android:drawablePadding="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
diff --git a/subsonic-android/res/layout/playlist_list_item.xml b/subsonic-android/res/layout/playlist_list_item.xml index 20706dc9..3c99ccbd 100644 --- a/subsonic-android/res/layout/playlist_list_item.xml +++ b/subsonic-android/res/layout/playlist_list_item.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" - android:drawableRight="@drawable/list_item_playlist" + android:drawableRight="@drawable/list_item_more" android:drawablePadding="6dip" android:layout_width="fill_parent" android:layout_height="wrap_content" diff --git a/subsonic-android/res/layout/search.xml b/subsonic-android/res/layout/search.xml index f65bcb36..5f5c26e0 100644 --- a/subsonic-android/res/layout/search.xml +++ b/subsonic-android/res/layout/search.xml @@ -4,8 +4,6 @@ android:layout_width="fill_parent"
android:layout_height="fill_parent">
- <include layout="@layout/action_bar"/>
-
<View
android:layout_width="fill_parent"
android:layout_height="1px"
diff --git a/subsonic-android/res/layout/select_album.xml b/subsonic-android/res/layout/select_album.xml index 2c9a00aa..a5802246 100644 --- a/subsonic-android/res/layout/select_album.xml +++ b/subsonic-android/res/layout/select_album.xml @@ -4,8 +4,6 @@ android:layout_width="fill_parent"
android:layout_height="fill_parent">
- <include layout="@layout/action_bar"/>
-
<View
android:layout_width="fill_parent"
android:layout_height="1px"
@@ -28,93 +26,6 @@ android:layout_weight="1.0"
android:fastScrollEnabled="true"
/>
-
- <LinearLayout android:orientation="horizontal"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="3dp"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
-
- <Button android:id="@+id/select_album_pin"
- android:text="@string/common.pin"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:layout_marginLeft="6dp"
- android:layout_marginRight="3dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"
- android:visibility="gone"/>
-
- <Button android:id="@+id/select_album_unpin"
- android:text="@string/common.unpin"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:layout_marginLeft="3dp"
- android:layout_marginRight="3dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"
- android:visibility="gone"/>
-
- <Button android:id="@+id/select_album_delete"
- android:text="@string/common.delete"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:layout_marginLeft="3dp"
- android:layout_marginRight="6dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"
- android:visibility="gone"/>
-
- </LinearLayout>
-
- <LinearLayout android:orientation="horizontal"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="3dp"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
-
- <Button android:id="@+id/select_album_select"
- android:text="@string/select_album.select"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:visibility="gone"
- android:layout_marginLeft="6dp"
- android:layout_marginRight="3dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"/>
-
- <Button android:id="@+id/select_album_play_now"
- android:text="@string/common.play_now"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:visibility="gone"
- android:layout_marginLeft="3dp"
- android:layout_marginRight="3dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"/>
-
- <Button android:id="@+id/select_album_play_shuffled"
- android:text="@string/common.play_shuffled"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:visibility="gone"
- android:layout_marginLeft="3dp"
- android:layout_marginRight="3dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"/>
-
-
- <Button android:id="@+id/select_album_play_last"
- android:text="@string/common.play_last"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:visibility="gone"
- android:layout_marginLeft="3dp"
- android:layout_marginRight="6dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"/>
-
- </LinearLayout>
<include layout="@layout/button_bar"/>
diff --git a/subsonic-android/res/layout/select_artist.xml b/subsonic-android/res/layout/select_artist.xml index 7cf6fc77..bebfdec4 100644 --- a/subsonic-android/res/layout/select_artist.xml +++ b/subsonic-android/res/layout/select_artist.xml @@ -4,8 +4,6 @@ android:layout_width="fill_parent"
android:layout_height="fill_parent">
- <include layout="@layout/action_bar"/>
-
<View
android:layout_width="fill_parent"
android:layout_height="1px"
diff --git a/subsonic-android/res/layout/select_artist_header.xml b/subsonic-android/res/layout/select_artist_header.xml index 247eb806..50e10742 100644 --- a/subsonic-android/res/layout/select_artist_header.xml +++ b/subsonic-android/res/layout/select_artist_header.xml @@ -10,7 +10,7 @@ android:minHeight="?android:attr/listPreferredItemHeight">
<ImageView
- android:src="@drawable/select_artist_folder"
+ android:src="@drawable/main_select_server"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
diff --git a/subsonic-android/res/layout/select_playlist.xml b/subsonic-android/res/layout/select_playlist.xml index c23e764b..2555687d 100644 --- a/subsonic-android/res/layout/select_playlist.xml +++ b/subsonic-android/res/layout/select_playlist.xml @@ -4,8 +4,6 @@ android:layout_width="fill_parent"
android:layout_height="fill_parent">
- <include layout="@layout/action_bar"/>
-
<View
android:layout_width="fill_parent"
android:layout_height="1px"
diff --git a/subsonic-android/res/layout/song_list_item.xml b/subsonic-android/res/layout/song_list_item.xml index 87f56a22..b2029ccd 100644 --- a/subsonic-android/res/layout/song_list_item.xml +++ b/subsonic-android/res/layout/song_list_item.xml @@ -9,7 +9,7 @@ android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center_vertical"
- android:checkMark="?android:attr/textCheckMark"
+ android:checkMark="@drawable/btn_check"
android:paddingLeft="3dip"/>
<LinearLayout android:orientation="vertical"
diff --git a/subsonic-android/res/menu/main.xml b/subsonic-android/res/menu/main.xml index 27698f81..8edf5304 100644 --- a/subsonic-android/res/menu/main.xml +++ b/subsonic-android/res/menu/main.xml @@ -1,22 +1,30 @@ <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/menu_search" + android:icon="@drawable/action_search" + android:title="@string/menu.search" + android:showAsAction="always|withText"/> + + <item + android:id="@+id/menu_shuffle" + android:icon="@drawable/action_shuffle" + android:title="@string/menu.shuffle" + android:showAsAction="always|withText"/> - <item - android:id="@+id/menu_exit" - android:icon="@drawable/ic_menu_exit" - android:title="@string/menu.exit" - /> + <item + android:id="@+id/menu_help" + android:icon="@drawable/action_help" + android:title="@string/menu.help"/> - <item - android:id="@+id/menu_settings" - android:icon="@drawable/ic_menu_settings" - android:title="@string/menu.settings" - /> + <item + android:id="@+id/menu_settings" + android:icon="@drawable/action_settings" + android:title="@string/menu.settings"/> - <item - android:id="@+id/menu_help" - android:icon="@drawable/ic_menu_help" - android:title="@string/menu.help" - /> + <item + android:id="@+id/menu_exit" + android:icon="@drawable/action_exit" + android:title="@string/menu.exit"/> </menu> diff --git a/subsonic-android/res/menu/nowplaying.xml b/subsonic-android/res/menu/nowplaying.xml index 28bcb5ef..a880438e 100644 --- a/subsonic-android/res/menu/nowplaying.xml +++ b/subsonic-android/res/menu/nowplaying.xml @@ -3,25 +3,25 @@ <item android:id="@+id/menu_shuffle" - android:icon="@drawable/ic_menu_shuffle" + android:icon="@drawable/action_shuffle" android:title="@string/download.menu_shuffle" - /> + android:showAsAction="always|withText"/> + + <item + android:id="@+id/menu_remove_all" + android:icon="@drawable/action_remove_all" + android:title="@string/download.menu_remove_all" + android:showAsAction="always|withText"/> <item android:id="@+id/menu_save_playlist" - android:icon="@drawable/ic_menu_save" + android:icon="@drawable/action_save" android:title="@string/download.menu_save" - /> - - <item - android:id="@+id/menu_remove_all" - android:icon="@drawable/ic_menu_remove_all" - android:title="@string/download.menu_remove_all" - /> + android:showAsAction="ifRoom|withText"/> <item android:id="@+id/menu_screen_on_off" - android:icon="@drawable/ic_menu_screen_on_off" + android:icon="@drawable/action_screen_on_off" android:title="@string/download.menu_screen_on" - /> + android:showAsAction="ifRoom|withText"/> </menu> diff --git a/subsonic-android/res/menu/nowplaying_context.xml b/subsonic-android/res/menu/nowplaying_context.xml index 04e56e1a..eeb49a26 100644 --- a/subsonic-android/res/menu/nowplaying_context.xml +++ b/subsonic-android/res/menu/nowplaying_context.xml @@ -1,39 +1,19 @@ <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:id="@+id/menu_show_album" - android:title="@string/download.menu_show_album" - /> - - <item - android:id="@+id/menu_lyrics" - android:title="@string/download.menu_lyrics" - /> - - <item - android:id="@+id/menu_remove" - android:title="@string/download.menu_remove" - /> - <item - android:id="@+id/menu_delete" - android:title="@string/download.menu_delete" - /> + android:id="@+id/menu_show_album" + android:title="@string/download.menu_show_album"/> - <item - android:id="@+id/menu_remove_all" - android:title="@string/download.menu_remove_all" - /> + <item + android:id="@+id/menu_lyrics" + android:title="@string/download.menu_lyrics"/> - <item - android:id="@+id/menu_shuffle" - android:title="@string/download.menu_shuffle" - /> + <item + android:id="@+id/menu_remove" + android:title="@string/download.menu_remove"/> - <item - android:id="@+id/menu_save_playlist" - android:title="@string/download.menu_save" - /> - + <item + android:id="@+id/menu_delete" + android:title="@string/download.menu_delete"/> </menu> diff --git a/subsonic-android/res/menu/search.xml b/subsonic-android/res/menu/search.xml new file mode 100644 index 00000000..b9cdecac --- /dev/null +++ b/subsonic-android/res/menu/search.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/menu_search" + android:icon="@drawable/action_search" + android:title="@string/menu.search" + android:showAsAction="ifRoom|withText"/> + + <item + android:id="@+id/menu_help" + android:icon="@drawable/ic_menu_help" + android:title="@string/menu.help"/> + + <item + android:id="@+id/menu_settings" + android:icon="@drawable/ic_menu_settings" + android:title="@string/menu.settings"/> + + <item + android:id="@+id/menu_exit" + android:icon="@drawable/ic_menu_exit" + android:title="@string/menu.exit"/> + +</menu> diff --git a/subsonic-android/res/menu/select_album.xml b/subsonic-android/res/menu/select_album.xml new file mode 100644 index 00000000..0d7fed68 --- /dev/null +++ b/subsonic-android/res/menu/select_album.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/menu_play_now" + android:icon="@drawable/action_play_all" + android:title="@string/menu.play" + android:showAsAction="always|withText"/> + + <item + android:id="@+id/menu_refresh" + android:icon="@drawable/action_refresh" + android:title="@string/menu.refresh" + android:showAsAction="always|withText"/> + + <item + android:id="@+id/menu_shuffle" + android:icon="@drawable/action_shuffle" + android:title="@string/menu.shuffle" + android:showAsAction="ifRoom|withText"/> + + <item + android:id="@+id/menu_select" + android:icon="@drawable/action_select" + android:title="@string/menu.select" + android:showAsAction="ifRoom|withText"/> + + <item + android:id="@+id/menu_cache" + android:icon="@drawable/action_save" + android:title="@string/common.pin" + android:showAsAction="ifRoom|withText"/> + + <item + android:id="@+id/menu_delete" + android:icon="@drawable/action_remove_all" + android:title="@string/common.delete" + android:showAsAction="ifRoom|withText"/> + + <item + android:id="@+id/menu_play_last" + android:icon="@drawable/action_play_all" + android:title="@string/menu.play_last" + android:showAsAction="ifRoom|withText"/> +</menu> diff --git a/subsonic-android/res/menu/select_artist.xml b/subsonic-android/res/menu/select_artist.xml new file mode 100644 index 00000000..71672710 --- /dev/null +++ b/subsonic-android/res/menu/select_artist.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/menu_refresh" + android:icon="@drawable/action_refresh" + android:title="@string/menu.refresh" + android:showAsAction="always|withText"/> + + <item + android:id="@+id/menu_shuffle" + android:icon="@drawable/action_shuffle" + android:title="@string/menu.shuffle" + android:showAsAction="always|withText"/> + + <item + android:id="@+id/menu_help" + android:icon="@drawable/action_help" + android:title="@string/menu.help"/> + + <item + android:id="@+id/menu_settings" + android:icon="@drawable/action_settings" + android:title="@string/menu.settings"/> + + <item + android:id="@+id/menu_exit" + android:icon="@drawable/action_exit" + android:title="@string/menu.exit"/> +</menu> diff --git a/subsonic-android/res/menu/select_playlist.xml b/subsonic-android/res/menu/select_playlist.xml new file mode 100644 index 00000000..fb5e678b --- /dev/null +++ b/subsonic-android/res/menu/select_playlist.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/menu_refresh" + android:icon="@drawable/action_refresh" + android:title="@string/menu.refresh" + android:showAsAction="always|withText"/> + + <item + android:id="@+id/menu_help" + android:icon="@drawable/action_help" + android:title="@string/menu.help"/> + + <item + android:id="@+id/menu_settings" + android:icon="@drawable/action_settings" + android:title="@string/menu.settings"/> + + <item + android:id="@+id/menu_exit" + android:icon="@drawable/action_exit" + android:title="@string/menu.exit"/> +</menu> diff --git a/subsonic-android/res/values/arrays.xml b/subsonic-android/res/values/arrays.xml index 17ea4b6a..e9b66161 100644 --- a/subsonic-android/res/values/arrays.xml +++ b/subsonic-android/res/values/arrays.xml @@ -2,15 +2,17 @@ <resources> <string-array name="themeValues"> - <item>wheat</item> <item>light</item> <item>dark</item> + <item>light_fullscreen</item> + <item>dark_fullscreen</item> </string-array> <string-array name="themeNames"> - <item>@string/settings.theme_wheat</item> <item>@string/settings.theme_light</item> <item>@string/settings.theme_dark</item> + <item>@string/settings.theme_light_fullscreen</item> + <item>@string/settings.theme_dark_fullscreen</item> </string-array> <string-array name="preloadCountValues"> diff --git a/subsonic-android/res/values/colors.xml b/subsonic-android/res/values/colors.xml index 69ab22a1..841acdb8 100644 --- a/subsonic-android/res/values/colors.xml +++ b/subsonic-android/res/values/colors.xml @@ -6,10 +6,7 @@ <color name="appwidget_text">#FFFFFF</color> <color name="notificationArtist">#434343</color> <color name="notificationTitle">#000000</color> - - <color name="wheatBackground">#F1F0E6</color> - <color name="wheatForeground1">#494B26</color> - <color name="wheatForeground2">#830009</color> + <color name="background_holo_light">#ff33b5e5</color> <color name="ics_opaque">#8033b5e5</color> <color name="cyan">#ff0099cc</color> diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml index 08407a96..b39ec48f 100644 --- a/subsonic-android/res/values/strings.xml +++ b/subsonic-android/res/values/strings.xml @@ -9,8 +9,7 @@ <string name="common.play_shuffled">Play shuffled</string>
<string name="common.play_next">Play next</string>
<string name="common.play_last">Play last</string>
- <string name="common.pin">Pin</string>
- <string name="common.unpin">Unpin</string>
+ <string name="common.pin">Cache</string>
<string name="common.delete">Delete</string>
<string name="button_bar.home">DSub home</string>
@@ -34,6 +33,12 @@ <string name="main.albums_starred">Starred</string>
<string name="main.albums_random">Random</string>
+ <string name="menu.search">Search</string>
+ <string name="menu.shuffle">Shuffle</string>
+ <string name="menu.refresh">Refresh</string>
+ <string name="menu.select">Select All</string>
+ <string name="menu.play">Play</string>
+ <string name="menu.play_last">Play Last</string>
<string name="menu.exit">Exit</string>
<string name="menu.settings">Settings</string>
<string name="menu.help">Help</string>
@@ -146,6 +151,8 @@ <string name="settings.theme_wheat">Wheat</string>
<string name="settings.theme_light">Light</string>
<string name="settings.theme_dark">Dark</string>
+ <string name="settings.theme_light_fullscreen">Light Fullscreen</string>
+ <string name="settings.theme_dark_fullscreen">Dark Fullscreen</string>
<string name="settings.network_title">Network</string>
<string name="settings.max_bitrate_wifi">Max bitrate - Wi-Fi</string>
<string name="settings.max_bitrate_mobile">Max bitrate - Mobile</string>
diff --git a/subsonic-android/res/values/styles.xml b/subsonic-android/res/values/styles.xml index a970fe1b..4a26dc68 100644 --- a/subsonic-android/res/values/styles.xml +++ b/subsonic-android/res/values/styles.xml @@ -1,14 +1,30 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <style name="Wheat" parent="android:Theme.Light"> - <item name="android:windowBackground">@color/wheatBackground</item> - <item name="android:textColorPrimary">@color/wheatForeground1</item> - <item name="android:textColorSecondary">@color/wheatForeground2</item> - <item name="android:listViewStyle">@style/WheatListView</item> - </style> - - <style name="WheatListView" parent="android:style/Widget.ListView.White"> - <item name="android:cacheColorHint">@color/wheatBackground</item> - </style> - + <style name="Theme.DSub.Light" parent="Theme.Sherlock.Light.ForceOverflow"> + <item name="actionBarStyle">@style/Widget.DSub.ActionBarStyle.Light</item> + <item name="android:actionBarStyle">@style/Widget.DSub.ActionBarStyle.Light</item> + <item name="android:textColorSecondary">@color/cyan</item> + </style> + <style name="Theme.DSub.Dark" parent="Theme.Sherlock.ForceOverflow"> + <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> + </style> + + <style name="Theme.DSub.Light.Fullscreen" parent="Theme.DSub.Light"> + <item name="android:windowFullscreen">true</item> + </style> + <style name="Theme.DSub.Dark.Fullscreen" parent="Theme.DSub.Dark"> + <item name="android:windowFullscreen">true</item> + </style> + + <style name="Widget.DSub.ActionBarStyle.Light" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse"> + <item name="background">@drawable/menubar_button_normal</item> + <item name="android:background">@drawable/menubar_button_normal</item> + </style> + + <style name="Widget.DSub.ActionBarStyle.Dark" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse"> + <item name="background">@drawable/menubar_button_normal</item> + <item name="android:background">@drawable/menubar_button_normal</item> + </style> </resources> diff --git a/subsonic-android/res/xml/settings.xml b/subsonic-android/res/xml/settings.xml index daa98b90..455a9dc0 100644 --- a/subsonic-android/res/xml/settings.xml +++ b/subsonic-android/res/xml/settings.xml @@ -109,7 +109,7 @@ <ListPreference android:title="@string/settings.theme_title" android:key="theme" - android:defaultValue="wheat" + android:defaultValue="light" android:entryValues="@array/themeValues" android:entries="@array/themeNames"/> diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java index 04d710d5..eefe03a8 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java @@ -40,9 +40,6 @@ import android.view.Display; import android.view.GestureDetector; import android.view.GestureDetector.OnGestureListener; import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; @@ -59,6 +56,9 @@ import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; import android.widget.ViewFlipper; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; +import com.actionbarsherlock.view.MenuInflater; import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.domain.PlayerState; @@ -123,7 +123,10 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setTitle("Now Playing"); setContentView(R.layout.download); + + getSupportActionBar().hide(); WindowManager w = getWindowManager(); Display d = w.getDefaultDisplay(); @@ -502,7 +505,7 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi @Override public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); + MenuInflater inflater = getSupportMenuInflater(); inflater.inflate(R.menu.nowplaying, menu); return true; } @@ -523,13 +526,13 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi } @Override - public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { + public void onCreateContextMenu(android.view.ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, view, menuInfo); if (view == playlistView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; DownloadFile downloadFile = (DownloadFile) playlistView.getItemAtPosition(info.position); - MenuInflater inflater = getMenuInflater(); + android.view.MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.nowplaying_context, menu); if (downloadFile.getSong().getParent() == null) { @@ -543,7 +546,7 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi } @Override - public boolean onContextItemSelected(MenuItem menuItem) { + public boolean onContextItemSelected(android.view.MenuItem menuItem) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuItem.getMenuInfo(); DownloadFile downloadFile = (DownloadFile) playlistView.getItemAtPosition(info.position); return menuItemSelected(menuItem.getItemId(), downloadFile) || super.onContextItemSelected(menuItem); @@ -658,8 +661,7 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi buttonBarFlipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_down_in)); buttonBarFlipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.push_down_out)); buttonBarFlipper.setDisplayedChild(0); - - + getSupportActionBar().hide(); } else { playlistFlipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_up_in)); playlistFlipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.push_up_out)); @@ -667,6 +669,7 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi buttonBarFlipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_up_in)); buttonBarFlipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.push_up_out)); buttonBarFlipper.setDisplayedChild(1); + getSupportActionBar().show(); } } diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java index ff5c29c1..23b1ba0d 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java @@ -28,6 +28,9 @@ import github.daneren2005.dsub.util.Constants; import github.daneren2005.dsub.util.MergeAdapter; import github.daneren2005.dsub.util.Util; import github.daneren2005.dsub.util.FileUtil; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; +import com.actionbarsherlock.view.MenuInflater; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -35,7 +38,6 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.view.ContextMenu; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ImageButton; @@ -51,8 +53,6 @@ public class MainActivity extends SubsonicTabActivity { private static final int MENU_ITEM_SERVER_3 = 103; private static final int MENU_ITEM_OFFLINE = 104; - private String theme; - private static boolean infoDialogDisplayed; /** @@ -118,63 +118,48 @@ public class MainActivity extends SubsonicTabActivity { } } }); - - // Title: Subsonic + + // Title: Subsonic setTitle(R.string.common_appname); + showInfoDialog(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getSupportMenuInflater(); + inflater.inflate(R.menu.main, menu); + return true; + } - // Button 1: shuffle - ImageButton actionShuffleButton = (ImageButton)findViewById(R.id.action_button_1); - actionShuffleButton.setImageResource(R.drawable.action_shuffle); - actionShuffleButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - Intent intent = new Intent(MainActivity.this, DownloadActivity.class); + @Override + public boolean onOptionsItemSelected(MenuItem item) { + Intent intent; + switch (item.getItemId()) { + case R.id.menu_shuffle: + intent = new Intent(MainActivity.this, DownloadActivity.class); intent.putExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, true); Util.startActivityWithoutTransition(MainActivity.this, intent); - } - }); - - // Button 2: search - ImageButton actionSearchButton = (ImageButton)findViewById(R.id.action_button_2); - actionSearchButton.setImageResource(R.drawable.action_search); - actionSearchButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - Intent intent = new Intent(MainActivity.this, SearchActivity.class); + return true; + case R.id.menu_search: + intent = new Intent(MainActivity.this, SearchActivity.class); intent.putExtra(Constants.INTENT_EXTRA_REQUEST_SEARCH, true); Util.startActivityWithoutTransition(MainActivity.this, intent); - } - }); - - // Button 3: Help - ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3); - actionHelpButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(MainActivity.this, HelpActivity.class)); - } - }); - - // Button 4: Settings - ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4); - actionSettingsButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(MainActivity.this, SettingsActivity.class)); - - /*LayoutInflater inflater = (LayoutInflater)MainActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - PopupWindow pw = new PopupWindow(inflater.inflate(R.layout.overflow_menu, null, false), 100, 100, true); - pw.showAsDropDown(findViewById(R.id.action_button_4));*/ - - /*PopupWindow window = new PopupWindow(findViewById(R.layout.overflow_menu)); - window.showAsDropDown(findViewById(R.id.action_button_2));*/ - } - }); - - // Remember the current theme. - theme = Util.getTheme(this); + return true; + case R.id.menu_exit: + intent = new Intent(this, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.putExtra(Constants.INTENT_EXTRA_NAME_EXIT, true); + Util.startActivityWithoutTransition(this, intent); + return true; + case R.id.menu_settings: + startActivity(new Intent(this, SettingsActivity.class)); + return true; + case R.id.menu_help: + startActivity(new Intent(this, HelpActivity.class)); + return true; + } - showInfoDialog(); + return false; } private void loadSettings() { @@ -190,21 +175,16 @@ public class MainActivity extends SubsonicTabActivity { @Override protected void onResume() { super.onResume(); - - // Restart activity if theme has changed. - if (theme != null && !theme.equals(Util.getTheme(this))) { - restart(); - } } @Override public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, view, menuInfo); - MenuItem menuItem1 = menu.add(MENU_GROUP_SERVER, MENU_ITEM_SERVER_1, MENU_ITEM_SERVER_1, Util.getServerName(this, 1)); - MenuItem menuItem2 = menu.add(MENU_GROUP_SERVER, MENU_ITEM_SERVER_2, MENU_ITEM_SERVER_2, Util.getServerName(this, 2)); - MenuItem menuItem3 = menu.add(MENU_GROUP_SERVER, MENU_ITEM_SERVER_3, MENU_ITEM_SERVER_3, Util.getServerName(this, 3)); - MenuItem menuItem4 = menu.add(MENU_GROUP_SERVER, MENU_ITEM_OFFLINE, MENU_ITEM_OFFLINE, Util.getServerName(this, 0)); + android.view.MenuItem menuItem1 = menu.add(MENU_GROUP_SERVER, MENU_ITEM_SERVER_1, MENU_ITEM_SERVER_1, Util.getServerName(this, 1)); + android.view.MenuItem menuItem2 = menu.add(MENU_GROUP_SERVER, MENU_ITEM_SERVER_2, MENU_ITEM_SERVER_2, Util.getServerName(this, 2)); + android.view.MenuItem menuItem3 = menu.add(MENU_GROUP_SERVER, MENU_ITEM_SERVER_3, MENU_ITEM_SERVER_3, Util.getServerName(this, 3)); + android.view.MenuItem menuItem4 = menu.add(MENU_GROUP_SERVER, MENU_ITEM_OFFLINE, MENU_ITEM_OFFLINE, Util.getServerName(this, 0)); menu.setGroupCheckable(MENU_GROUP_SERVER, true, true); menu.setHeaderTitle(R.string.main_select_server); @@ -225,7 +205,7 @@ public class MainActivity extends SubsonicTabActivity { } @Override - public boolean onContextItemSelected(MenuItem menuItem) { + public boolean onContextItemSelected(android.view.MenuItem menuItem) { switch (menuItem.getItemId()) { case MENU_ITEM_OFFLINE: setActiveServer(0); @@ -258,12 +238,6 @@ public class MainActivity extends SubsonicTabActivity { } } - private void restart() { - Intent intent = new Intent(this, MainActivity.class); - intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - Util.startActivityWithoutTransition(this, intent); - } - private void exit() { stopService(new Intent(this, DownloadServiceImpl.class)); finish(); diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SearchActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SearchActivity.java index 3ea0cabf..4b9d844f 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SearchActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SearchActivity.java @@ -36,6 +36,7 @@ import android.widget.ListAdapter; import android.widget.ListView; import android.widget.TextView; import android.net.Uri; +import com.actionbarsherlock.view.Menu; import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.Artist; import github.daneren2005.dsub.domain.MusicDirectory; @@ -134,39 +135,38 @@ public class SearchActivity extends SubsonicTabActivity { } }); registerForContextMenu(list); + onNewIntent(getIntent()); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater(); + inflater.inflate(R.menu.search, menu); + return true; + } - // Button 1: gone - findViewById(R.id.action_button_1).setVisibility(View.GONE); - - // Button 2: search - final ImageButton actionSearchButton = (ImageButton)findViewById(R.id.action_button_2); - actionSearchButton.setImageResource(R.drawable.action_search); - actionSearchButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - onSearchRequested(); - } - }); - - // Button 3: Help - ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3); - actionHelpButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(SearchActivity.this, HelpActivity.class)); - } - }); - - // Button 4: Settings - ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4); - actionSettingsButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(SearchActivity.this, SettingsActivity.class)); - } - }); + @Override + public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item) { + Intent intent; + switch (item.getItemId()) { + case R.id.menu_search: + onSearchRequested(); + return true; + case R.id.menu_exit: + intent = new Intent(this, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.putExtra(Constants.INTENT_EXTRA_NAME_EXIT, true); + Util.startActivityWithoutTransition(this, intent); + return true; + case R.id.menu_settings: + startActivity(new Intent(this, SettingsActivity.class)); + return true; + case R.id.menu_help: + startActivity(new Intent(this, HelpActivity.class)); + return true; + } - onNewIntent(getIntent()); + return false; } @Override diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java index 8a473bc7..ce88b5e3 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java @@ -34,6 +34,7 @@ import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; +import com.actionbarsherlock.view.Menu; import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.service.DownloadFile; @@ -55,17 +56,13 @@ public class SelectAlbumActivity extends SubsonicTabActivity { private ListView entryList; private View footer; private View emptyView; - private Button selectButton; - private Button playNowButton; - private Button playShuffledButton; - private Button playLastButton; - private Button pinButton; - private Button unpinButton; - private Button deleteButton; + private boolean hideButtons = false; + private com.actionbarsherlock.view.MenuItem selectAll; + private com.actionbarsherlock.view.MenuItem cache; + private com.actionbarsherlock.view.MenuItem delete; + private com.actionbarsherlock.view.MenuItem playLast; private Button moreButton; - private ImageView coverArtView; private boolean licenseValid; - private ImageButton playAllButton; /** * Called when the activity is first created. @@ -91,77 +88,16 @@ public class SelectAlbumActivity extends SubsonicTabActivity { Util.startActivityWithoutTransition(SelectAlbumActivity.this, intent); } else if (entry.isVideo()) { playVideo(entry); - } else { - enableButtons(); } } } }); - - coverArtView = (ImageView) findViewById(R.id.actionbar_home_icon); - selectButton = (Button) findViewById(R.id.select_album_select); - playNowButton = (Button) findViewById(R.id.select_album_play_now); - playShuffledButton = (Button) findViewById(R.id.select_album_play_shuffled); - playLastButton = (Button) findViewById(R.id.select_album_play_last); - pinButton = (Button) findViewById(R.id.select_album_pin); - unpinButton = (Button) findViewById(R.id.select_album_unpin); - deleteButton = (Button) findViewById(R.id.select_album_delete); + moreButton = (Button) footer.findViewById(R.id.select_album_more); emptyView = findViewById(R.id.select_album_empty); - selectButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - selectAllOrNone(); - } - }); - playNowButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - download(false, false, true, false, false); - selectAll(false, false); - } - }); - playShuffledButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - download(false, false, true, false, true); - selectAll(false, false); - } - }); - playLastButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - download(true, false, false, false, false); - selectAll(false, false); - } - }); - pinButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - download(true, true, false, false, false); - selectAll(false, false); - } - }); - unpinButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - unpin(); - selectAll(false, false); - } - }); - deleteButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - delete(); - selectAll(false, false); - } - }); - registerForContextMenu(entryList); - enableButtons(); - String id = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_ID); String name = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_NAME); String playlistId = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID); @@ -177,47 +113,80 @@ public class SelectAlbumActivity extends SubsonicTabActivity { } else { getMusicDirectory(id, name); } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater(); + inflater.inflate(R.menu.select_album, menu); + selectAll = menu.findItem(R.id.menu_select); + cache = menu.findItem(R.id.menu_cache); + delete = menu.findItem(R.id.menu_delete); + playLast = menu.findItem(R.id.menu_play_last); + if(hideButtons) { + selectAll.setVisible(false); + cache.setVisible(false); + delete.setVisible(false); + playLast.setVisible(false); + hideButtons = false; + } + return true; + } - // Button 1: play all - playAllButton = (ImageButton) findViewById(R.id.action_button_1); - playAllButton.setImageResource(R.drawable.action_play_all); - playAllButton.setVisibility(View.GONE); - playAllButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - playAll(false); - } - }); + @Override + public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item) { + Intent intent; + switch (item.getItemId()) { + case R.id.menu_play_now: + playNow(false); + return true; + case R.id.menu_play_last: + download(true, false, false, false, false); + selectAll(false, false); + return true; + case R.id.menu_shuffle: + playNow(true); + return true; + case R.id.menu_select: + selectAllOrNone(); + return true; + case R.id.menu_refresh: + refresh(); + return true; + case R.id.menu_cache: + download(true, true, false, false, false); + selectAll(false, false); + return true; + case R.id.menu_delete: + delete(); + selectAll(false, false); + return true; + case R.id.menu_exit: + intent = new Intent(this, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.putExtra(Constants.INTENT_EXTRA_NAME_EXIT, true); + Util.startActivityWithoutTransition(this, intent); + return true; + case R.id.menu_settings: + startActivity(new Intent(this, SettingsActivity.class)); + return true; + case R.id.menu_help: + startActivity(new Intent(this, HelpActivity.class)); + return true; + } - // Button 2: refresh - ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_2); - refreshButton.setImageResource(R.drawable.action_refresh); - refreshButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - refresh(); - } - }); - - // Button 3: Help - ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3); - actionHelpButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(SelectAlbumActivity.this, HelpActivity.class)); - } - }); - - // Button 4: Settings - ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4); - actionSettingsButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(SelectAlbumActivity.this, SettingsActivity.class)); - } - }); + return false; } + private void playNow(final boolean shuffle) { + if(getSelectedSongs().size() > 0) { + download(false, false, true, false, shuffle); + selectAll(false, false); + } + else { + playAll(shuffle); + } + } private void playAll(final boolean shuffle) { boolean hasSubFolders = false; for (int i = 0; i < entryList.getCount(); i++) { @@ -400,36 +369,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity { : R.string.select_album_n_unselected; Util.toast(this, getString(toastResId, selectedCount)); } - - enableButtons(); - } - - private void enableButtons() { - if (getDownloadService() == null) { - return; - } - - List<MusicDirectory.Entry> selection = getSelectedSongs(); - boolean enabled = !selection.isEmpty(); - boolean unpinEnabled = false; - boolean deleteEnabled = false; - - for (MusicDirectory.Entry song : selection) { - DownloadFile downloadFile = getDownloadService().forSong(song); - if (downloadFile.isCompleteFileAvailable()) { - deleteEnabled = true; - } - if (downloadFile.isSaved()) { - unpinEnabled = true; - } - } - - playNowButton.setEnabled(enabled); - playShuffledButton.setEnabled(enabled); - playLastButton.setEnabled(enabled); - pinButton.setEnabled(enabled && !Util.isOffline(this)); - unpinButton.setEnabled(unpinEnabled); - deleteButton.setEnabled(deleteEnabled); } private List<MusicDirectory.Entry> getSelectedSongs() { @@ -529,23 +468,23 @@ public class SelectAlbumActivity extends SubsonicTabActivity { builder.setMessage(R.string.select_album_donate_dialog_message); builder.setPositiveButton(R.string.select_album_donate_dialog_now, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.DONATION_URL))); - } - }); + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.DONATION_URL))); + } + }); builder.setNegativeButton(R.string.select_album_donate_dialog_later, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - dialogInterface.dismiss(); - if (onValid != null) { - onValid.run(); - } - } - }); + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + dialogInterface.dismiss(); + if (onValid != null) { + onValid.run(); + } + } + }); builder.create().show(); } @@ -578,21 +517,18 @@ public class SelectAlbumActivity extends SubsonicTabActivity { } if (songCount > 0) { - getImageLoader().loadImage(coverArtView, entries.get(0), false, true); + getImageLoader().loadImage(getSupportActionBar(), entries.get(0)); entryList.addFooterView(footer); - selectButton.setVisibility(View.VISIBLE); - playNowButton.setVisibility(View.VISIBLE); - playShuffledButton.setVisibility(View.VISIBLE); - playLastButton.setVisibility(View.VISIBLE); - pinButton.setVisibility(View.VISIBLE); - unpinButton.setVisibility(View.VISIBLE); - deleteButton.setVisibility(View.VISIBLE); - } - - boolean isAlbumList = getIntent().hasExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE); + } else if(selectAll != null) { + selectAll.setVisible(false); + cache.setVisible(false); + delete.setVisible(false); + playLast.setVisible(false); + } else { + hideButtons = true; + } emptyView.setVisibility(entries.isEmpty() ? View.VISIBLE : View.GONE); - playAllButton.setVisibility(isAlbumList || entries.isEmpty() ? View.GONE : View.VISIBLE); entryList.setAdapter(new EntryAdapter(SelectAlbumActivity.this, getImageLoader(), entries, true)); licenseValid = result.getSecond(); diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectArtistActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectArtistActivity.java index 8b32ff3a..bee76641 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectArtistActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectArtistActivity.java @@ -30,6 +30,7 @@ import android.widget.AdapterView; import android.widget.ImageButton; import android.widget.ListView; import android.widget.TextView; +import com.actionbarsherlock.view.Menu; import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.Artist; import github.daneren2005.dsub.domain.Indexes; @@ -73,51 +74,46 @@ public class SelectArtistActivity extends SubsonicTabActivity implements Adapter } registerForContextMenu(artistList); + setTitle(Util.isOffline(this) ? R.string.music_library_label_offline : R.string.music_library_label); - setTitle(Util.isOffline(this) ? R.string.music_library_label_offline : R.string.music_library_label); + musicFolders = null; + load(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater(); + inflater.inflate(R.menu.select_artist, menu); + return true; + } - // Button 1: shuffle - ImageButton shuffleButton = (ImageButton) findViewById(R.id.action_button_1); - shuffleButton.setImageResource(R.drawable.action_shuffle); - shuffleButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - Intent intent = new Intent(SelectArtistActivity.this, DownloadActivity.class); + @Override + public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item) { + Intent intent; + switch (item.getItemId()) { + case R.id.menu_refresh: + refresh(); + return true; + case R.id.menu_shuffle: + intent = new Intent(SelectArtistActivity.this, DownloadActivity.class); intent.putExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, true); Util.startActivityWithoutTransition(SelectArtistActivity.this, intent); - } - }); - - // Button 2: refresh - ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_2); - refreshButton.setImageResource(R.drawable.action_refresh); - refreshButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - refresh(); - } - }); - - // Button 3: Help - ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3); - actionHelpButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(SelectArtistActivity.this, HelpActivity.class)); - } - }); - - // Button 4: Settings - ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4); - actionSettingsButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(SelectArtistActivity.this, SettingsActivity.class)); - } - }); + return true; + case R.id.menu_exit: + intent = new Intent(this, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.putExtra(Constants.INTENT_EXTRA_NAME_EXIT, true); + Util.startActivityWithoutTransition(this, intent); + return true; + case R.id.menu_settings: + startActivity(new Intent(this, SettingsActivity.class)); + return true; + case R.id.menu_help: + startActivity(new Intent(this, HelpActivity.class)); + return true; + } - musicFolders = null; - load(); + return false; } private void refresh() { diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java index a299b84b..f515d5be 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java @@ -61,39 +61,38 @@ public class SelectPlaylistActivity extends SubsonicTabActivity implements Adapt // Title: Playlists setTitle(R.string.playlist_label); - // Button 1: gone - ImageButton searchButton = (ImageButton)findViewById(R.id.action_button_1); - searchButton.setVisibility(View.GONE); - - // Button 2: refresh - ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_2); - refreshButton.setImageResource(R.drawable.action_refresh); - refreshButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { + load(); + } + + @Override + public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) { + com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater(); + inflater.inflate(R.menu.select_playlist, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item) { + Intent intent; + switch (item.getItemId()) { + case R.id.menu_refresh: refresh(); - } - }); - - // Button 3: Help - ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3); - actionHelpButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(SelectPlaylistActivity.this, HelpActivity.class)); - } - }); - - // Button 4: Settings - ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4); - actionSettingsButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - startActivity(new Intent(SelectPlaylistActivity.this, SettingsActivity.class)); - } - }); + return true; + case R.id.menu_exit: + intent = new Intent(this, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.putExtra(Constants.INTENT_EXTRA_NAME_EXIT, true); + Util.startActivityWithoutTransition(this, intent); + return true; + case R.id.menu_settings: + startActivity(new Intent(this, SettingsActivity.class)); + return true; + case R.id.menu_help: + startActivity(new Intent(this, HelpActivity.class)); + return true; + } - load(); + return false; } private void refresh() { diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java index e3548302..178d2b37 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java @@ -34,14 +34,13 @@ import android.os.Bundle; import android.os.Environment; import android.util.Log; import android.view.KeyEvent; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; import android.view.View; import android.view.Window; import android.widget.ImageButton; import android.widget.TextView; import github.daneren2005.dsub.R; +import com.actionbarsherlock.app.ActionBar; +import com.actionbarsherlock.app.SherlockActivity; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.service.DownloadService; import github.daneren2005.dsub.service.DownloadServiceImpl; @@ -58,10 +57,11 @@ import github.daneren2005.dsub.util.Util; /** * @author Sindre Mehus */ -public class SubsonicTabActivity extends Activity { +public class SubsonicTabActivity extends SherlockActivity { private static final String TAG = SubsonicTabActivity.class.getSimpleName(); private static ImageLoader IMAGE_LOADER; + private String theme; private boolean destroyed; private View homeButton; @@ -74,7 +74,6 @@ public class SubsonicTabActivity extends Activity { setUncaughtExceptionHandler(); applyTheme(); super.onCreate(bundle); - requestWindowFeature(Window.FEATURE_NO_TITLE); startService(new Intent(this, DownloadServiceImpl.class)); setVolumeControlStream(AudioManager.STREAM_MUSIC); } @@ -137,37 +136,12 @@ public class SubsonicTabActivity extends Activity { @Override protected void onResume() { super.onResume(); - Util.registerMediaButtonEventReceiver(this); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.main, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - - case R.id.menu_exit: - Intent intent = new Intent(this, MainActivity.class); - intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - intent.putExtra(Constants.INTENT_EXTRA_NAME_EXIT, true); - Util.startActivityWithoutTransition(this, intent); - return true; - - case R.id.menu_settings: - startActivity(new Intent(this, SettingsActivity.class)); - return true; - - case R.id.menu_help: - startActivity(new Intent(this, HelpActivity.class)); - return true; + Util.registerMediaButtonEventReceiver(this); + + // Make sure to update theme + if (theme != null && !theme.equals(Util.getTheme(this))) { + restart(); } - - return false; } @Override @@ -191,6 +165,13 @@ public class SubsonicTabActivity extends Activity { } return super.onKeyDown(keyCode, event); } + + protected void restart() { + Intent intent = new Intent(this, this.getClass()); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.putExtras(getIntent()); + Util.startActivityWithoutTransition(this, intent); + } @Override public void finish() { @@ -198,30 +179,19 @@ public class SubsonicTabActivity extends Activity { Util.disablePendingTransition(this); } - @Override - public void setTitle(CharSequence title) { - super.setTitle(title); - - // Set the font of title in the action bar. - TextView text = (TextView) findViewById(R.id.actionbar_title_text); - Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/Storopia.ttf"); - text.setTypeface(typeface); - - text.setText(title); - } - - @Override - public void setTitle(int titleId) { - setTitle(getString(titleId)); - } - private void applyTheme() { - String theme = Util.getTheme(this); + theme = Util.getTheme(this); if ("dark".equals(theme)) { - setTheme(android.R.style.Theme); + setTheme(R.style.Theme_DSub_Dark); } else if ("light".equals(theme)) { - setTheme(android.R.style.Theme_Light); - } + setTheme(R.style.Theme_DSub_Light); + } else if ("dark_fullscreen".equals(theme)) { + setTheme(R.style.Theme_DSub_Dark_Fullscreen); + } else if ("light_fullscreen".equals(theme)) { + setTheme(R.style.Theme_DSub_Light_Fullscreen); + }else { + setTheme(R.style.Theme_DSub_Light); + } } public boolean isDestroyed() { diff --git a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java index 0c4bc215..e1a9d86a 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java @@ -44,6 +44,8 @@ import github.daneren2005.dsub.service.MusicServiceFactory; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; +import com.actionbarsherlock.app.ActionBar; + /** * Asynchronous loading of images, with caching. * <p/> @@ -101,7 +103,7 @@ public class ImageLoader implements Runnable { if (!large) { setUnknownImage(view, large); } - queue.offer(new Task(view.getContext(), view, null, entry, size, large, large, crossfade)); + queue.offer(new Task(view.getContext(), entry, size, large, large, new ViewTaskHandler(view, crossfade))); } public void loadImage(Context context, RemoteControlClient remoteControl, MusicDirectory.Entry entry) { @@ -117,7 +119,23 @@ public class ImageLoader implements Runnable { } setUnknownImage(remoteControl); - queue.offer(new Task(context, null, remoteControl, entry, imageSizeDefault, false, false, false)); + queue.offer(new Task(context, entry, imageSizeDefault, false, false, new RemoteControlClientTaskHandler(remoteControl))); + } + + public void loadImage(ActionBar actionBar, MusicDirectory.Entry entry) { + if (entry == null || entry.getCoverArt() == null) { + setUnknownImage(actionBar); + return; + } + + Drawable drawable = cache.get(getKey(entry.getCoverArt(), imageSizeDefault)); + if (drawable != null) { + setImage(actionBar, drawable); + return; + } + + setUnknownImage(actionBar); + queue.offer(new Task(actionBar.getThemedContext(), entry, imageSizeDefault, false, false, new ActionBarTaskHandler(actionBar))); } private String getKey(String coverArtId, int size) { @@ -158,6 +176,10 @@ public class ImageLoader implements Runnable { origBitmap.copy(origBitmap.getConfig(), true)) .apply(); } + + private void setImage(ActionBar actionBar, Drawable drawable) { + actionBar.setIcon(drawable); + } private void setUnknownImage(View view, boolean large) { if (large) { @@ -174,6 +196,10 @@ public class ImageLoader implements Runnable { private void setUnknownImage(RemoteControlClient remoteControl) { setImage(remoteControl, largeUnknownImage); } + + private void setUnknownImage(ActionBar actionBar) { + setImage(actionBar, largeUnknownImage); + } public void clear() { queue.clear(); @@ -240,53 +266,95 @@ public class ImageLoader implements Runnable { } private class Task { - private final Context context; - private final View view; - private final RemoteControlClient remoteControl; - private final MusicDirectory.Entry entry; - private final Handler handler; - private final int size; - private final boolean reflection; - private final boolean saveToFile; - private final boolean crossfade; - - public Task(Context context, View view, RemoteControlClient remoteControl, MusicDirectory.Entry entry, int size, boolean reflection, boolean saveToFile, boolean crossfade) { - this.context = context; - this.view = view; - this.remoteControl = remoteControl; - this.entry = entry; - this.size = size; - this.reflection = reflection; - this.saveToFile = saveToFile; - this.crossfade = crossfade; - handler = new Handler(); + private final Context mContext; + private final MusicDirectory.Entry mEntry; + private final Handler mHandler; + private final int mSize; + private final boolean mReflection; + private final boolean mSaveToFile; + private ImageLoaderTaskHandler mTaskHandler; + + public Task(Context context, MusicDirectory.Entry entry, int size, boolean reflection, boolean saveToFile, ImageLoaderTaskHandler taskHandler) { + mContext = context; + mEntry = entry; + mSize = size; + mReflection = reflection; + mSaveToFile = saveToFile; + mTaskHandler = taskHandler; + mHandler = new Handler(); } public void execute() { try { - MusicService musicService = MusicServiceFactory.getMusicService(context); - Bitmap bitmap = musicService.getCoverArt(context, entry, size, saveToFile, null); + MusicService musicService = MusicServiceFactory.getMusicService(mContext); + Bitmap bitmap = musicService.getCoverArt(mContext, mEntry, mSize, mSaveToFile, null); - if (reflection) { + if (mReflection) { bitmap = createReflection(bitmap); } - final Drawable drawable = Util.createDrawableFromBitmap(context, bitmap); - cache.put(getKey(entry.getCoverArt(), size), drawable); - - handler.post(new Runnable() { - @Override - public void run() { - if (view != null) { - setImage(view, drawable, crossfade); - } else if (remoteControl != null) { - setImage(remoteControl, drawable); - } - } - }); + final Drawable drawable = Util.createDrawableFromBitmap(mContext, bitmap); + cache.put(getKey(mEntry.getCoverArt(), mSize), drawable); + + mTaskHandler.setDrawable(drawable); + mHandler.post(mTaskHandler); } catch (Throwable x) { Log.e(TAG, "Failed to download album art.", x); } } } + + private abstract class ImageLoaderTaskHandler implements Runnable { + + protected Drawable mDrawable; + + public void setDrawable(Drawable drawable) { + mDrawable = drawable; + } + + } + + private class ViewTaskHandler extends ImageLoaderTaskHandler { + + protected boolean mCrossfade; + private View mView; + + public ViewTaskHandler(View view, boolean crossfade) { + mCrossfade = crossfade; + mView = view; + } + + @Override + public void run() { + setImage(mView, mDrawable, mCrossfade); + } + } + + private class RemoteControlClientTaskHandler extends ImageLoaderTaskHandler { + + private RemoteControlClient mRemoteControl; + + public RemoteControlClientTaskHandler(RemoteControlClient remoteControl) { + mRemoteControl = remoteControl; + } + + @Override + public void run() { + setImage(mRemoteControl, mDrawable); + } + } + + private class ActionBarTaskHandler extends ImageLoaderTaskHandler { + + private ActionBar mActionBar; + + public ActionBarTaskHandler(ActionBar actionBar) { + mActionBar = actionBar; + } + + @Override + public void run() { + setImage(mActionBar, mDrawable); + } + } } |