Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
Fixed medium widget display issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
timusus committed Aug 15, 2018
1 parent 262267b commit cfed7c9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public void updateWidgetUI() {
text1.setTextColor(textColor);
}
if (artistName != null && albumName != null && text2 != null && text3 == null) {
text2.setText(artistName + " | " + albumName);
text2.setText(artistName + " " + albumName);
text2.setTextColor(textColor);
} else if (artistName != null && albumName != null && text2 != null) {
text2.setText(albumName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void update(MusicService service, int[] appWidgetIds, boolean updateArtwo
// No error, so show normal titles
views.setViewVisibility(R.id.text1, View.VISIBLE);
views.setTextViewText(R.id.text1, titleName);
views.setTextViewText(R.id.text2, artistName + " | " + albumName);
views.setTextViewText(R.id.text2, artistName + " " + albumName);
}

boolean invertIcons = mPrefs.getBoolean(ARG_WIDGET_INVERT_ICONS + appWidgetId, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void update(MusicService service, int[] appWidgetIds, boolean updateArtwo
// No error, so show normal titles
views.setViewVisibility(R.id.text1, View.VISIBLE);
views.setTextViewText(R.id.text1, titleName);
views.setTextViewText(R.id.text2, artistName + " | " + albumName);
views.setTextViewText(R.id.text2, artistName + " " + albumName);
}

boolean invertIcons = mPrefs.getBoolean(ARG_WIDGET_INVERT_ICONS + appWidgetId, false);
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/res/layout/widget_layout_medium.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
android:id="@+id/widget_layout_medium"
android:layout_width="match_parent"
android:layout_height="@dimen/widget_medium_height"
android:padding="@dimen/widget_margin"
tools:ignore="ContentDescription">

<RelativeLayout
Expand All @@ -25,32 +24,35 @@
android:layout_height="match_parent"
android:layout_toRightOf="@id/album_art"
android:orientation="vertical"
android:padding="8dp">
android:paddingBottom="4dp"
android:paddingEnd="8dp"
android:paddingStart="8dp"
android:paddingTop="4dp">

<TextView
android:id="@+id/text1"
style="@style/AppWidget_TextView.Bold"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="14sp"/>
android:textSize="14sp"
style="@style/AppWidget_TextView.Bold"/>

<TextView
android:id="@+id/text2"
style="@style/AppWidget_TextView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="4dp"
android:layout_marginBottom="6dp"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="?android:textColorPrimaryInverse"
android:textSize="14sp"/>
android:textSize="14sp"
style="@style/AppWidget_TextView"/>

<LinearLayout
android:layout_width="match_parent"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/widget_layout_medium_alt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
android:id="@+id/widget_layout_medium"
android:layout_width="match_parent"
android:layout_height="@dimen/widget_medium_height"
android:padding="@dimen/widget_margin"
tools:ignore="ContentDescription">

<ImageView
Expand All @@ -18,13 +17,14 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:orientation="vertical">

<LinearLayout
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="4dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="vertical">

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@

<!--Widget Dimens -->
<dimen name="widget_medium_width">250dp</dimen>
<dimen name="widget_medium_height">96dp</dimen>
<dimen name="widget_large_height">152dp</dimen>
<dimen name="widget_small_height">96dp</dimen>
<dimen name="widget_small_width">128dp</dimen>
<dimen name="widget_medium_artwork_height">96dp</dimen>

<dimen name="widget_medium_height">76dp</dimen>
<dimen name="widget_medium_artwork_height">76dp</dimen>

<!--Widget Dimens -->
<dimen name="widget_large_image_width">88dp</dimen>
Expand Down

0 comments on commit cfed7c9

Please sign in to comment.