Show album name on Four Long Widget. (#724)
* When in Album Shuffle mode, enqueue all tracks from the same album at once. * Replaced getRandomSong() with getRandomSongs(). Queue shrink can always be 20, without issue. * Updated comment text. * Grab the first song, not the last. * Use a do-while loop for adding all the album songs. * Show the album name on the FourLongWidget.
This commit is contained in:
parent
74c3475c18
commit
934e1b1f4f
@ -48,7 +48,7 @@ THE SOFTWARE.
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20sp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:fadingEdge="horizontal"
|
||||
@ -60,7 +60,18 @@ THE SOFTWARE.
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#fff"
|
||||
android:textSize="16sp"
|
||||
android:textSize="14sp"
|
||||
android:singleLine="true"
|
||||
android:fadingEdge="horizontal"
|
||||
android:fadingEdgeLength="10dip"
|
||||
android:ellipsize="none" />
|
||||
<TextView
|
||||
android:id="@+id/album"
|
||||
android:text="@string/app_name"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ccc"
|
||||
android:textSize="14sp"
|
||||
android:singleLine="true"
|
||||
android:fadingEdge="horizontal"
|
||||
android:fadingEdgeLength="10dip"
|
||||
|
@ -96,26 +96,30 @@ public class FourLongWidget extends AppWidgetProvider {
|
||||
views.setViewVisibility(R.id.next, View.GONE);
|
||||
views.setViewVisibility(R.id.title, View.GONE);
|
||||
views.setInt(R.id.artist, "setText", R.string.no_songs);
|
||||
views.setViewVisibility(R.id.album, View.GONE);
|
||||
views.setViewVisibility(R.id.cover, View.GONE);
|
||||
} else if (song == null) {
|
||||
views.setViewVisibility(R.id.play_pause, View.VISIBLE);
|
||||
views.setViewVisibility(R.id.next, View.VISIBLE);
|
||||
views.setViewVisibility(R.id.title, View.GONE);
|
||||
views.setInt(R.id.artist, "setText", R.string.app_name);
|
||||
views.setViewVisibility(R.id.album, View.GONE);
|
||||
views.setViewVisibility(R.id.cover, View.GONE);
|
||||
} else {
|
||||
views.setViewVisibility(R.id.play_pause, View.VISIBLE);
|
||||
views.setViewVisibility(R.id.next, View.VISIBLE);
|
||||
views.setViewVisibility(R.id.title, View.VISIBLE);
|
||||
views.setViewVisibility(R.id.album, View.VISIBLE);
|
||||
views.setTextViewText(R.id.title, song.title);
|
||||
views.setTextViewText(R.id.artist, song.artist);
|
||||
views.setTextViewText(R.id.album, song.album);
|
||||
Bitmap cover = song.getCover(context);
|
||||
if (cover == null) {
|
||||
views.setViewVisibility(R.id.cover, View.GONE);
|
||||
views.setImageViewResource(R.id.cover, R.drawable.fallback_cover_large);
|
||||
} else {
|
||||
views.setViewVisibility(R.id.cover, View.VISIBLE);
|
||||
views.setImageViewBitmap(R.id.cover, cover);
|
||||
}
|
||||
views.setViewVisibility(R.id.cover, View.VISIBLE);
|
||||
}
|
||||
|
||||
boolean playing = (state & PlaybackService.FLAG_PLAYING) != 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user