Readd ic_close and ic_replay PNGs: needed in notifications

The other icons used in notifications are taken from exoplayer's ones: `@drawable/exo_controls_*`
This commit is contained in:
Stypox 2020-03-31 21:42:49 +02:00
parent d7f610113e
commit 631dfee763
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
18 changed files with 32 additions and 33 deletions

View file

@ -92,7 +92,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
tabLayout = rootView.findViewById(R.id.main_tab_layout); tabLayout = rootView.findViewById(R.id.main_tab_layout);
viewPager = rootView.findViewById(R.id.pager); viewPager = rootView.findViewById(R.id.pager);
tabLayout.setTabIconTint(ColorStateList.valueOf(ThemeHelper.resolveColorFromAttr(requireContext(), R.attr.colorAccent))); tabLayout.setTabIconTint(ColorStateList.valueOf(
ThemeHelper.resolveColorFromAttr(requireContext(), R.attr.colorAccent)));
tabLayout.setupWithViewPager(viewPager); tabLayout.setupWithViewPager(viewPager);
tabLayout.addOnTabSelectedListener(this); tabLayout.addOnTabSelectedListener(this);

View file

@ -201,9 +201,10 @@ public final class BackgroundPlayer extends Service {
} }
private NotificationCompat.Builder createNotification() { private NotificationCompat.Builder createNotification() {
notRemoteView = new RemoteViews(BuildConfig.APPLICATION_ID, R.layout.player_notification); notRemoteView = new RemoteViews(BuildConfig.APPLICATION_ID,
R.layout.player_background_notification);
bigNotRemoteView = new RemoteViews(BuildConfig.APPLICATION_ID, bigNotRemoteView = new RemoteViews(BuildConfig.APPLICATION_ID,
R.layout.player_notification_expanded); R.layout.player_background_notification_expanded);
setupNotification(notRemoteView); setupNotification(notRemoteView);
setupNotification(bigNotRemoteView); setupNotification(bigNotRemoteView);
@ -655,7 +656,7 @@ public final class BackgroundPlayer extends Service {
super.onPlaying(); super.onPlaying();
resetNotification(); resetNotification();
updateNotificationThumbnail(); updateNotificationThumbnail();
updateNotification(R.drawable.ic_pause_white_24dp); updateNotification(R.drawable.exo_controls_pause);
} }
@Override @Override
@ -663,7 +664,7 @@ public final class BackgroundPlayer extends Service {
super.onPaused(); super.onPaused();
resetNotification(); resetNotification();
updateNotificationThumbnail(); updateNotificationThumbnail();
updateNotification(R.drawable.ic_play_arrow_white_24dp); updateNotification(R.drawable.exo_controls_play);
} }
@Override @Override

View file

