diff options
author | ByteHamster <info@bytehamster.com> | 2021-06-25 18:46:06 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2021-06-25 18:58:42 +0200 |
commit | 958346d6d25f8303a322ce4c35b10cf6e8dc4d51 (patch) | |
tree | c0ca898845af9dff8823f52ee2fc9e4679416927 | |
parent | d4e1ebfa08ebcf716b7c4abf7d9ad8805e9287dd (diff) | |
download | AntennaPod-958346d6d25f8303a322ce4c35b10cf6e8dc4d51.zip |
Fix widget not showing icons
7 files changed, 60 insertions, 19 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/widget/WidgetUpdater.java b/core/src/main/java/de/danoeh/antennapod/core/widget/WidgetUpdater.java index 0ccdb2d81..cecd4b3b6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/widget/WidgetUpdater.java +++ b/core/src/main/java/de/danoeh/antennapod/core/widget/WidgetUpdater.java @@ -122,14 +122,14 @@ public abstract class WidgetUpdater { } if (widgetState.status == PlayerStatus.PLAYING) { - views.setImageViewResource(R.id.butPlay, R.drawable.ic_pause); + views.setImageViewResource(R.id.butPlay, R.drawable.ic_widget_pause); views.setContentDescription(R.id.butPlay, context.getString(R.string.pause_label)); - views.setImageViewResource(R.id.butPlayExtended, R.drawable.ic_pause); + views.setImageViewResource(R.id.butPlayExtended, R.drawable.ic_widget_pause); views.setContentDescription(R.id.butPlayExtended, context.getString(R.string.pause_label)); } else { - views.setImageViewResource(R.id.butPlay, R.drawable.ic_play_48dp); + views.setImageViewResource(R.id.butPlay, R.drawable.ic_widget_play); views.setContentDescription(R.id.butPlay, context.getString(R.string.play_label)); - views.setImageViewResource(R.id.butPlayExtended, R.drawable.ic_play_48dp); + views.setImageViewResource(R.id.butPlayExtended, R.drawable.ic_widget_play); views.setContentDescription(R.id.butPlayExtended, context.getString(R.string.play_label)); } views.setOnClickPendingIntent(R.id.butPlay, @@ -152,8 +152,8 @@ public abstract class WidgetUpdater { views.setViewVisibility(R.id.txtvTitle, View.GONE); views.setViewVisibility(R.id.txtNoPlaying, View.VISIBLE); views.setImageViewResource(R.id.imgvCover, R.mipmap.ic_launcher_round); - views.setImageViewResource(R.id.butPlay, R.drawable.ic_play_48dp); - views.setImageViewResource(R.id.butPlayExtended, R.drawable.ic_play_48dp); + views.setImageViewResource(R.id.butPlay, R.drawable.ic_widget_play); + views.setImageViewResource(R.id.butPlayExtended, R.drawable.ic_widget_play); } if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) { diff --git a/core/src/main/res/layout/player_widget.xml b/core/src/main/res/layout/player_widget.xml index ec8472517..a70e98f0f 100644 --- a/core/src/main/res/layout/player_widget.xml +++ b/core/src/main/res/layout/player_widget.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="@dimen/widget_margin" > + android:padding="@dimen/widget_margin" + tools:ignore="VectorDrawableCompat"> <RelativeLayout android:id="@+id/widgetLayout" @@ -15,16 +16,16 @@ <ImageButton android:id="@+id/butPlay" - android:contentDescription="@string/play_label" android:layout_width="@android:dimen/app_icon_size" android:layout_height="match_parent" + android:contentDescription="@string/play_label" android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:layout_margin="12dp" android:background="?android:attr/selectableItemBackground" android:scaleType="fitCenter" android:padding="8dp" - app:srcCompat="@drawable/ic_play_24dp" /> + android:src="@drawable/ic_widget_play" /> <LinearLayout android:id="@+id/layout_left" @@ -36,13 +37,13 @@ android:layout_toStartOf="@id/butPlay" android:background="@android:color/transparent" android:gravity="fill_horizontal" - android:orientation="horizontal" > + android:orientation="horizontal"> <ImageView android:id="@+id/imgvCover" android:layout_width="@android:dimen/app_icon_size" android:layout_height="match_parent" - app:srcCompat="@mipmap/ic_launcher_round" + android:src="@mipmap/ic_launcher_round" android:importantForAccessibility="no" android:layout_margin="12dp" /> @@ -51,7 +52,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" - android:orientation="vertical" > + android:orientation="vertical"> <TextView android:id="@+id/txtNoPlaying" @@ -99,7 +100,7 @@ android:layout_marginRight="2dp" android:layout_marginEnd="2dp" android:scaleType="fitXY" - app:srcCompat="@drawable/ic_fast_rewind"/> + android:src="@drawable/ic_widget_fast_rewind" /> <ImageButton android:id="@+id/butPlayExtended" @@ -110,7 +111,7 @@ android:layout_marginRight="2dp" android:layout_marginEnd="2dp" android:scaleType="fitXY" - app:srcCompat="@drawable/ic_play_48dp"/> + android:src="@drawable/ic_widget_play" /> <ImageButton android:id="@+id/butFastForward" @@ -121,7 +122,7 @@ android:layout_marginRight="2dp" android:layout_marginEnd="2dp" android:scaleType="fitXY" - app:srcCompat="@drawable/ic_fast_forward"/> + android:src="@drawable/ic_widget_fast_forward" /> <ImageButton android:id="@+id/butSkip" @@ -132,9 +133,14 @@ android:layout_marginRight="2dp" android:layout_marginEnd="2dp" android:scaleType="fitXY" - app:srcCompat="@drawable/ic_skip_24dp"/> + android:src="@drawable/ic_widget_skip" /> + </LinearLayout> + </LinearLayout> + </LinearLayout> + </RelativeLayout> -</FrameLayout>
\ No newline at end of file + +</FrameLayout> diff --git a/ui/png-icons/src/main/res/drawable/ic_widget_fast_forward.xml b/ui/png-icons/src/main/res/drawable/ic_widget_fast_forward.xml new file mode 100644 index 000000000..1511d5150 --- /dev/null +++ b/ui/png-icons/src/main/res/drawable/ic_widget_fast_forward.xml @@ -0,0 +1,7 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + <path android:fillColor="#ffffff" android:pathData="M4,18l8.5,-6L4,6v12zM13,6v12l8.5,-6L13,6z"/> +</vector> diff --git a/ui/png-icons/src/main/res/drawable/ic_widget_fast_rewind.xml b/ui/png-icons/src/main/res/drawable/ic_widget_fast_rewind.xml new file mode 100644 index 000000000..36ab723e3 --- /dev/null +++ b/ui/png-icons/src/main/res/drawable/ic_widget_fast_rewind.xml @@ -0,0 +1,7 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + <path android:fillColor="#ffffff" android:pathData="M11,18L11,6l-8.5,6 8.5,6zM11.5,12l8.5,6L20,6l-8.5,6z"/> +</vector> diff --git a/ui/png-icons/src/main/res/drawable/ic_widget_pause.xml b/ui/png-icons/src/main/res/drawable/ic_widget_pause.xml new file mode 100644 index 000000000..41c516b55 --- /dev/null +++ b/ui/png-icons/src/main/res/drawable/ic_widget_pause.xml @@ -0,0 +1,7 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + <path android:fillColor="#ffffff" android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/> +</vector> diff --git a/ui/png-icons/src/main/res/drawable/ic_widget_play.xml b/ui/png-icons/src/main/res/drawable/ic_widget_play.xml new file mode 100644 index 000000000..61ad92bcd --- /dev/null +++ b/ui/png-icons/src/main/res/drawable/ic_widget_play.xml @@ -0,0 +1,7 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + <path android:fillColor="#ffffff" android:pathData="M8,5v14l11,-7z"/> +</vector> diff --git a/ui/png-icons/src/main/res/drawable/ic_widget_skip.xml b/ui/png-icons/src/main/res/drawable/ic_widget_skip.xml new file mode 100644 index 000000000..664c96e49 --- /dev/null +++ b/ui/png-icons/src/main/res/drawable/ic_widget_skip.xml @@ -0,0 +1,7 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + <path android:fillColor="#ffffff" android:pathData="M6,18l8.5,-6L6,6v12zM16,6v12h2V6h-2z"/> +</vector> |