From 631dfee763ccef458acd0ffc3165522fb6e07492 Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 31 Mar 2020 21:42:49 +0200 Subject: [PATCH] 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_*` --- .../newpipe/fragments/MainFragment.java | 3 ++- .../newpipe/player/BackgroundPlayer.java | 9 ++++--- .../newpipe/player/PopupVideoPlayer.java | 23 +++++++++++------- .../res/drawable-hdpi/ic_close_white_24dp.png | Bin 0 -> 221 bytes .../drawable-hdpi/ic_replay_white_24dp.png | Bin 0 -> 675 bytes .../res/drawable-mdpi/ic_close_white_24dp.png | Bin 0 -> 175 bytes .../drawable-mdpi/ic_replay_white_24dp.png | Bin 0 -> 457 bytes .../drawable-xhdpi/ic_close_white_24dp.png | Bin 0 -> 257 bytes .../drawable-xhdpi/ic_replay_white_24dp.png | Bin 0 -> 908 bytes .../drawable-xxhdpi/ic_close_white_24dp.png | Bin 0 -> 347 bytes .../drawable-xxhdpi/ic_replay_white_24dp.png | Bin 0 -> 1390 bytes .../drawable-xxxhdpi/ic_close_white_24dp.png | Bin 0 -> 436 bytes .../drawable-xxxhdpi/ic_replay_white_24dp.png | Bin 0 -> 1885 bytes .../main/res/drawable/ic_close_white_24dp.xml | 5 ---- .../res/drawable/ic_replay_white_24dp.xml | 5 ---- ...xml => player_background_notification.xml} | 7 +++--- ...ayer_background_notification_expanded.xml} | 6 ++--- .../res/layout/player_popup_notification.xml | 7 +++--- 18 files changed, 32 insertions(+), 33 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_close_white_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_replay_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_close_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_replay_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_close_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_replay_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_close_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_replay_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_close_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_replay_white_24dp.png delete mode 100644 app/src/main/res/drawable/ic_close_white_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_replay_white_24dp.xml rename app/src/main/res/layout/{player_notification.xml => player_background_notification.xml} (95%) rename app/src/main/res/layout/{player_notification_expanded.xml => player_background_notification_expanded.xml} (97%) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java index 8cd1a3a16..709dac368 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java @@ -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); diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java index c06ef87f3..943d685b1 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java @@ -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 diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 93e31f831..87b8f282e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -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); } diff --git a/app/src/main/res/drawable-hdpi/ic_close_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_close_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..ceb1a1eebf2b2cc9a008f42010e144f4dab968de GIT binary patch literal 221 zcmV<303!d1P)og+*{ z>6z1@lfD*AYSPav7i^4O#T$_9m82|5VvpF*wP4OP zM$UZi@^>7mIp;Yu=T~<=&tBi0Ip_J;@t6l6eCkO56W1~dg3&=h1q zQ;-2oK?XDh8PF7DKvR$bO+kjAeDJ~pr|dFMzEwenMqRT?w%I|3a4PK3rz1$XY>?9M z$o%dYv=53msmx64U;8dHjIzKUk9_ChB>7>S;1G`>C)ufEh%>(Om`-|fb*SR^#z4}` zk1=8_ANv5(l+5L85*Xb37G?llB;BT5>A(ui94pbtcshM*TjCYGR_ z-6MNIjB5B%pCT4Cy!N|@y;y<{>^_Y1h{sr_j%UPd_@F#~6P7u_$u$?{J9LdWv<^B( zTt-`dtRg&yta3*15X;emvQ!XfRzVjCmrT?J+75nB>W0d9%nhW=(93#VAeC5$p_bT;=ksFy7&G{R+*d}}W7vaE1LouAaX zWSLB>FM)fQW1AE1DN&2B5kK^|J))MUC zlz7ydwCsb8xn}W?^r?}5wtsjdmvX{3=JbT!J9sKPrYmk={m|7^>A|Z*7j^D$`>}ry Zqi^Z9GQN4ct^!@a;OXk;vd$@?2>?I&LQeny literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_replay_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_replay_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..3b41913257dbe14e552f8203ba4612c9e49fa7a7 GIT binary patch literal 457 zcmV;)0XF`LP)FTt0oJ-PWqJo#>PDsS z`vtg-Yj!6pz zOA5m<3jYBNi%A&<@ZO?$P9};P4Y5CjG5$M&YXI45J{s}~# zf|&?x1_gn4B7+hS@X!l}&!voFhmZP^sujifL@~PKMMM~{6xH}^g$q7WOzwCQ5vHTU z6`v~H@rlA8e;CUh_(b84zg=+ih`wG<)HiJjzSlQx5#CnjMR;A)R^jtaTa9;7rSy)7O%~`cm?ZjXImW?6TYRT<;U^@VKiSj`soFk00000NkvXX Hu0mjfhD&W| literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_replay_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_replay_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..1573fb111b535e5e0df9371ff7f804ce2c40a0fa GIT binary patch literal 908 zcmV;719SX|P)7!(!0)U7tJ0c*i|=W=`GD{Rhrh*S+VSbLJ}_yb|Y} z2=nyPP+9@g9^_WikSR{kYsy-hy zE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j;V3?^)IpJQ zC~$)oVryJ;_A*F;awzhBRG;YTz@uDdxXb~P?psnaT;V0<;<@!m_9(Wo#9CP45&fK^ zm0dKDWCIB{)4(oTIZZ#0Sz#>{I2`q70$a!<#VdblmKEeqBTtav5BJ6{FUU`l0m9~* z`?oM!L%nU}35z-RnM+)dA!%+A1~=V*R#Jl8+0QtYYudtsG%831sUQ`k wf>e+SQb8(6qk>eB3Q|ETNCl}N6{IobUk;_uiK)$-$N&HU07*qoM6N<$g8NE^b^rhX literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_close_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_close_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..39641921925f090e33df2767a4ee5e6d5911194f GIT binary patch literal 436 zcmV;l0ZaagP)32ETvhYyB39D^lU%DgQgv&#U%8l^-CA%qY@2qA=!B5=cm zUgehujQG*l{{`@rPr!f|fEk^>KI9WteE@ilV6HEl&_rJ@p_zU*;T}RirIc{5NocNLm*7JGdV(AM zYYDFOvk5~8{Z*t_>U=!XvoehUSEh=adIga45oe)B9kGgT}7UT3Cirmr(oHPv^YQ1-p=Hlh5u;xggf zX{&yw+El-OrrKQJRl@b7x{HLmNkj95`a#LLnW{Veb2C+!`ppt#r)=g4@?c8RY{yJj~W@W|h^mU4q`i)2y~Rw@J`jIh$1%|In!~{Tb{nMqaxlgb+dq eA%qY@zJ@mriVM?qfwL0;0000G0000LhNkl?*|(>Q-}x=BZLQ4&YpE&mJ&MS+o(x;tb+l&fx65xW;&^oP6*;;qZ`277j0&B;g2y13QyVxcB2x=EDkM`q92JwP7LF>&R0l^@ zWU7IqT37j=K`wEM_jsFaJi{v5DanN4NXjtpvz;}}lo=0>dN|9gbkZzyEgbbU#4aA8 zQRXK&((omlnJeIN0diU~(n^z$bb4~{H3$n7c`99eROtxQ(2;K-J9 ztWdGw$ePz^QIX)tno}%Rk>JRh5uQ|$;K-g=Xi#zB$etcrRU9~~)5H{J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5Uj4{R-V~jDz7-NhvCN=*D X>#M$jzV5xv00000NkvXXu0mjfXY*@a literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/ic_close_white_24dp.xml b/app/src/main/res/drawable/ic_close_white_24dp.xml deleted file mode 100644 index 0c8775c4e..000000000 --- a/app/src/main/res/drawable/ic_close_white_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_replay_white_24dp.xml b/app/src/main/res/drawable/ic_replay_white_24dp.xml deleted file mode 100644 index 061877e0a..000000000 --- a/app/src/main/res/drawable/ic_replay_white_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/layout/player_notification.xml b/app/src/main/res/layout/player_background_notification.xml similarity index 95% rename from app/src/main/res/layout/player_notification.xml rename to app/src/main/res/layout/player_background_notification.xml index d356aa774..e04d72f7d 100644 --- a/app/src/main/res/layout/player_notification.xml +++ b/app/src/main/res/layout/player_background_notification.xml @@ -59,7 +59,7 @@ android:focusable="true" android:padding="5dp" android:scaleType="fitCenter" - app:srcCompat="@drawable/ic_repeat_white_24dp" + android:src="@drawable/exo_controls_repeat_all" tools:ignore="ContentDescription"/> diff --git a/app/src/main/res/layout/player_notification_expanded.xml b/app/src/main/res/layout/player_background_notification_expanded.xml similarity index 97% rename from app/src/main/res/layout/player_notification_expanded.xml rename to app/src/main/res/layout/player_background_notification_expanded.xml index 34e9ff726..e5a9b632b 100644 --- a/app/src/main/res/layout/player_notification_expanded.xml +++ b/app/src/main/res/layout/player_background_notification_expanded.xml @@ -29,7 +29,7 @@ android:focusable="true" android:padding="8dp" android:scaleType="fitCenter" - app:srcCompat="@drawable/ic_close_white_24dp" + android:src="@drawable/ic_close_white_24dp" tools:ignore="ContentDescription,RtlHardcoded"/> @@ -114,7 +114,7 @@ android:clickable="true" android:focusable="true" android:scaleType="fitXY" - app:srcCompat="@drawable/ic_repeat_white_24dp" + android:src="@drawable/exo_controls_repeat_all" tools:ignore="ContentDescription"/> \ No newline at end of file