@ -53,6 +53,7 @@ import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
@ -892,7 +893,7 @@ public final class PopupVideoPlayer extends Service {
public void onBlocked() { public void onBlocked() {
super.onBlocked(); super.onBlocked();
resetNotification(); resetNotification();
updateNotification(R.drawable.ic_play_arrow_white_24dp); updateNotification(R.drawable.exo_controls_play);
} }
@Override @Override
@ -902,9 +903,10 @@ public final class PopupVideoPlayer extends Service {
updateWindowFlags(ONGOING_PLAYBACK_WINDOW_FLAGS); updateWindowFlags(ONGOING_PLAYBACK_WINDOW_FLAGS);
resetNotification(); resetNotification();
updateNotification(R.drawable.ic_pause_white_24dp); updateNotification(R.drawable.exo_controls_pause);
videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white_24dp); videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(),
R.drawable.ic_pause_white_24dp));
hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME);
startForeground(NOTIFICATION_ID, notBuilder.build()); startForeground(NOTIFICATION_ID, notBuilder.build());
@ -914,7 +916,7 @@ public final class PopupVideoPlayer extends Service {
public void onBuffering() { public void onBuffering() {
super.onBuffering(); super.onBuffering();
resetNotification(); resetNotification();
updateNotification(R.drawable.ic_play_arrow_white_24dp); updateNotification(R.drawable.exo_controls_play);
} }
@Override @Override
@ -924,8 +926,9 @@ public final class PopupVideoPlayer extends Service {
updateWindowFlags(IDLE_WINDOW_FLAGS); updateWindowFlags(IDLE_WINDOW_FLAGS);
resetNotification(); resetNotification();
updateNotification(R.drawable.ic_play_arrow_white_24dp); updateNotification(R.drawable.exo_controls_play);
videoPlayPause.setBackgroundResource(R.drawable.ic_play_arrow_white_24dp); videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(),
R.drawable.ic_play_arrow_white_24dp));
stopForeground(false); stopForeground(false);
} }
@ -934,9 +937,10 @@ public final class PopupVideoPlayer extends Service {
public void onPausedSeek() { public void onPausedSeek() {
super.onPausedSeek(); super.onPausedSeek();
resetNotification(); resetNotification();
updateNotification(R.drawable.ic_play_arrow_white_24dp); updateNotification(R.drawable.exo_controls_play);
videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white_24dp); videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(),
R.drawable.ic_pause_white_24dp));
} }
@Override @Override
@ -947,7 +951,8 @@ public final class PopupVideoPlayer extends Service {
resetNotification(); resetNotification();
updateNotification(R.drawable.ic_replay_white_24dp); updateNotification(R.drawable.ic_replay_white_24dp);
videoPlayPause.setBackgroundResource(R.drawable.ic_replay_white_24dp); videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(),
R.drawable.ic_replay_white_24dp));
stopForeground(false); stopForeground(false);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -1,5 +0,0 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" 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

@ -1,5 +0,0 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" 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

@ -59,7 +59,7 @@
android:focusable="true" android:focusable="true"
android:padding="5dp" android:padding="5dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_repeat_white_24dp" android:src="@drawable/exo_controls_repeat_all"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>
<ImageButton <ImageButton
@ -81,7 +81,8 @@
android:background="#00000000" android:background="#00000000"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
app:srcCompat="@drawable/ic_pause_white_24dp" android:scaleType="fitCenter"
android:src="@drawable/exo_controls_pause"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>
<ImageButton <ImageButton
@ -106,7 +107,7 @@
android:focusable="true" android:focusable="true"
android:padding="5dp" android:padding="5dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_close_white_24dp" android:src="@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"
app:srcCompat="@drawable/ic_close_white_24dp" android:src="@drawable/ic_close_white_24dp"
tools:ignore="ContentDescription,RtlHardcoded"/> tools:ignore="ContentDescription,RtlHardcoded"/>
@ -114,7 +114,7 @@
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:scaleType="fitXY" android:scaleType="fitXY"
app:srcCompat="@drawable/ic_repeat_white_24dp" android:src="@drawable/exo_controls_repeat_all"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>
<ImageButton <ImageButton
@ -144,7 +144,7 @@
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_pause_white_24dp" android:src="@drawable/exo_controls_pause"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>
<ImageButton <ImageButton

View file

@ -59,7 +59,7 @@
android:focusable="true" android:focusable="true"
android:padding="5dp" android:padding="5dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_repeat_white_24dp" android:src="@drawable/exo_controls_repeat_all"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>
<ImageButton <ImageButton
@ -69,7 +69,8 @@
android:background="#00000000" android:background="#00000000"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
app:srcCompat="@drawable/ic_pause_white_24dp" android:scaleType="fitCenter"
android:src="@drawable/exo_controls_pause"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>
<ImageButton <ImageButton
@ -82,6 +83,6 @@
android:focusable="true" android:focusable="true"
android:padding="5dp" android:padding="5dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_close_white_24dp" android:src="@drawable/ic_close_white_24dp"
tools:ignore="ContentDescription,RtlHardcoded"/> tools:ignore="ContentDescription,RtlHardcoded"/>
</LinearLayout> </LinearLayout>