use multi-line TextView for "No media playing"

This commit is contained in:
Brad Pitcher 2019-04-18 22:08:49 -07:00
parent 73c39fc3d0
commit a349865af3
No known key found for this signature in database
GPG Key ID: 242307B374A1710A
2 changed files with 21 additions and 7 deletions

View File

@ -133,6 +133,8 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
}
views.setTextViewText(R.id.txtvTitle, media.getEpisodeTitle());
views.setViewVisibility(R.id.txtvTitle, View.VISIBLE);
views.setViewVisibility(R.id.txtNoPlaying, View.GONE);
String progressString;
if (playbackService != null) {
@ -166,10 +168,10 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
// start the app if they click anything
views.setOnClickPendingIntent(R.id.layout_left, startAppPending);
views.setOnClickPendingIntent(R.id.butPlay, startAppPending);
views.setViewVisibility(R.id.txtvProgress, View.INVISIBLE);
views.setViewVisibility(R.id.txtvProgress, View.GONE);
views.setViewVisibility(R.id.txtvTitle, View.GONE);
views.setViewVisibility(R.id.txtNoPlaying, View.VISIBLE);
views.setImageViewResource(R.id.imgvCover, R.mipmap.ic_launcher_foreground);
views.setTextViewText(R.id.txtvTitle,
this.getString(R.string.no_media_playing_label));
views.setImageViewResource(R.id.butPlay, R.drawable.ic_play_arrow_white_24dp);
}

View File

@ -46,22 +46,34 @@
android:orientation="vertical" >
<TextView
android:id="@+id/txtvTitle"
android:id="@+id/txtNoPlaying"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:maxLines="1"
android:layout_marginVertical="12dp"
android:maxLines="3"
android:text="@string/no_media_playing_label"
android:textColor="@color/white"
android:textSize="@dimen/text_size_medium"
android:textStyle="bold" />
<TextView
android:id="@+id/txtvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="@dimen/text_size_medium"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/txtvProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:textColor="@color/white" />
android:textColor="@color/white"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>