Add album/track star support

Changed lowest REST protocol level to 1.8.0, changed downloaded icon,
added discNumber support
This commit is contained in:
Joshua Bahnsen 2013-01-23 00:57:13 -07:00
parent 19839cfd0d
commit 72111240e7
20 changed files with 1187 additions and 1014 deletions

View File

@ -2,7 +2,7 @@
<manifest xmlns:a="http://schemas.android.com/apk/res/android"
package="net.sourceforge.subsonic.androidapp"
a:versionCode="47"
a:versionName="3.9.9.8" a:installLocation="auto">
a:versionName="3.9.9.9" a:installLocation="auto">
<uses-permission a:name="android.permission.INTERNET"/>
<uses-permission a:name="android.permission.READ_PHONE_STATE"/>

View File

@ -131,158 +131,162 @@ public final class R {
public static final int select_album_play_all_normal=0x7f02004b;
public static final int select_album_play_all_pressed=0x7f02004c;
public static final int slider_knob=0x7f02004d;
public static final int status_bg=0x7f02004e;
public static final int status_next=0x7f02004f;
public static final int status_pause=0x7f020050;
public static final int status_play=0x7f020051;
public static final int status_prev=0x7f020052;
public static final int status_stop=0x7f020053;
public static final int title_bar_shadow=0x7f020054;
public static final int unknown_album=0x7f020055;
public static final int unknown_album_large=0x7f020056;
public static final int star=0x7f02004e;
public static final int star_hollow=0x7f02004f;
public static final int status_bg=0x7f020050;
public static final int status_next=0x7f020051;
public static final int status_pause=0x7f020052;
public static final int status_play=0x7f020053;
public static final int status_prev=0x7f020054;
public static final int status_stop=0x7f020055;
public static final int title_bar_shadow=0x7f020056;
public static final int unknown_album=0x7f020057;
public static final int unknown_album_large=0x7f020058;
}
public static final class id {
public static final int album=0x7f0d0048;
public static final int album=0x7f0d0049;
public static final int album_artist=0x7f0d0002;
public static final int album_coverart=0x7f0d0000;
public static final int album_menu_pin=0x7f0d0085;
public static final int album_menu_play_last=0x7f0d0084;
public static final int album_menu_play_now=0x7f0d0083;
public static final int album_menu_pin=0x7f0d0087;
public static final int album_menu_play_last=0x7f0d0086;
public static final int album_menu_play_now=0x7f0d0085;
public static final int album_star=0x7f0d0003;
public static final int album_title=0x7f0d0001;
public static final int appwidget_coverart=0x7f0d0003;
public static final int appwidget_top=0x7f0d0005;
public static final int artist=0x7f0d0007;
public static final int artist_menu_pin=0x7f0d0088;
public static final int artist_menu_play_last=0x7f0d0087;
public static final int artist_menu_play_now=0x7f0d0086;
public static final int button_bar=0x7f0d000b;
public static final int button_bar_home=0x7f0d000c;
public static final int button_bar_music=0x7f0d000d;
public static final int button_bar_now_playing=0x7f0d0010;
public static final int button_bar_playlists=0x7f0d000f;
public static final int button_bar_search=0x7f0d000e;
public static final int control_next=0x7f0d000a;
public static final int control_play=0x7f0d0009;
public static final int control_previous=0x7f0d0008;
public static final int control_stop=0x7f0d0049;
public static final int download_album=0x7f0d0024;
public static final int download_album_art_image=0x7f0d001e;
public static final int download_album_art_layout=0x7f0d001d;
public static final int download_artist=0x7f0d0023;
public static final int download_button_bar_flipper=0x7f0d0020;
public static final int download_control_layout=0x7f0d0011;
public static final int download_duration=0x7f0d0022;
public static final int download_empty=0x7f0d0025;
public static final int download_equalizer=0x7f0d0079;
public static final int download_jukebox=0x7f0d007b;
public static final int download_list=0x7f0d0026;
public static final int appwidget_coverart=0x7f0d0004;
public static final int appwidget_top=0x7f0d0006;
public static final int artist=0x7f0d0008;
public static final int artist_menu_pin=0x7f0d008a;
public static final int artist_menu_play_last=0x7f0d0089;
public static final int artist_menu_play_now=0x7f0d0088;
public static final int button_bar=0x7f0d000c;
public static final int button_bar_home=0x7f0d000d;
public static final int button_bar_music=0x7f0d000e;
public static final int button_bar_now_playing=0x7f0d0011;
public static final int button_bar_playlists=0x7f0d0010;
public static final int button_bar_search=0x7f0d000f;
public static final int control_next=0x7f0d000b;
public static final int control_play=0x7f0d000a;
public static final int control_previous=0x7f0d0009;
public static final int control_stop=0x7f0d004a;
public static final int download_album=0x7f0d0025;
public static final int download_album_art_image=0x7f0d001f;
public static final int download_album_art_layout=0x7f0d001e;
public static final int download_artist=0x7f0d0024;
public static final int download_button_bar_flipper=0x7f0d0021;
public static final int download_control_layout=0x7f0d0012;
public static final int download_duration=0x7f0d0023;
public static final int download_empty=0x7f0d0026;
public static final int download_equalizer=0x7f0d007b;
public static final int download_jukebox=0x7f0d007d;
public static final int download_list=0x7f0d0027;
public static final int download_next=0x7f0d0018;
public static final int download_pause=0x7f0d0015;
public static final int download_playlist_flipper=0x7f0d001c;
public static final int download_position=0x7f0d0021;
public static final int download_playlist_flipper=0x7f0d001d;
public static final int download_position=0x7f0d0022;
public static final int download_previous=0x7f0d0014;
public static final int download_progress_bar=0x7f0d0027;
public static final int download_repeat=0x7f0d0013;
public static final int download_shuffle=0x7f0d0012;
public static final int download_song_title=0x7f0d001b;
public static final int download_progress_bar=0x7f0d0028;
public static final int download_repeat=0x7f0d0019;
public static final int download_shuffle=0x7f0d0013;
public static final int download_song_title=0x7f0d001c;
public static final int download_start=0x7f0d0017;
public static final int download_status=0x7f0d001a;
public static final int download_status=0x7f0d001b;
public static final int download_stop=0x7f0d0016;
public static final int download_toggle_list=0x7f0d0019;
public static final int download_visualizer=0x7f0d007a;
public static final int download_visualizer_view_layout=0x7f0d001f;
public static final int equalizer_bar=0x7f0d002d;
public static final int equalizer_frequency=0x7f0d002b;
public static final int equalizer_level=0x7f0d002c;
public static final int equalizer_enabled=0x7f0d0028;
public static final int equalizer_layout=0x7f0d0029;
public static final int equalizer_preset=0x7f0d002a;
public static final int help_back=0x7f0d002f;
public static final int help_buttons=0x7f0d002e;
public static final int help_close=0x7f0d0030;
public static final int help_contents=0x7f0d0031;
public static final int icon=0x7f0d006e;
public static final int jukebox_volume_progress_bar=0x7f0d0033;
public static final int linearLayout1=0x7f0d0004;
public static final int lyrics_artist=0x7f0d0035;
public static final int lyrics_scrollview=0x7f0d0034;
public static final int lyrics_text=0x7f0d0037;
public static final int lyrics_title=0x7f0d0036;
public static final int main_select_server_1=0x7f0d003b;
public static final int main_select_server_2=0x7f0d003c;
public static final int main_albums=0x7f0d003d;
public static final int main_albums_frequent=0x7f0d0040;
public static final int main_albums_highest=0x7f0d0041;
public static final int main_albums_newest=0x7f0d003e;
public static final int main_albums_random=0x7f0d0043;
public static final int main_albums_recent=0x7f0d003f;
public static final int main_albums_starred=0x7f0d0042;
public static final int main_dummy=0x7f0d0039;
public static final int main_list=0x7f0d0038;
public static final int main_select_server=0x7f0d003a;
public static final int main_shuffle=0x7f0d0078;
public static final int menu_exit=0x7f0d0077;
public static final int menu_help=0x7f0d0076;
public static final int menu_lyrics=0x7f0d0080;
public static final int menu_refresh=0x7f0d0089;
public static final int menu_remove=0x7f0d0081;
public static final int menu_remove_all=0x7f0d007d;
public static final int menu_save_playlist=0x7f0d007c;
public static final int menu_screen_on_off=0x7f0d007e;
public static final int menu_settings=0x7f0d0075;
public static final int menu_show_album=0x7f0d007f;
public static final int menu_shuffle=0x7f0d0082;
public static final int notification_image=0x7f0d0045;
public static final int play_video_contents=0x7f0d004a;
public static final int progress_message=0x7f0d004b;
public static final int save_playlist_name=0x7f0d004d;
public static final int save_playlist_root=0x7f0d004c;
public static final int search_albums=0x7f0d0051;
public static final int search_artists=0x7f0d0050;
public static final int search_list=0x7f0d004e;
public static final int search_more_albums=0x7f0d0054;
public static final int search_more_artists=0x7f0d0053;
public static final int search_more_songs=0x7f0d0055;
public static final int search_search=0x7f0d004f;
public static final int search_songs=0x7f0d0052;
public static final int select_album_cover_art=0x7f0d005f;
public static final int select_album_delete=0x7f0d005d;
public static final int select_album_empty=0x7f0d0056;
public static final int select_album_entries=0x7f0d0057;
public static final int select_album_more=0x7f0d005e;
public static final int select_album_pin=0x7f0d005b;
public static final int select_album_play_all=0x7f0d0062;
public static final int select_album_play_last=0x7f0d005a;
public static final int select_album_play_now=0x7f0d0059;
public static final int select_album_select=0x7f0d0058;
public static final int select_album_text1=0x7f0d0060;
public static final int select_album_text2=0x7f0d0061;
public static final int select_album_unpin=0x7f0d005c;
public static final int select_artist_folder=0x7f0d0064;
public static final int select_artist_folder_1=0x7f0d0065;
public static final int select_artist_folder_2=0x7f0d0066;
public static final int select_artist_list=0x7f0d0063;
public static final int select_playlist_empty=0x7f0d0067;
public static final int select_playlist_list=0x7f0d0068;
public static final int song_artist=0x7f0d006c;
public static final int song_check=0x7f0d0069;
public static final int song_duration=0x7f0d006d;
public static final int song_menu_play_last=0x7f0d008c;
public static final int song_menu_play_next=0x7f0d008b;
public static final int song_menu_play_now=0x7f0d008a;
public static final int song_status=0x7f0d006b;
public static final int song_title=0x7f0d006a;
public static final int status_icon=0x7f0d0046;
public static final int status_media_collapse=0x7f0d0072;
public static final int status_media_next=0x7f0d0071;
public static final int status_media_play=0x7f0d0070;
public static final int status_media_prev=0x7f0d006f;
public static final int statusbar=0x7f0d0044;
public static final int tab_progress=0x7f0d0073;
public static final int tab_progress_message=0x7f0d0074;
public static final int title=0x7f0d0006;
public static final int toast_layout_root=0x7f0d0032;
public static final int trackname=0x7f0d0047;
public static final int download_toggle_list=0x7f0d001a;
public static final int download_visualizer=0x7f0d007c;
public static final int download_visualizer_view_layout=0x7f0d0020;
public static final int equalizer_bar=0x7f0d002e;
public static final int equalizer_frequency=0x7f0d002c;
public static final int equalizer_level=0x7f0d002d;
public static final int equalizer_enabled=0x7f0d0029;
public static final int equalizer_layout=0x7f0d002a;
public static final int equalizer_preset=0x7f0d002b;
public static final int help_back=0x7f0d0030;
public static final int help_buttons=0x7f0d002f;
public static final int help_close=0x7f0d0031;
public static final int help_contents=0x7f0d0032;
public static final int icon=0x7f0d0070;
public static final int jukebox_volume_progress_bar=0x7f0d0034;
public static final int linearLayout1=0x7f0d0005;
public static final int lyrics_artist=0x7f0d0036;
public static final int lyrics_scrollview=0x7f0d0035;
public static final int lyrics_text=0x7f0d0038;
public static final int lyrics_title=0x7f0d0037;
public static final int main_select_server_1=0x7f0d003c;
public static final int main_select_server_2=0x7f0d003d;
public static final int main_albums=0x7f0d003e;
public static final int main_albums_frequent=0x7f0d0041;
public static final int main_albums_highest=0x7f0d0042;
public static final int main_albums_newest=0x7f0d003f;
public static final int main_albums_random=0x7f0d0044;
public static final int main_albums_recent=0x7f0d0040;
public static final int main_albums_starred=0x7f0d0043;
public static final int main_dummy=0x7f0d003a;
public static final int main_list=0x7f0d0039;
public static final int main_select_server=0x7f0d003b;
public static final int main_shuffle=0x7f0d007a;
public static final int menu_exit=0x7f0d0079;
public static final int menu_help=0x7f0d0078;
public static final int menu_lyrics=0x7f0d0082;
public static final int menu_refresh=0x7f0d008b;
public static final int menu_remove=0x7f0d0083;
public static final int menu_remove_all=0x7f0d007f;
public static final int menu_save_playlist=0x7f0d007e;
public static final int menu_screen_on_off=0x7f0d0080;
public static final int menu_settings=0x7f0d0077;
public static final int menu_show_album=0x7f0d0081;
public static final int menu_shuffle=0x7f0d0084;
public static final int notification_image=0x7f0d0046;
public static final int play_video_contents=0x7f0d004b;
public static final int progress_message=0x7f0d004c;
public static final int save_playlist_name=0x7f0d004e;
public static final int save_playlist_root=0x7f0d004d;
public static final int search_albums=0x7f0d0052;
public static final int search_artists=0x7f0d0051;
public static final int search_list=0x7f0d004f;
public static final int search_more_albums=0x7f0d0055;
public static final int search_more_artists=0x7f0d0054;
public static final int search_more_songs=0x7f0d0056;
public static final int search_search=0x7f0d0050;
public static final int search_songs=0x7f0d0053;
public static final int select_album_cover_art=0x7f0d0060;
public static final int select_album_delete=0x7f0d005e;
public static final int select_album_empty=0x7f0d0057;
public static final int select_album_entries=0x7f0d0058;
public static final int select_album_more=0x7f0d005f;
public static final int select_album_pin=0x7f0d005c;
public static final int select_album_play_all=0x7f0d0063;
public static final int select_album_play_last=0x7f0d005b;
public static final int select_album_play_now=0x7f0d005a;
public static final int select_album_select=0x7f0d0059;
public static final int select_album_text1=0x7f0d0061;
public static final int select_album_text2=0x7f0d0062;
public static final int select_album_unpin=0x7f0d005d;
public static final int select_artist_folder=0x7f0d0065;
public static final int select_artist_folder_1=0x7f0d0066;
public static final int select_artist_folder_2=0x7f0d0067;
public static final int select_artist_list=0x7f0d0064;
public static final int select_playlist_empty=0x7f0d0068;
public static final int select_playlist_list=0x7f0d0069;
public static final int song_artist=0x7f0d006d;
public static final int song_check=0x7f0d006a;
public static final int song_duration=0x7f0d006e;
public static final int song_menu_play_last=0x7f0d008e;
public static final int song_menu_play_next=0x7f0d008d;
public static final int song_menu_play_now=0x7f0d008c;
public static final int song_star=0x7f0d006f;
public static final int song_status=0x7f0d006c;
public static final int song_title=0x7f0d006b;
public static final int status_icon=0x7f0d0047;
public static final int status_media_collapse=0x7f0d0074;
public static final int status_media_next=0x7f0d0073;
public static final int status_media_play=0x7f0d0072;
public static final int status_media_prev=0x7f0d0071;
public static final int statusbar=0x7f0d0045;
public static final int tab_progress=0x7f0d0075;
public static final int tab_progress_message=0x7f0d0076;
public static final int title=0x7f0d0007;
public static final int toast_layout_root=0x7f0d0033;
public static final int trackname=0x7f0d0048;
}
public static final class integer {
public static final int config_activityDefaultDur=0x7f080001;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
res/drawable-hdpi/star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -13,38 +13,49 @@
a:layout_height="wrap_content" a:layout_alignParentTop="true"
a:layout_alignParentLeft="true">
<ImageButton a:id="@+id/download_shuffle" a:src="@drawable/media_shuffle_normal"
a:background="@android:color/transparent" a:padding="0dip"
a:layout_width="wrap_content" a:layout_height="wrap_content"
a:layout_gravity="center_vertical" />
<ImageButton a:id="@+id/download_repeat" a:src="@drawable/media_repeat_off"
a:background="@android:color/transparent" a:padding="0dip"
a:layout_width="wrap_content" a:layout_height="wrap_content"
a:layout_gravity="center_vertical" />
<ImageButton a:id="@+id/download_previous" a:src="@drawable/media_backward_normal"
a:background="@android:color/transparent" a:padding="0dip"
a:layout_width="wrap_content" a:layout_height="wrap_content"
a:layout_gravity="center_vertical" />
<ImageButton a:id="@+id/download_pause" a:src="@drawable/media_pause_normal"
a:background="@android:color/transparent" a:padding="0dip"
a:layout_width="wrap_content" a:layout_height="wrap_content"
a:layout_gravity="center_vertical" />
<ImageButton a:id="@+id/download_stop" a:src="@drawable/media_stop_normal"
a:background="@android:color/transparent" a:padding="0dip"
a:layout_width="wrap_content" a:layout_height="wrap_content"
a:layout_gravity="center_vertical" />
<ImageButton a:id="@+id/download_start" a:src="@drawable/media_start_normal"
a:background="@android:color/transparent" a:padding="0dip"
a:layout_width="wrap_content" a:layout_height="wrap_content"
a:layout_gravity="center_vertical" />
<ImageButton a:id="@+id/download_next" a:src="@drawable/media_forward_normal"
a:background="@android:color/transparent" a:padding="0dip"
a:layout_width="wrap_content" a:layout_height="wrap_content"
a:layout_gravity="center_vertical" />
<ImageButton a:id="@+id/download_toggle_list" a:src="@drawable/media_toggle_list_normal"
a:background="@android:color/transparent" a:padding="0dip"
a:layout_width="wrap_content" a:layout_height="wrap_content"
a:layout_gravity="center_vertical" />
<ImageButton a:id="@+id/download_shuffle"
a:layout_width="0dip" a:layout_height="match_parent"
a:layout_gravity="center_vertical" a:layout_weight="1"
a:background="@drawable/list_selector_holo_dark" a:paddingLeft="4dip"
a:src="@drawable/media_shuffle_normal" />
<ImageButton a:id="@+id/download_previous"
a:layout_width="0dp" a:layout_height="match_parent"
a:layout_gravity="center_vertical" a:layout_weight="1"
a:background="@drawable/list_selector_holo_dark" a:padding="0dip"
a:src="@drawable/media_backward_normal" />
<ImageButton a:id="@+id/download_pause" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:padding="0dip" a:src="@drawable/media_pause_normal" />
<ImageButton a:id="@+id/download_stop" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:padding="0dip" a:src="@drawable/media_stop_normal" />
<ImageButton a:id="@+id/download_start" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:padding="0dip" a:src="@drawable/media_start_normal" />
<ImageButton a:id="@+id/download_next" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:padding="0dip" a:src="@drawable/media_forward_normal" />
<ImageButton a:id="@+id/download_repeat" a:layout_width="0dip"
a:layout_height="match_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:src="@drawable/media_repeat_off" />
<ImageButton a:id="@+id/download_toggle_list"
a:layout_width="0dip" a:layout_height="fill_parent"
a:layout_gravity="center_vertical" a:layout_weight="1"
a:background="@drawable/list_selector_holo_dark" a:paddingRight="4dip"
a:src="@drawable/media_toggle_list_normal" a:paddingTop="12dip"
a:paddingBottom="12dip" />
</LinearLayout>
<TextView a:id="@+id/download_status" a:layout_width="wrap_content"
@ -56,8 +67,9 @@
<TextView a:id="@+id/download_song_title" a:layout_width="150dip"
a:layout_height="wrap_content" a:layout_gravity="center_horizontal"
a:layout_above="@+id/download_status" a:layout_centerHorizontal="true"
a:layout_marginLeft="12dip" a:layout_marginRight="12dip" a:layout_marginTop="12dip" a:maxLines="2"
a:ellipsize="end" a:gravity="center_horizontal" a:textAppearance="?android:attr/textAppearanceMedium"
a:layout_marginLeft="12dip" a:layout_marginRight="12dip"
a:layout_marginTop="12dip" a:maxLines="2" a:ellipsize="end"
a:gravity="center_horizontal" a:textAppearance="?android:attr/textAppearanceMedium"
a:textColor="@color/mediaControlForeground" />
</RelativeLayout>
@ -67,7 +79,8 @@
a:layout_height="fill_parent" a:layout_alignParentLeft="true"
a:layout_toLeftOf="@+id/download_control_layout">
<FrameLayout a:id="@+id/download_album_art_layout" a:layout_width="fill_parent" a:layout_height="fill_parent"
<FrameLayout a:id="@+id/download_album_art_layout"
a:layout_width="fill_parent" a:layout_height="fill_parent"
a:background="@color/black">
<ImageView a:id="@+id/download_album_art_image"

View File

@ -6,15 +6,10 @@
a:id="@+id/download_playlist_flipper" a:layout_width="fill_parent"
a:layout_height="0dip" a:layout_weight="1">
<RelativeLayout
a:id="@+id/download_album_art_layout"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1"
a:gravity="left"
a:orientation="vertical"
a:background="@color/black"
>
<RelativeLayout a:id="@+id/download_album_art_layout"
a:layout_width="fill_parent" a:layout_height="fill_parent"
a:layout_weight="1" a:gravity="left" a:orientation="vertical"
a:background="@color/black">
<ImageView a:id="@+id/download_album_art_image"
a:layout_width="wrap_content" a:layout_height="wrap_content"
@ -29,9 +24,10 @@
<TextView a:id="@+id/download_song_title" a:layout_width="wrap_content"
a:layout_height="wrap_content" a:layout_gravity="center_horizontal"
a:layout_above="@+id/download_status" a:layout_centerHorizontal="true"
a:layout_marginLeft="16dip" a:layout_marginRight="16dip" a:layout_marginTop="16dip"
a:singleLine="true" a:textColor="@color/mediaControlForeground"
a:textStyle="bold" a:textSize="18sp" a:ellipsize="end" />
a:layout_marginLeft="16dip" a:layout_marginRight="16dip"
a:layout_marginTop="16dip" a:singleLine="true"
a:textColor="@color/mediaControlForeground" a:textStyle="bold"
a:textSize="18sp" a:ellipsize="end" />
<LinearLayout a:id="@+id/download_visualizer_view_layout"
a:layout_width="fill_parent" a:layout_height="60dip"
@ -50,15 +46,10 @@
a:paddingBottom="0dip" a:paddingTop="0dip">
<ImageButton a:id="@+id/download_shuffle" a:layout_width="0dip"
a:layout_height="fill_parent" a:layout_gravity="center_vertical|left"
a:layout_height="match_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:paddingLeft="4dip" a:src="@drawable/media_shuffle_normal" />
<ImageButton a:id="@+id/download_repeat" a:layout_width="0dip"
a:layout_height="fill_parent" a:layout_gravity="center_vertical|left"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:paddingLeft="4dip" a:src="@drawable/media_repeat_off" />
<ImageButton a:id="@+id/download_previous" a:layout_width="0dp"
a:layout_height="match_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
@ -84,10 +75,16 @@
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:padding="0dip" a:src="@drawable/media_forward_normal" />
<ImageButton a:id="@+id/download_repeat" a:layout_width="0dip"
a:layout_height="match_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:src="@drawable/media_repeat_off" />
<ImageButton a:id="@+id/download_toggle_list"
a:layout_width="0dip" a:layout_height="fill_parent" a:layout_weight="1"
a:background="@drawable/list_selector_holo_dark" a:paddingRight="4dip"
a:src="@drawable/media_toggle_list_normal" a:paddingTop="12dip" a:paddingBottom="12dip" />
a:layout_width="0dip" a:layout_height="fill_parent" a:layout_gravity="center_vertical"
a:layout_weight="1" a:background="@drawable/list_selector_holo_dark"
a:paddingRight="4dip" a:src="@drawable/media_toggle_list_normal"
a:paddingTop="12dip" a:paddingBottom="12dip" />
</LinearLayout>
<include layout="@layout/download_slider" />

View File

@ -38,10 +38,11 @@
</LinearLayout>
<ImageView
a:id="@+id/album_star"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_gravity="right|center_vertical"
a:paddingRight="6dip"/>
<!-- a:src="@drawable/list_item_more"-->
a:layout_height="fill_parent"
a:gravity="center_vertical"
a:background="@drawable/list_selector_holo_dark"
a:src="@drawable/star_hollow" />
</LinearLayout>

View File

@ -73,4 +73,12 @@
</LinearLayout>
</LinearLayout>
<ImageView
a:id="@+id/song_star"
a:layout_width="wrap_content"
a:layout_height="fill_parent"
a:gravity="center_vertical"
a:background="@drawable/list_selector_holo_dark"
a:src="@drawable/star_hollow" />
</LinearLayout>

View File

@ -84,6 +84,24 @@ public class MusicDirectory {
private Integer bitRate;
private String path;
private boolean video;
private boolean starred;
private Integer discNumber;
public Integer getDiscNumber() {
return discNumber;
}
public void setDiscNumber(Integer discNumber) {
this.discNumber = discNumber;
}
public boolean getStarred() {
return starred;
}
public void setStarred(boolean starred) {
this.starred = starred;
}
public String getId() {
return id;

View File

@ -231,4 +231,15 @@ public class CachedMusicService implements MusicService {
restUrl = newUrl;
}
}
@Override
public void star(String id, Context context, ProgressListener progressListener) throws Exception {
musicService.star(id, context, progressListener);
}
@Override
public void unstar(String id, Context context, ProgressListener progressListener) throws Exception {
musicService.unstar(id, context, progressListener);
}
}

View File

@ -47,6 +47,10 @@ public interface MusicService {
List<MusicFolder> getMusicFolders(Context context, ProgressListener progressListener) throws Exception;
void star(String id, Context context, ProgressListener progressListener) throws Exception;
void unstar(String id, Context context, ProgressListener progressListener) throws Exception;
Indexes getIndexes(String musicFolderId, boolean refresh, Context context, ProgressListener progressListener) throws Exception;
MusicDirectory getMusicDirectory(String id, boolean refresh, Context context, ProgressListener progressListener) throws Exception;

View File

@ -138,6 +138,16 @@ public class OfflineMusicService extends RESTMusicService {
}
}
@Override
public void star(String id, Context context, ProgressListener progressListener) throws Exception {
throw new OfflineException("Star not available in offline mode");
}
@Override
public void unstar(String id, Context context, ProgressListener progressListener) throws Exception {
throw new OfflineException("UnStar not available in offline mode");
}
@Override
public List<MusicFolder> getMusicFolders(Context context, ProgressListener progressListener) throws Exception {
throw new OfflineException("Music folders not available in offline mode");

View File

@ -204,6 +204,24 @@ public class RESTMusicService implements MusicService {
}
}
public void star(String id, Context context, ProgressListener progressListener) throws Exception {
Reader reader = getReader(context, progressListener, "star", null, "id", id);
try {
new ErrorParser(context).parse(reader);
} finally {
Util.close(reader);
}
}
public void unstar(String id, Context context, ProgressListener progressListener) throws Exception {
Reader reader = getReader(context, progressListener, "unstar", null, "id", id);
try {
new ErrorParser(context).parse(reader);
} finally {
Util.close(reader);
}
}
@Override
public Indexes getIndexes(String musicFolderId, boolean refresh, Context context, ProgressListener progressListener) throws Exception {
Indexes cachedIndexes = readCachedIndexes(context, musicFolderId);

View File

@ -93,6 +93,11 @@ public abstract class AbstractParser {
return "true".equals(get(name));
}
protected boolean getValueExists(String name) {
String value = get(name);
return value != null && !value.isEmpty();
}
protected Integer getInteger(String name) {
String s = get(name);
return s == null ? null : Integer.valueOf(s);

View File

@ -38,6 +38,7 @@ public class MusicDirectoryEntryParser extends AbstractParser {
entry.setDirectory(getBoolean("isDir"));
entry.setCoverArt(get("coverArt"));
entry.setArtist(get("artist"));
entry.setStarred(getValueExists("starred"));
if (!entry.isDirectory()) {
entry.setAlbum(get("album"));
@ -53,7 +54,9 @@ public class MusicDirectoryEntryParser extends AbstractParser {
entry.setBitRate(getInteger("bitRate"));
entry.setPath(get("path"));
entry.setVideo(getBoolean("isVideo"));
entry.setDiscNumber(getInteger("discNumber"));
}
return entry;
}
}

View File

@ -21,10 +21,13 @@ package net.sourceforge.subsonic.androidapp.util;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import net.sourceforge.subsonic.androidapp.R;
import net.sourceforge.subsonic.androidapp.domain.MusicDirectory;
import net.sourceforge.subsonic.androidapp.service.MusicService;
import net.sourceforge.subsonic.androidapp.service.MusicServiceFactory;
/**
* Used to display albums in a {@code ListView}.
@ -36,6 +39,7 @@ public class AlbumView extends LinearLayout {
private TextView titleView;
private TextView artistView;
private View coverArtView;
private ImageView starImageView;
public AlbumView(Context context) {
super(context);
@ -44,12 +48,46 @@ public class AlbumView extends LinearLayout {
titleView = (TextView) findViewById(R.id.album_title);
artistView = (TextView) findViewById(R.id.album_artist);
coverArtView = findViewById(R.id.album_coverart);
starImageView = (ImageView) findViewById(R.id.album_star);
}
public void setAlbum(MusicDirectory.Entry album, ImageLoader imageLoader) {
public void setAlbum(final MusicDirectory.Entry album, ImageLoader imageLoader) {
titleView.setText(album.getTitle());
artistView.setText(album.getArtist());
artistView.setVisibility(album.getArtist() == null ? View.GONE : View.VISIBLE);
starImageView.setImageDrawable(album.getStarred() ? getResources().getDrawable(R.drawable.star) : getResources().getDrawable(R.drawable.star_hollow));
imageLoader.loadImage(coverArtView, album, false, true);
starImageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final boolean isStarred = album.getStarred();
final String id = album.getId();
if (!isStarred) {
starImageView.setImageDrawable(getResources().getDrawable(R.drawable.star));
album.setStarred(true);
} else {
starImageView.setImageDrawable(getResources().getDrawable(R.drawable.star_hollow));
album.setStarred(false);
}
new Thread(new Runnable() {
public void run() {
MusicService musicService = MusicServiceFactory.getMusicService(null);
try {
if (!isStarred) {
musicService.star(id, getContext(), null);
} else {
musicService.unstar(id, getContext(), null);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}
});
}
}

View File

@ -29,7 +29,7 @@ public final class Constants {
// REST protocol version and client ID.
// Note: Keep it as low as possible to maintain compatibility with older servers.
public static final String REST_PROTOCOL_VERSION = "1.2.0";
public static final String REST_PROTOCOL_VERSION = "1.8.0";
public static final String REST_CLIENT_ID = "android";
// Names for intent extras.

View File

@ -25,6 +25,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.widget.Checkable;
import android.widget.CheckedTextView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import net.sourceforge.subsonic.androidapp.R;
@ -32,6 +33,8 @@ import net.sourceforge.subsonic.androidapp.domain.MusicDirectory;
import net.sourceforge.subsonic.androidapp.service.DownloadService;
import net.sourceforge.subsonic.androidapp.service.DownloadServiceImpl;
import net.sourceforge.subsonic.androidapp.service.DownloadFile;
import net.sourceforge.subsonic.androidapp.service.MusicService;
import net.sourceforge.subsonic.androidapp.service.MusicServiceFactory;
import java.io.File;
import java.util.WeakHashMap;
@ -48,6 +51,7 @@ public class SongView extends LinearLayout implements Checkable {
private static Handler handler;
private CheckedTextView checkedTextView;
private ImageView starImageView;
private TextView titleTextView;
private TextView artistTextView;
private TextView durationTextView;
@ -59,6 +63,7 @@ public class SongView extends LinearLayout implements Checkable {
LayoutInflater.from(context).inflate(R.layout.song_list_item, this, true);
checkedTextView = (CheckedTextView) findViewById(R.id.song_check);
starImageView = (ImageView) findViewById(R.id.song_star);
titleTextView = (TextView) findViewById(R.id.song_title);
artistTextView = (TextView) findViewById(R.id.song_artist);
durationTextView = (TextView) findViewById(R.id.song_duration);
@ -66,13 +71,15 @@ public class SongView extends LinearLayout implements Checkable {
INSTANCES.put(this, null);
int instanceCount = INSTANCES.size();
if (instanceCount > 50) {
Log.w(TAG, instanceCount + " live SongView instances");
}
startUpdater();
}
public void setSong(MusicDirectory.Entry song, boolean checkable) {
public void setSong(final MusicDirectory.Entry song, boolean checkable) {
this.song = song;
StringBuilder artist = new StringBuilder(40);
@ -95,8 +102,41 @@ public class SongView extends LinearLayout implements Checkable {
titleTextView.setText(song.getTitle());
artistTextView.setText(artist);
durationTextView.setText(Util.formatDuration(song.getDuration()));
starImageView.setImageDrawable(song.getStarred() ? getResources().getDrawable(R.drawable.star) : getResources().getDrawable(R.drawable.star_hollow));
checkedTextView.setVisibility(checkable && !song.isVideo() ? View.VISIBLE : View.GONE);
starImageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final boolean isStarred = song.getStarred();
final String id = song.getId();
if (!isStarred) {
starImageView.setImageDrawable(getResources().getDrawable(R.drawable.star));
song.setStarred(true);
} else {
starImageView.setImageDrawable(getResources().getDrawable(R.drawable.star_hollow));
song.setStarred(false);
}
new Thread(new Runnable() {
public void run() {
MusicService musicService = MusicServiceFactory.getMusicService(null);
try {
if (!isStarred) {
musicService.star(id, getContext(), null);
} else {
musicService.unstar(id, getContext(), null);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}
});
update();
}

View File

@ -102,6 +102,9 @@ public class Util extends DownloadActivity {
}
public static boolean isOffline(Context context) {
if (context == null)
return false;
else
return getActiveServer(context) == 0;
}