Merge pull request #3857 from ByteHamster/play-button-resolution

Replaced playback images with vector version
This commit is contained in:
H. Lehmann 2020-02-12 23:16:31 +01:00 committed by GitHub
commit 93a4e8aeea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 126 additions and 52 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fragmentLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/external_player_height"
@ -44,7 +44,9 @@
android:layout_centerVertical="true"
android:contentDescription="@string/pause_label"
android:background="?attr/selectableItemBackground"
android:src="?attr/av_play_big"
app:srcCompat="?attr/av_play"
android:scaleType="fitCenter"
android:padding="8dp"
tools:src="@drawable/ic_play_arrow_white_36dp"/>
<TextView

View File

@ -121,9 +121,9 @@
android:layout_centerHorizontal="true"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/pause_label"
android:src="?attr/av_play"
app:srcCompat="?attr/av_play"
android:scaleType="fitCenter"
tools:src="@drawable/ic_play_arrow_white_24dp"
tools:src="@drawable/ic_av_play_white_24dp"
tools:background="@android:color/holo_green_dark" />
<ImageButton
@ -136,9 +136,9 @@
android:layout_marginStart="16dp"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/rewind_label"
android:src="?attr/av_rew_big"
app:srcCompat="?attr/av_rewind"
android:scaleType="fitCenter"
tools:src="@drawable/ic_fast_rewind_white_36dp"
tools:src="@drawable/ic_av_fast_rewind_white_48dp"
tools:background="@android:color/holo_blue_dark" />
<TextView
@ -165,7 +165,7 @@
android:layout_toStartOf="@id/butRev"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/set_playback_speed_label"
android:src="?attr/av_speed"
app:srcCompat="?attr/av_speed"
android:scaleType="fitCenter"
tools:src="@drawable/ic_playback_speed_white_48dp"
tools:visibility="gone"
@ -212,9 +212,9 @@
android:layout_marginEnd="16dp"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/fast_forward_label"
android:src="?attr/av_ff_big"
app:srcCompat="?attr/av_fast_forward"
android:scaleType="fitCenter"
tools:src="@drawable/ic_fast_forward_white_36dp"
tools:src="@drawable/ic_av_fast_forward_white_48dp"
tools:background="@android:color/holo_blue_dark" />
<TextView
@ -241,9 +241,9 @@
android:layout_toEndOf="@id/butFF"
android:background="?attr/selectableItemBackground"
android:scaleType="fitCenter"
android:src="?attr/av_skip_big"
app:srcCompat="?attr/av_skip"
android:contentDescription="@string/skip_episode_label"
tools:src="@drawable/ic_skip_white_36dp"
tools:src="@drawable/ic_av_skip_white_48dp"
tools:background="@android:color/holo_green_dark" />
</RelativeLayout>

View File

@ -19,7 +19,7 @@
android:key="prefScreenPlayback"
android:title="@string/playback_pref"
android:summary="@string/playback_pref_sum"
android:icon="?attr/av_play" />
android:icon="?attr/ic_settings_playback" />
<Preference
android:key="prefScreenNetwork"

View File

