From b0948cf9fc40c4fb8ea7b7445ad8b7bd9e422f3b Mon Sep 17 00:00:00 2001 From: John Zhen Mo Date: Mon, 30 Oct 2017 20:58:02 -0700 Subject: [PATCH] -Modified selected play queue item to highlight entire item instead of text. -Added selected item bullet. -Modified play queue panel darker on main video player. -Fixed color issue on play queue panel on light-themed main video player. -Fixed hold-to-enqueue tooltip flashing when clicked on earlier sdk versions. -Fixed queue item removal causing metadata for currently playing to refresh. --- .../fragments/detail/VideoDetailFragment.java | 9 ++++-- .../player/playback/MediaSourceManager.java | 3 +- .../newpipe/playlist/PlayQueueAdapter.java | 9 ++++-- .../newpipe/playlist/PlayQueueItemHolder.java | 3 +- app/src/main/res/color/dark_selector.xml | 5 ---- app/src/main/res/color/light_selector.xml | 5 ---- .../ic_fiber_manual_record_black_24dp.png | Bin 0 -> 256 bytes .../ic_fiber_manual_record_white_24dp.png | Bin 0 -> 252 bytes .../ic_fiber_manual_record_black_24dp.png | Bin 0 -> 184 bytes .../ic_fiber_manual_record_white_24dp.png | Bin 0 -> 181 bytes .../ic_fiber_manual_record_black_24dp.png | Bin 0 -> 335 bytes .../ic_fiber_manual_record_white_24dp.png | Bin 0 -> 328 bytes .../ic_fiber_manual_record_black_24dp.png | Bin 0 -> 468 bytes .../ic_fiber_manual_record_white_24dp.png | Bin 0 -> 461 bytes .../ic_fiber_manual_record_black_24dp.png | Bin 0 -> 618 bytes .../ic_fiber_manual_record_white_24dp.png | Bin 0 -> 614 bytes app/src/main/res/drawable/dark_selector.xml | 5 ++++ app/src/main/res/drawable/light_selector.xml | 5 ++++ .../main/res/layout/activity_main_player.xml | 5 +++- app/src/main/res/layout/play_queue_item.xml | 28 +++++++++++++----- app/src/main/res/values/attrs.xml | 4 ++- app/src/main/res/values/colors.xml | 5 ++++ app/src/main/res/values/styles.xml | 8 +++-- 23 files changed, 65 insertions(+), 29 deletions(-) delete mode 100644 app/src/main/res/color/dark_selector.xml delete mode 100644 app/src/main/res/color/light_selector.xml create mode 100644 app/src/main/res/drawable-hdpi/ic_fiber_manual_record_black_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_fiber_manual_record_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_fiber_manual_record_black_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_fiber_manual_record_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_fiber_manual_record_black_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_fiber_manual_record_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_fiber_manual_record_black_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_fiber_manual_record_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_fiber_manual_record_black_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_fiber_manual_record_white_24dp.png create mode 100644 app/src/main/res/drawable/dark_selector.xml create mode 100644 app/src/main/res/drawable/light_selector.xml diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 1efab5790..45cfb4177 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -483,9 +483,12 @@ public class VideoDetailFragment extends BaseStateFragment implement if (!PreferenceManager.getDefaultSharedPreferences(activity).getBoolean(getString(R.string.show_hold_to_append_key), true)) return false; if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { - appendControlsDetail.setVisibility(View.VISIBLE); - } else { - appendControlsDetail.setVisibility(View.GONE); + animateView(appendControlsDetail, true, 250, 0, new Runnable() { + @Override + public void run() { + animateView(appendControlsDetail, false, 1500, 1000); + } + }); } return false; } diff --git a/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java b/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java index 277d24ac8..8c9ff1440 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java +++ b/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java @@ -178,7 +178,8 @@ public class MediaSourceManager { case REMOVE: final RemoveEvent removeEvent = (RemoveEvent) event; remove(removeEvent.getRemoveIndex()); - sync(); + // Sync only when the currently playing is removed + if (removeEvent.getQueueIndex() == removeEvent.getRemoveIndex()) sync(); break; case MOVE: final MoveEvent moveEvent = (MoveEvent) event; diff --git a/app/src/main/java/org/schabi/newpipe/playlist/PlayQueueAdapter.java b/app/src/main/java/org/schabi/newpipe/playlist/PlayQueueAdapter.java index 283606074..e16693ec6 100644 --- a/app/src/main/java/org/schabi/newpipe/playlist/PlayQueueAdapter.java +++ b/app/src/main/java/org/schabi/newpipe/playlist/PlayQueueAdapter.java @@ -188,10 +188,15 @@ public class PlayQueueAdapter extends RecyclerView.Adapter - - - - diff --git a/app/src/main/res/color/light_selector.xml b/app/src/main/res/color/light_selector.xml deleted file mode 100644 index 8451b387f..000000000 --- a/app/src/main/res/color/light_selector.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-hdpi/ic_fiber_manual_record_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_fiber_manual_record_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..459eec3fe2236e3f145212dac2baa3c3c3bc4a52 GIT binary patch literal 256 zcmV+b0ssDqP)g)3CrUM_jiZvdcUboz-k` zkDheT8YMnPIY)uc7{)Y<5>0x$kDFspM$ZRG4;P=SvKK6bK2)|i^b`gHt z1RWv#_6fR1_+5R%M2B6EW?Z(>7D4j}zZrrm{116YLBtv|TOz9D3>lq}kuZ#m`Y}wQ zMB|u-IE@^tAAAKXFTCI#OXPG`GRrpmT(#}9#S8_%%D)E>yuzJi`)1hy0000PB`B@`LW^nuVqeuUK7ly3SaLf%i9MP~!UtSE@ zBk)vUho0=1=7N}WCS}7iIrFw{EGF{5xxnI#u2R^=YAYRhz$zs2V-1gG#n9kUDTZS_ z4iv);9@n4H=;*ypYw#!)!zvz2ilI-y>YlFR*uiQ;DfBqU;*_@1n8adKc`T4KD;p*_ zOB^*SJGyKUUPx+#j=boxOvM4$TysFl5?%c&{~iD(mZaBCTkXP&fDv16V~jzvd_6G-dqUTPhhi~;d+s)c^Rkw2f6$chPOL}p%iShDk;*qLQ^nX#_buiOJLyy=URZc~ iiuU>=+{wFGJa~>voG{uiq~Zy53WKMspUXO@geCwYHARX5 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_fiber_manual_record_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_fiber_manual_record_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..f6f53a15407d333054ceec0dc9d90821f923702e GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+i8c!F;kP61T7q&7oIq*1KEIFa~ zV%3hdP461?n(Ei7HHCe@bWGLVM6%$)oFxDGRdZs}4sB*swXbbWeK^J7;N|V*{V$>= z1YW*sVxG8G&qCPp@4^KCl*Qb?TyE`J;I~BU)5&D(q=iSAPWLS82sgTLH+0vorKhI_ gck$+~nzWGplKJvP&bDY*pgR~mUHx3vIVCg!01OUDmjD0& literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_fiber_manual_record_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_fiber_manual_record_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..3eb79e4c1e07178b1ba3e7c99901a54f29206b59 GIT binary patch literal 335 zcmV-V0kHmwP)Y6r6SU^#3S}#A5K|zFP z`iglVgtP@vtU^E38?lE;^ za0_;@v8n%<6Ksq%*F+mz4N;>&A6s2=qQVL;7Da^yF7`x)Q(PR03NbDMQDKCO;TI?n z;Uf6>BY*sxF5_ZBRLIlAR+p@((Ztri=%C6N8zai1hb?TZi7wLIV(N;d=%Ye_i3dtz zhJOSG>Hms3D%@x;rzCbrv8ni|5o;vH1r-`}c}|yo^ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_fiber_manual_record_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_fiber_manual_record_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..b53beb10609c0f7a8900cac8d60386c8aca14562 GIT binary patch literal 468 zcmV;_0W1EAP)H-d)dczg;s+*Tio4Rh$p>Z72vkcs{n^9=>3xhkeN9rI=`=g@nIFqvMkH8 zL5?uX1KPaj`+V*n-%u=KOsA8HSTy=1p3I$YhlNL_4 z@ft<+imf=G$^5llNdUU3_6LCy)?+6hFuugMuCj_!WI&B@ERHRk`_sB zBjc`F^ur_jRj$rSRV{Zxe9Xa-G=}&0sAK8+>)c2R#v!7XNALC)<*nWZyAjf)%@Dw@q zh$!cgQ)h_MO@$mP=_1lJa%h}rLzKw4f&miTM8;huNsCv=u;*+b(N+p%)MqwfU^fji z=odRMauOMI3_~Yr5_jhq#&+=~;qL6f!4_UdzN}3+X>pwr1ypdA4Y(R)f(rddC1VV* zAi6orWAv9EafU7ySRV(N;x2Q%<=cF3nd2@~?5CG3%d#w6wSEK3T?wB^l{az#0000< KMNUMnLSTYHHO<%n literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_fiber_manual_record_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_fiber_manual_record_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..422487473f9c131cbc82f5263bb201ed0ddcb469 GIT binary patch literal 461 zcmV;;0W$uHP)FieD%LJ41*>_6rN^vN8a7g3sOi74>i>#6-#+aqzca%&ssx~mdN$&GA z_c%en+Ql$?nCB*4Uh;`gyrj!b=Go1VvMkH8Y{~i#7^q&XG8}6_00000NkvXXu0mjf D4#eBt literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_fiber_manual_record_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_fiber_manual_record_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..eff1e3594b7916bbc75ebbd0d63727b87fe4597d GIT binary patch literal 618 zcmV-w0+s!VP)XNrw#E2v}FjqTL7?Z!!MH?~t-acXZ+BdE>UjW(w*b~WeT^KiaD=HL?N zoO8}O=bTegpc|vu$T3R1p+dE$3U4TJj17#WE45a_Q1J)}fZ z4 z6nKUh^$-Q!5W_l=+bG1a;pDavF>Ecl9YYK|Ol~E_ush`T1~Kd46FJJ z7!RS$Cov_&u-kQgBRfQH8|wN|Vq{%E%ymT!>xhDJkY7^rnnN=m$Lr zWD*jgu>`co;P{{_4Sc~lNJ3ym&LM$1LsKFsax~D_Z%QO7y8?{;l&B_cky#{|YQ=hf{O5srEiI@OTCjpA|9IP4PIGFNgaPc}A@YarvyJ`~ zsI@vVoV6V04lgNFttsOrw>iXGhSL!x&N=6tbIv*U3ts(&w++AjuK)l507*qoM6N<$ Ef~O7*S^xk5 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_fiber_manual_record_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_fiber_manual_record_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..591b54a570638db666e7531a904b947726c6ba1e GIT binary patch literal 614 zcmV-s0-61ZP)|u3=Ilh1Z)2yr2eZlf#60*@ zff+#%1VIo4K@gB)63Zy%9M5=7mK-^I(3>ct$|o> zkme#boFnb#`ZuuU8fp8sWC!bTVWsS$ z0o$r%6EWwo=_HZtBF!~yxxzr%N1C(PaFT&?gP1x@t0I<5tRaIbKUgXEn8sa9xWyFt zLCj7*lEeqL5y>ZpQOtM##WxBWqI|#*j?l&5=;Sbil~0J6Lk;cxPAgT+CZ&AEI2KdL zX`b+cK62#9@PfyjqL9Uml_5b81VIo4K@bE#0g+IDbc_(cN&o-=07*qoM6N<$g1817 A^#A|> literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/dark_selector.xml b/app/src/main/res/drawable/dark_selector.xml new file mode 100644 index 000000000..eb658e16d --- /dev/null +++ b/app/src/main/res/drawable/dark_selector.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/light_selector.xml b/app/src/main/res/drawable/light_selector.xml new file mode 100644 index 000000000..63f2ccaf3 --- /dev/null +++ b/app/src/main/res/drawable/light_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main_player.xml b/app/src/main/res/layout/activity_main_player.xml index 0ee247373..5c6349c35 100644 --- a/app/src/main/res/layout/activity_main_player.xml +++ b/app/src/main/res/layout/activity_main_player.xml @@ -46,8 +46,8 @@ android:id="@+id/playQueuePanel" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="#64000000" android:visibility="gone" + android:background="?attr/queue_background_color" tools:visibility="visible"> @@ -85,6 +86,7 @@ android:clickable="true" android:focusable="true" android:scaleType="fitXY" + android:tint="?attr/colorAccent" android:src="@drawable/exo_controls_repeat_off" android:background="?android:selectableItemBackground" tools:ignore="ContentDescription,RtlHardcoded"/> @@ -99,6 +101,7 @@ android:clickable="true" android:focusable="true" android:scaleType="fitXY" + android:tint="?attr/colorAccent" android:src="@drawable/ic_shuffle_white_24dp" android:background="?android:selectableItemBackground" tools:ignore="ContentDescription,RtlHardcoded"/> diff --git a/app/src/main/res/layout/play_queue_item.xml b/app/src/main/res/layout/play_queue_item.xml index f4a5f7022..4d5a6fbd4 100644 --- a/app/src/main/res/layout/play_queue_item.xml +++ b/app/src/main/res/layout/play_queue_item.xml @@ -5,17 +5,32 @@ android:id="@+id/itemRoot" android:layout_width="match_parent" android:layout_height="48dp" - android:background="?attr/selectableItemBackground" + android:foreground="?attr/selectableItemBackground" + android:background="?attr/selector_drawable" android:clickable="true" android:focusable="true" - android:padding="6dp"> + android:paddingTop="6dp" + android:paddingBottom="6dp"> + + @@ -69,7 +83,6 @@ android:maxLines="1" android:textAppearance="?android:attr/textAppearanceLarge" android:textSize="@dimen/video_item_search_title_text_size" - android:textColor="?attr/selector_color" tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. "/> \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index de0ffac21..abf7c7b09 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -19,11 +19,13 @@ + + - + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 3008f68ee..3750bdb78 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -12,6 +12,7 @@ #5a000000 #ffffff #212121 + #c8ffffff #222222 @@ -24,6 +25,7 @@ #82000000 #424242 #ffffff + #af000000 #000 @@ -44,6 +46,9 @@ #d6d6d6 #717171 + #00000000 + #96717171 + #607D8B diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 6a8efb0c2..8f0bb02cd 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -26,11 +26,13 @@ @drawable/ic_language_black_24dp @drawable/ic_history_black_24dp @drawable/ic_drag_handle_black_24dp + @drawable/ic_fiber_manual_record_black_24dp - @color/light_selector @color/light_separator_color @color/light_contrast_background_color + @color/light_queue_background_color @drawable/toolbar_shadow_light + @drawable/light_selector @color/light_ripple_color @style/PreferenceThemeOverlay.v14.Material @@ -62,11 +64,13 @@ @drawable/ic_language_white_24dp @drawable/ic_history_white_24dp @drawable/ic_drag_handle_white_24dp + @drawable/ic_fiber_manual_record_white_24dp - @color/dark_selector @color/dark_separator_color @color/dark_contrast_background_color + @color/dark_queue_background_color @drawable/toolbar_shadow_dark + @drawable/dark_selector @color/dark_ripple_color @style/PreferenceThemeOverlay.v14.Material