From a0879821abae2e684b6fcc3df74128c6b0e53188 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 20 Jul 2021 20:55:23 +0800 Subject: [PATCH] Tweak the autoplay video control. --- .../PostDetailRecyclerViewAdapter.java | 8 +- .../adapters/PostRecyclerViewAdapter.java | 16 +- .../main/res/drawable/background_autoplay.xml | 11 -- ...l => ic_fullscreen_white_rounded_24dp.xml} | 8 +- ...8dp.xml => ic_mute_white_rounded_24dp.xml} | 8 +- ...dp.xml => ic_pause_white_rounded_24dp.xml} | 8 +- ...l => ic_play_arrow_white_rounded_24dp.xml} | 8 +- ...p.xml => ic_unmute_white_rounded_24dp.xml} | 8 +- .../exo_autoplay_playback_control_view.xml | 161 ++++++++++-------- 9 files changed, 119 insertions(+), 117 deletions(-) delete mode 100644 app/src/main/res/drawable/background_autoplay.xml rename app/src/main/res/drawable/{ic_fullscreen_white_rounded_18dp.xml => ic_fullscreen_white_rounded_24dp.xml} (83%) rename app/src/main/res/drawable/{ic_mute_white_rounded_18dp.xml => ic_mute_white_rounded_24dp.xml} (89%) rename app/src/main/res/drawable/{ic_pause_white_rounded_18dp.xml => ic_pause_white_rounded_24dp.xml} (64%) rename app/src/main/res/drawable/{ic_play_arrow_white_rounded_18dp.xml => ic_play_arrow_white_rounded_24dp.xml} (70%) rename app/src/main/res/drawable/{ic_unmute_white_rounded_18dp.xml => ic_unmute_white_rounded_24dp.xml} (83%) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java index 43f6fcbe..2f749083 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -1615,11 +1615,11 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter { if (helper != null) { if (helper.getVolume() != 0) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_24dp)); helper.setVolume(0f); volume = 0f; } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_24dp)); helper.setVolume(1f); volume = 1f; } @@ -1701,9 +1701,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter { if (helper != null) { if (helper.getVolume() != 0) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_24dp)); helper.setVolume(0f); volume = 0f; mFragment.videoAutoplayChangeMutingOption(true); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_24dp)); helper.setVolume(1f); volume = 1f; mFragment.videoAutoplayChangeMutingOption(false); @@ -2918,9 +2918,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter { if (helper != null) { if (helper.getVolume() != 0) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_24dp)); helper.setVolume(0f); volume = 0f; mFragment.videoAutoplayChangeMutingOption(true); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_18dp)); + muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_24dp)); helper.setVolume(1f); volume = 1f; mFragment.videoAutoplayChangeMutingOption(false); @@ -4137,9 +4137,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter - - - - - - - diff --git a/app/src/main/res/drawable/ic_fullscreen_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_fullscreen_white_rounded_24dp.xml similarity index 83% rename from app/src/main/res/drawable/ic_fullscreen_white_rounded_18dp.xml rename to app/src/main/res/drawable/ic_fullscreen_white_rounded_24dp.xml index 9977b60f..0dbedfee 100644 --- a/app/src/main/res/drawable/ic_fullscreen_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_fullscreen_white_rounded_24dp.xml @@ -1,9 +1,9 @@ + android:fillColor="@android:color/white" + android:pathData="M6,14c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1h3c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L7,17v-2c0,-0.55 -0.45,-1 -1,-1zM6,10c0.55,0 1,-0.45 1,-1L7,7h2c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L6,5c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1zM17,17h-2c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h3c0.55,0 1,-0.45 1,-1v-3c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v2zM14,6c0,0.55 0.45,1 1,1h2v2c0,0.55 0.45,1 1,1s1,-0.45 1,-1L19,6c0,-0.55 -0.45,-1 -1,-1h-3c-0.55,0 -1,0.45 -1,1z"/> diff --git a/app/src/main/res/drawable/ic_mute_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_mute_white_rounded_24dp.xml similarity index 89% rename from app/src/main/res/drawable/ic_mute_white_rounded_18dp.xml rename to app/src/main/res/drawable/ic_mute_white_rounded_24dp.xml index b4f8f660..bc45d400 100644 --- a/app/src/main/res/drawable/ic_mute_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_mute_white_rounded_24dp.xml @@ -1,9 +1,9 @@ + android:fillColor="@android:color/white" + android:pathData="M3.63,3.63c-0.39,0.39 -0.39,1.02 0,1.41L7.29,8.7 7,9L4,9c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1h3l3.29,3.29c0.63,0.63 1.71,0.18 1.71,-0.71v-4.17l4.18,4.18c-0.49,0.37 -1.02,0.68 -1.6,0.91 -0.36,0.15 -0.58,0.53 -0.58,0.92 0,0.72 0.73,1.18 1.39,0.91 0.8,-0.33 1.55,-0.77 2.22,-1.31l1.34,1.34c0.39,0.39 1.02,0.39 1.41,0 0.39,-0.39 0.39,-1.02 0,-1.41L5.05,3.63c-0.39,-0.39 -1.02,-0.39 -1.42,0zM19,12c0,0.82 -0.15,1.61 -0.41,2.34l1.53,1.53c0.56,-1.17 0.88,-2.48 0.88,-3.87 0,-3.83 -2.4,-7.11 -5.78,-8.4 -0.59,-0.23 -1.22,0.23 -1.22,0.86v0.19c0,0.38 0.25,0.71 0.61,0.85C17.18,6.54 19,9.06 19,12zM10.29,5.71l-0.17,0.17L12,7.76L12,6.41c0,-0.89 -1.08,-1.33 -1.71,-0.7zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v1.79l2.48,2.48c0.01,-0.08 0.02,-0.16 0.02,-0.24z"/> diff --git a/app/src/main/res/drawable/ic_pause_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_pause_white_rounded_24dp.xml similarity index 64% rename from app/src/main/res/drawable/ic_pause_white_rounded_18dp.xml rename to app/src/main/res/drawable/ic_pause_white_rounded_24dp.xml index 479c57b0..a5e498b5 100644 --- a/app/src/main/res/drawable/ic_pause_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_pause_white_rounded_24dp.xml @@ -1,9 +1,9 @@ + android:fillColor="@android:color/white" + android:pathData="M8,19c1.1,0 2,-0.9 2,-2L10,7c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2v10c0,1.1 0.9,2 2,2zM14,7v10c0,1.1 0.9,2 2,2s2,-0.9 2,-2L18,7c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2z"/> diff --git a/app/src/main/res/drawable/ic_play_arrow_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_play_arrow_white_rounded_24dp.xml similarity index 70% rename from app/src/main/res/drawable/ic_play_arrow_white_rounded_18dp.xml rename to app/src/main/res/drawable/ic_play_arrow_white_rounded_24dp.xml index 3400b3ac..78fbfbba 100644 --- a/app/src/main/res/drawable/ic_play_arrow_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_play_arrow_white_rounded_24dp.xml @@ -1,9 +1,9 @@ + android:fillColor="@android:color/white" + android:pathData="M8,6.82v10.36c0,0.79 0.87,1.27 1.54,0.84l8.14,-5.18c0.62,-0.39 0.62,-1.29 0,-1.69L9.54,5.98C8.87,5.55 8,6.03 8,6.82z"/> diff --git a/app/src/main/res/drawable/ic_unmute_white_rounded_18dp.xml b/app/src/main/res/drawable/ic_unmute_white_rounded_24dp.xml similarity index 83% rename from app/src/main/res/drawable/ic_unmute_white_rounded_18dp.xml rename to app/src/main/res/drawable/ic_unmute_white_rounded_24dp.xml index 90b8f85d..3afb6532 100644 --- a/app/src/main/res/drawable/ic_unmute_white_rounded_18dp.xml +++ b/app/src/main/res/drawable/ic_unmute_white_rounded_24dp.xml @@ -1,9 +1,9 @@ + android:fillColor="@android:color/white" + android:pathData="M3,10v4c0,0.55 0.45,1 1,1h3l3.29,3.29c0.63,0.63 1.71,0.18 1.71,-0.71L12,6.41c0,-0.89 -1.08,-1.34 -1.71,-0.71L7,9L4,9c-0.55,0 -1,0.45 -1,1zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,4.45v0.2c0,0.38 0.25,0.71 0.6,0.85C17.18,6.53 19,9.06 19,12s-1.82,5.47 -4.4,6.5c-0.36,0.14 -0.6,0.47 -0.6,0.85v0.2c0,0.63 0.63,1.07 1.21,0.85C18.6,19.11 21,15.84 21,12s-2.4,-7.11 -5.79,-8.4c-0.58,-0.23 -1.21,0.22 -1.21,0.85z"/> diff --git a/app/src/main/res/layout/exo_autoplay_playback_control_view.xml b/app/src/main/res/layout/exo_autoplay_playback_control_view.xml index 438d0172..50fa5421 100644 --- a/app/src/main/res/layout/exo_autoplay_playback_control_view.xml +++ b/app/src/main/res/layout/exo_autoplay_playback_control_view.xml @@ -1,92 +1,105 @@ - + android:background="#80000000"> - + - + - + - + - + - - - - - - - + - \ No newline at end of file + \ No newline at end of file