Use vector drawables for close and replay

This commit is contained in:
wb9688 2020-05-14 17:05:09 +02:00
parent 4abf6b2f5c
commit 7d499ffba1
30 changed files with 55 additions and 38 deletions

View file

@ -356,7 +356,7 @@ public final class NotificationUtil {
} }
break; break;
case "close": case "close":
builder.addAction(R.drawable.ic_close_white_32dp, "Close", builder.addAction(R.drawable.ic_close_white_24dp, "Close",
PendingIntent.getBroadcast(context, NOTIFICATION_ID_BACKGROUND, PendingIntent.getBroadcast(context, NOTIFICATION_ID_BACKGROUND,
new Intent(BackgroundPlayer.ACTION_CLOSE), new Intent(BackgroundPlayer.ACTION_CLOSE),
PendingIntent.FLAG_UPDATE_CURRENT)); PendingIntent.FLAG_UPDATE_CURRENT));
@ -450,7 +450,7 @@ public final class NotificationUtil {
notificationBuilder.setSmallIcon(android.R.drawable.stat_sys_download); notificationBuilder.setSmallIcon(android.R.drawable.stat_sys_download);
} else if (basePlayerImpl.getCurrentState() == BasePlayer.STATE_COMPLETED) { } else if (basePlayerImpl.getCurrentState() == BasePlayer.STATE_COMPLETED) {
notificationBuilder.mActions.set(slotNumber, notificationBuilder.mActions.set(slotNumber,
new NotificationCompat.Action(R.drawable.ic_replay_white_32dp, new NotificationCompat.Action(R.drawable.ic_replay_white_24dp,
"Completed", PendingIntent.getBroadcast(context, "Completed", PendingIntent.getBroadcast(context,
NOTIFICATION_ID_BACKGROUND, NOTIFICATION_ID_BACKGROUND,
new Intent(BackgroundPlayer.ACTION_PLAY_PAUSE), new Intent(BackgroundPlayer.ACTION_PLAY_PAUSE),
@ -486,7 +486,7 @@ public final class NotificationUtil {
PendingIntent.FLAG_UPDATE_CURRENT))); PendingIntent.FLAG_UPDATE_CURRENT)));
} else if (basePlayerImpl.getCurrentState() == BasePlayer.STATE_COMPLETED) { } else if (basePlayerImpl.getCurrentState() == BasePlayer.STATE_COMPLETED) {
notificationBuilder.mActions.set(slotNumber, notificationBuilder.mActions.set(slotNumber,
new NotificationCompat.Action(R.drawable.ic_replay_white_32dp, new NotificationCompat.Action(R.drawable.ic_replay_white_24dp,
"Completed", PendingIntent.getBroadcast(context, "Completed", PendingIntent.getBroadcast(context,
NOTIFICATION_ID_BACKGROUND, NOTIFICATION_ID_BACKGROUND,
new Intent(BackgroundPlayer.ACTION_PLAY_PAUSE), new Intent(BackgroundPlayer.ACTION_PLAY_PAUSE),
@ -611,7 +611,7 @@ public final class NotificationUtil {
break; break;
case "close": case "close":
notificationBuilder.mActions.set(slotNumber, notificationBuilder.mActions.set(slotNumber,
new NotificationCompat.Action(R.drawable.ic_close_white_32dp, "Close", new NotificationCompat.Action(R.drawable.ic_close_white_24dp, "Close",
PendingIntent.getBroadcast(context, NOTIFICATION_ID_BACKGROUND, PendingIntent.getBroadcast(context, NOTIFICATION_ID_BACKGROUND,
new Intent(BackgroundPlayer.ACTION_CLOSE), new Intent(BackgroundPlayer.ACTION_CLOSE),
PendingIntent.FLAG_UPDATE_CURRENT))); PendingIntent.FLAG_UPDATE_CURRENT)));
@ -840,7 +840,7 @@ public final class NotificationUtil {
} }
break; break;
case "close": case "close":
builder.addAction(R.drawable.ic_close_white_32dp, "Close", builder.addAction(R.drawable.ic_close_white_24dp, "Close",
PendingIntent.getBroadcast(context, NOTIFICATION_ID_POPUP, PendingIntent.getBroadcast(context, NOTIFICATION_ID_POPUP,
new Intent(PopupVideoPlayer.ACTION_CLOSE), new Intent(PopupVideoPlayer.ACTION_CLOSE),
PendingIntent.FLAG_UPDATE_CURRENT)); PendingIntent.FLAG_UPDATE_CURRENT));
@ -927,7 +927,7 @@ public final class NotificationUtil {
notificationBuilder.setSmallIcon(android.R.drawable.stat_sys_download); notificationBuilder.setSmallIcon(android.R.drawable.stat_sys_download);
} else if (playerImpl.getCurrentState() == BasePlayer.STATE_COMPLETED) { } else if (playerImpl.getCurrentState() == BasePlayer.STATE_COMPLETED) {
notificationBuilder.mActions.set(slotNumber, notificationBuilder.mActions.set(slotNumber,
new NotificationCompat.Action(R.drawable.ic_replay_white_32dp, new NotificationCompat.Action(R.drawable.ic_replay_white_24dp,
"Completed", PendingIntent.getBroadcast(context, "Completed", PendingIntent.getBroadcast(context,
NOTIFICATION_ID_POPUP, NOTIFICATION_ID_POPUP,
new Intent(PopupVideoPlayer.ACTION_PLAY_PAUSE), new Intent(PopupVideoPlayer.ACTION_PLAY_PAUSE),
@ -963,7 +963,7 @@ public final class NotificationUtil {
PendingIntent.FLAG_UPDATE_CURRENT))); PendingIntent.FLAG_UPDATE_CURRENT)));
} else if (playerImpl.getCurrentState() == BasePlayer.STATE_COMPLETED) { } else if (playerImpl.getCurrentState() == BasePlayer.STATE_COMPLETED) {
notificationBuilder.mActions.set(slotNumber, notificationBuilder.mActions.set(slotNumber,
new NotificationCompat.Action(R.drawable.ic_replay_white_32dp, new NotificationCompat.Action(R.drawable.ic_replay_white_24dp,
"Completed", PendingIntent.getBroadcast(context, "Completed", PendingIntent.getBroadcast(context,
NOTIFICATION_ID_POPUP, NOTIFICATION_ID_POPUP,
new Intent(PopupVideoPlayer.ACTION_PLAY_PAUSE), new Intent(PopupVideoPlayer.ACTION_PLAY_PAUSE),
@ -1090,7 +1090,7 @@ public final class NotificationUtil {
break; break;
case "close": case "close":
notificationBuilder.mActions.set(slotNumber, notificationBuilder.mActions.set(slotNumber,
new NotificationCompat.Action(R.drawable.ic_close_white_32dp, "Close", new NotificationCompat.Action(R.drawable.ic_close_white_24dp, "Close",
PendingIntent.getBroadcast(context, NOTIFICATION_ID_POPUP, PendingIntent.getBroadcast(context, NOTIFICATION_ID_POPUP,
new Intent(PopupVideoPlayer.ACTION_CLOSE), new Intent(PopupVideoPlayer.ACTION_CLOSE),
PendingIntent.FLAG_UPDATE_CURRENT))); PendingIntent.FLAG_UPDATE_CURRENT)));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,5V1L7,6l5,5V7c3.31,0 6,2.69 6,6s-2.69,6 -6,6 -6,-2.69 -6,-6H4c0,4.42 3.58,8 8,8s8,-3.58 8,-8 -3.58,-8 -8,-8z"/>
</vector>

View file

@ -65,18 +65,18 @@
android:id="@+id/playQueueClose" android:id="@+id/playQueueClose"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginRight="40dp" android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="40dp" android:layout_marginEnd="40dp"
android:padding="10dp" android:layout_marginRight="40dp"
android:background="?android:selectableItemBackground"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:padding="10dp"
android:scaleType="fitXY" android:scaleType="fitXY"
android:tint="?attr/colorAccent" android:tint="?attr/colorAccent"
app:srcCompat="@drawable/ic_close_white_24dp" app:srcCompat="@drawable/ic_close_white_24dp"
android:background="?android:selectableItemBackground"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>
<ImageButton <ImageButton

View file

@ -63,18 +63,18 @@
android:id="@+id/playQueueClose" android:id="@+id/playQueueClose"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginRight="40dp" android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="40dp" android:layout_marginEnd="40dp"
android:padding="10dp" android:layout_marginRight="40dp"
android:background="?android:selectableItemBackground"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:padding="10dp"
android:scaleType="fitXY" android:scaleType="fitXY"
android:tint="?attr/colorAccent" android:tint="?attr/colorAccent"
app:srcCompat="@drawable/ic_close_white_24dp" app:srcCompat="@drawable/ic_close_white_24dp"
android:background="?android:selectableItemBackground"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageButton <ImageButton

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="64dp" android:layout_height="64dp"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout <LinearLayout
android:id="@+id/notificationContent" android:id="@+id/notificationContent"
@ -107,7 +107,7 @@
android:focusable="true" android:focusable="true"
android:padding="5dp" android:padding="5dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@drawable/ic_close_white_24dp" app:srcCompat="@drawable/ic_close_white_24dp"
tools:ignore="ContentDescription,RtlHardcoded" /> tools:ignore="ContentDescription,RtlHardcoded" />
</LinearLayout> </LinearLayout>

View file

@ -29,7 +29,7 @@
android:focusable="true" android:focusable="true"
android:padding="8dp" android:padding="8dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@drawable/ic_close_white_24dp" app:srcCompat="@drawable/ic_close_white_24dp"
tools:ignore="ContentDescription,RtlHardcoded" /> tools:ignore="ContentDescription,RtlHardcoded" />

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -11,8 +10,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal" android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="24dp" android:layout_marginBottom="24dp"
app:srcCompat="@drawable/ic_close_white_24dp"
app:backgroundTint="@color/light_youtube_primary_color" app:backgroundTint="@color/light_youtube_primary_color"
app:borderWidth="0dp" app:borderWidth="0dp"
app:fabSize="normal"/> app:fabSize="normal"
app:srcCompat="@drawable/ic_close_white_24dp" />
</FrameLayout> </FrameLayout>

View file

@ -83,6 +83,6 @@
android:focusable="true" android:focusable="true"
android:padding="5dp" android:padding="5dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@drawable/ic_close_white_24dp" app:srcCompat="@drawable/ic_close_white_24dp"
tools:ignore="ContentDescription,RtlHardcoded" /> tools:ignore="ContentDescription,RtlHardcoded" />
</LinearLayout> </LinearLayout>