mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-11-14 05:57:10 +00:00
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:
@@ -92,7 +92,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
|
||||
tabLayout = rootView.findViewById(R.id.main_tab_layout);
|
||||
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.addOnTabSelectedListener(this);
|
||||
|
||||
|
||||
@@ -201,9 +201,10 @@ public final class BackgroundPlayer extends Service {
|
||||
}
|
||||
|
||||
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,
|
||||
R.layout.player_notification_expanded);
|
||||
R.layout.player_background_notification_expanded);
|
||||
|
||||
setupNotification(notRemoteView);
|
||||
setupNotification(bigNotRemoteView);
|
||||
@@ -655,7 +656,7 @@ public final class BackgroundPlayer extends Service {
|
||||
super.onPlaying();
|
||||
resetNotification();
|
||||
updateNotificationThumbnail();
|
||||
updateNotification(R.drawable.ic_pause_white_24dp);
|
||||
updateNotification(R.drawable.exo_controls_pause);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -663,7 +664,7 @@ public final class BackgroundPlayer extends Service {
|
||||
super.onPaused();
|
||||
resetNotification();
|
||||
updateNotificationThumbnail();
|
||||
updateNotification(R.drawable.ic_play_arrow_white_24dp);
|
||||
updateNotification(R.drawable.exo_controls_play);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -53,6 +53,7 @@ import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import com.google.android.exoplayer2.C;
|
||||
@@ -892,7 +893,7 @@ public final class PopupVideoPlayer extends Service {
|
||||
public void onBlocked() {
|
||||
super.onBlocked();
|
||||
resetNotification();
|
||||
updateNotification(R.drawable.ic_play_arrow_white_24dp);
|
||||
updateNotification(R.drawable.exo_controls_play);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -902,9 +903,10 @@ public final class PopupVideoPlayer extends Service {
|
||||
updateWindowFlags(ONGOING_PLAYBACK_WINDOW_FLAGS);
|
||||
|
||||
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);
|
||||
|
||||
startForeground(NOTIFICATION_ID, notBuilder.build());
|
||||
@@ -914,7 +916,7 @@ public final class PopupVideoPlayer extends Service {
|
||||
public void onBuffering() {
|
||||
super.onBuffering();
|
||||
resetNotification();
|
||||
updateNotification(R.drawable.ic_play_arrow_white_24dp);
|
||||
updateNotification(R.drawable.exo_controls_play);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -924,8 +926,9 @@ public final class PopupVideoPlayer extends Service {
|
||||
updateWindowFlags(IDLE_WINDOW_FLAGS);
|
||||
|
||||
resetNotification();
|
||||
updateNotification(R.drawable.ic_play_arrow_white_24dp);
|
||||
videoPlayPause.setBackgroundResource(R.drawable.ic_play_arrow_white_24dp);
|
||||
updateNotification(R.drawable.exo_controls_play);
|
||||
videoPlayPause.setBackground(AppCompatResources.getDrawable(getApplicationContext(),
|
||||
R.drawable.ic_play_arrow_white_24dp));
|
||||
|
||||
stopForeground(false);
|
||||
}
|
||||
@@ -934,9 +937,10 @@ public final class PopupVideoPlayer extends Service {
|
||||
public void onPausedSeek() {
|
||||
super.onPausedSeek();
|
||||
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
|
||||
@@ -947,7 +951,8 @@ public final class PopupVideoPlayer extends Service {
|
||||
|
||||
resetNotification();
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user