@ -8,7 +8,6 @@ import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import androidx.annotation.NonNull;
@ -158,10 +157,10 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
}
if (status == PlayerStatus.PLAYING) {
views.setImageViewResource(R.id.butPlay, R.drawable.ic_pause_white_24dp);
views.setImageViewResource(R.id.butPlay, R.drawable.ic_av_pause_white_48dp);
views.setContentDescription(R.id.butPlay, getString(R.string.pause_label));
} else {
views.setImageViewResource(R.id.butPlay, R.drawable.ic_play_arrow_white_24dp);
views.setImageViewResource(R.id.butPlay, R.drawable.ic_av_play_white_48dp);
views.setContentDescription(R.id.butPlay, getString(R.string.play_label));
}
views.setOnClickPendingIntent(R.id.butPlay, createMediaButtonIntent());
@ -177,7 +176,7 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
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.setImageViewResource(R.id.butPlay, R.drawable.ic_play_arrow_white_24dp);
views.setImageViewResource(R.id.butPlay, R.drawable.ic_av_play_white_48dp);
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {

View File

@ -21,6 +21,7 @@ import android.widget.ImageButton;
import android.widget.SeekBar;
import android.widget.TextView;
import de.danoeh.antennapod.core.util.ThemeUtils;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import de.danoeh.antennapod.core.R;
@ -397,12 +398,10 @@ public class PlaybackController {
final CharSequence playText = activity.getString(R.string.play_label);
final CharSequence pauseText = activity.getString(R.string.pause_label);
if (PlaybackService.getCurrentMediaType() == MediaType.AUDIO ||
PlaybackService.isCasting()) {
TypedArray res = activity.obtainStyledAttributes(new int[]{
R.attr.av_play_big, R.attr.av_pause_big});
playResource = res.getResourceId(0, R.drawable.ic_play_arrow_grey600_36dp);
pauseResource = res.getResourceId(1, R.drawable.ic_pause_grey600_36dp);
if (PlaybackService.getCurrentMediaType() == MediaType.AUDIO || PlaybackService.isCasting()) {
TypedArray res = activity.obtainStyledAttributes(new int[]{ R.attr.av_play, R.attr.av_pause});
playResource = res.getResourceId(0, R.drawable.ic_av_play_dark_48dp);
pauseResource = res.getResourceId(1, R.drawable.ic_av_pause_dark_48dp);
res.recycle();
} else {
playResource = R.drawable.ic_av_play_white_80dp;
@ -779,11 +778,8 @@ public class PlaybackController {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(media -> {
if (media.getMediaType() == MediaType.AUDIO) {
TypedArray res = activity.obtainStyledAttributes(new int[]{
de.danoeh.antennapod.core.R.attr.av_play_big});
getPlayButton().setImageResource(
res.getResourceId(0, de.danoeh.antennapod.core.R.drawable.ic_play_arrow_grey600_36dp));
res.recycle();
ThemeUtils.getDrawableFromAttr(activity, de.danoeh.antennapod.core.R.attr.av_play));
} else {
getPlayButton().setImageResource(R.drawable.ic_av_play_white_80dp);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 B

View File

@ -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="#FF757575" android:pathData="M4,18l8.5,-6L4,6v12zM13,6v12l8.5,-6L13,6z"/>
</vector>

View File

@ -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="#FFFFFFFF" android:pathData="M4,18l8.5,-6L4,6v12zM13,6v12l8.5,-6L13,6z"/>
</vector>

View File

@ -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="#FF757575" android:pathData="M11,18L11,6l-8.5,6 8.5,6zM11.5,12l8.5,6L20,6l-8.5,6z"/>
</vector>

View File

@ -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="#FFFFFFFF" android:pathData="M11,18L11,6l-8.5,6 8.5,6zM11.5,12l8.5,6L20,6l-8.5,6z"/>
</vector>

View File

@ -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="#FF757575" android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/>
</vector>

View File

@ -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="#FFFFFFFF" android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/>
</vector>

View File

@ -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="#FF757575" android:pathData="M8,5v14l11,-7z"/>
</vector>

View File

@ -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="#FF757575" android:pathData="M8,5v14l11,-7z"/>
</vector>

View File

@ -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="#FFFFFFFF" android:pathData="M8,5v14l11,-7z"/>
</vector>

View File

@ -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="#FFFFFFFF" android:pathData="M8,5v14l11,-7z"/>
</vector>

View File

@ -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="#FF757575" android:pathData="M6,18l8.5,-6L6,6v12zM16,6v12h2V6h-2z"/>
</vector>

View File

@ -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="#FFFFFFFF" android:pathData="M6,18l8.5,-6L6,6v12zM16,6v12h2V6h-2z"/>
</vector>

View File

@ -19,8 +19,10 @@
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_margin="12dp"
android:background="@android:color/transparent"
android:src="@drawable/ic_play_arrow_white_24dp" />
android:background="?android:attr/selectableItemBackground"
android:scaleType="fitCenter"
android:padding="8dp"
android:src="@drawable/ic_av_play_white_24dp" />
<LinearLayout
android:id="@+id/layout_left"

View File

@ -9,6 +9,7 @@
<attr name="av_fast_forward" format="reference"/>
<attr name="av_pause" format="reference"/>
<attr name="av_play" format="reference"/>
<attr name="av_skip" format="reference"/>
<attr name="av_speed" format="reference"/>
<attr name="av_rewind" format="reference"/>
<attr name="content_discard" format="reference"/>
@ -32,11 +33,7 @@
<attr name="dragview_float_background" format="reference"/>
<attr name="ic_new" format="reference"/>
<attr name="ic_history" format="reference"/>
<attr name="av_play_big" format="reference"/>
<attr name="av_pause_big" format="reference"/>
<attr name="av_ff_big" format="reference"/>
<attr name="av_rew_big" format="reference"/>
<attr name="av_skip_big" format="reference"/>
<attr name="ic_settings_playback" format="reference"/>
<attr name="ic_settings" format="reference"/>
<attr name="ic_lock_open" format="reference"/>
<attr name="ic_lock_closed" format="reference"/>

View File

@ -20,12 +20,13 @@
<item name="action_search">@drawable/ic_search_grey600_24dp</item>
<item name="action_stream">@drawable/ic_stream_grey600</item>
<item name="av_download">@drawable/ic_file_download_grey600_24dp</item>
<item name="av_fast_forward">@drawable/ic_fast_forward_grey600_24dp</item>
<item name="av_pause">@drawable/ic_pause_grey600_24dp</item>
<item name="av_play">@drawable/ic_play_arrow_grey600_24dp</item>
<item name="av_pause">@drawable/ic_av_pause_dark_48dp</item>
<item name="av_play">@drawable/ic_av_play_dark_48dp</item>
<item name="av_rewind">@drawable/ic_av_fast_rewind_dark_48dp</item>
<item name="av_fast_forward">@drawable/ic_av_fast_forward_dark_48dp</item>
<item name="av_skip">@drawable/ic_av_skip_dark_48dp</item>
<item name="av_speed">@drawable/ic_playback_speed_dark_48dp</item>
<item name="ic_settings_speed">@drawable/ic_playback_speed_dark_24dp</item>
<item name="av_rewind">@drawable/ic_fast_rewind_grey600_24dp</item>
<item name="content_discard">@drawable/ic_delete_grey600_24dp</item>
<item name="content_new">@drawable/ic_add_grey600_24dp</item>
<item name="content_remove_from_queue">@drawable/ic_remove_grey600</item>
@ -49,11 +50,7 @@
<item name="ic_new">@drawable/ic_new_releases_grey600_24dp</item>
<item name="ic_history">@drawable/ic_history_grey600_24dp</item>
<item name="ic_folder">@drawable/ic_folder_grey600_24dp</item>
<item name="av_play_big">@drawable/ic_play_arrow_grey600_36dp</item>
<item name="av_pause_big">@drawable/ic_pause_grey600_36dp</item>
<item name="av_ff_big">@drawable/ic_fast_forward_grey600_36dp</item>
<item name="av_rew_big">@drawable/ic_fast_rewind_grey600_36dp</item>
<item name="av_skip_big">@drawable/ic_skip_grey600_36dp</item>
<item name="ic_settings_playback">@drawable/ic_av_play_dark_24dp</item>
<item name="ic_fav">@drawable/ic_star_border_grey600_24dp</item>
<item name="ic_unfav">@drawable/ic_star_grey600_24dp</item>
<item name="ic_settings">@drawable/ic_settings_grey600_24dp</item>
@ -108,12 +105,13 @@
<item name="action_search">@drawable/ic_search_white_24dp</item>
<item name="action_stream">@drawable/ic_stream_white</item>
<item name="av_download">@drawable/ic_file_download_white_24dp</item>
<item name="av_fast_forward">@drawable/ic_fast_forward_white_24dp</item>
<item name="av_pause">@drawable/ic_pause_white_24dp</item>
<item name="av_play">@drawable/ic_play_arrow_white_24dp</item>
<item name="av_rewind">@drawable/ic_av_fast_rewind_white_48dp</item>
<item name="av_fast_forward">@drawable/ic_av_fast_forward_white_48dp</item>
<item name="av_pause">@drawable/ic_av_pause_white_48dp</item>
<item name="av_play">@drawable/ic_av_play_white_48dp</item>
<item name="av_skip">@drawable/ic_av_skip_white_48dp</item>
<item name="av_speed">@drawable/ic_playback_speed_white_48dp</item>
<item name="ic_settings_speed">@drawable/ic_playback_speed_white_24dp</item>
<item name="av_rewind">@drawable/ic_fast_rewind_white_24dp</item>
<item name="content_discard">@drawable/ic_delete_white_24dp</item>
<item name="content_new">@drawable/ic_add_white_24dp</item>
<item name="content_remove_from_queue">@drawable/ic_remove_white</item>
@ -137,11 +135,7 @@
<item name="ic_new">@drawable/ic_new_releases_white_24dp</item>
<item name="ic_history">@drawable/ic_history_white_24dp</item>
<item name="ic_folder">@drawable/ic_folder_white_24dp</item>
<item name="av_play_big">@drawable/ic_play_arrow_white_36dp</item>
<item name="av_pause_big">@drawable/ic_pause_white_36dp</item>
<item name="av_ff_big">@drawable/ic_fast_forward_white_36dp</item>
<item name="av_rew_big">@drawable/ic_fast_rewind_white_36dp</item>
<item name="av_skip_big">@drawable/ic_skip_white_36dp</item>
<item name="ic_settings_playback">@drawable/ic_av_play_white_24dp</item>
<item name="ic_fav">@drawable/ic_star_border_white_24dp</item>
<item name="ic_unfav">@drawable/ic_star_white_24dp</item>
<item name="ic_settings">@drawable/ic_settings_white_24dp</item>