From 7db26f37210da5fe15301871bef21b2e7d898583 Mon Sep 17 00:00:00 2001 From: polymorphicshade Date: Tue, 25 Aug 2020 18:45:30 -0600 Subject: [PATCH] SponsorBlock: Fixed button from being cut off on smaller screens Adjusted the layout of the secondary buttons in the player. This should (hopefully) make all the buttons accessible on smaller screens. Also gave the SponsorBlock icons some padding to look a little better. Also renamed some string resources. --- .../org/schabi/newpipe/player/BasePlayer.java | 14 +- .../ic_sponsor_block_disable_black_24dp.xml | 8 +- .../ic_sponsor_block_disable_white_24dp.xml | 8 +- .../ic_sponsor_block_enable_black_24dp.xml | 4 +- .../ic_sponsor_block_enable_white_24dp.xml | 4 +- .../ic_sponsor_block_exclude_black_24dp.xml | 4 +- .../ic_sponsor_block_exclude_white_24dp.xml | 4 +- app/src/main/res/layout/player.xml | 211 +++++++++--------- app/src/main/res/values/strings.xml | 12 +- 9 files changed, 139 insertions(+), 130 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java index 902a969ce..886bf2064 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java @@ -761,31 +761,31 @@ public abstract class BasePlayer implements switch (segment.category) { case "sponsor": toastText = context - .getString(R.string.sponsor_block_skip_sponsor_message); + .getString(R.string.sponsor_block_skip_sponsor_toast); break; case "intro": toastText = context - .getString(R.string.sponsor_block_skip_intro_message); + .getString(R.string.sponsor_block_skip_intro_toast); break; case "outro": toastText = context - .getString(R.string.sponsor_block_skip_outro_message); + .getString(R.string.sponsor_block_skip_outro_toast); break; case "interaction": toastText = context - .getString(R.string.sponsor_block_skip_interaction_message); + .getString(R.string.sponsor_block_skip_interaction_toast); break; case "selfpromo": toastText = context - .getString(R.string.sponsor_block_skip_self_promo_message); + .getString(R.string.sponsor_block_skip_self_promo_toast); break; case "music_offtopic": toastText = context - .getString(R.string.sponsor_block_skip_non_music_message); + .getString(R.string.sponsor_block_skip_non_music_toast); break; } - Toast.makeText(context, toastText, Toast.LENGTH_LONG).show(); + Toast.makeText(context, toastText, Toast.LENGTH_SHORT).show(); } if (DEBUG) { diff --git a/app/src/main/res/drawable/ic_sponsor_block_disable_black_24dp.xml b/app/src/main/res/drawable/ic_sponsor_block_disable_black_24dp.xml index dcadfeb66..5965ef4c8 100644 --- a/app/src/main/res/drawable/ic_sponsor_block_disable_black_24dp.xml +++ b/app/src/main/res/drawable/ic_sponsor_block_disable_black_24dp.xml @@ -5,14 +5,14 @@ android:viewportHeight="24"> + android:pathData="M12,22.7994C11.55,22.7994 11.1,22.7094 10.74,22.4394 4.89,18.8394 1.29,12.6294 1.2,5.7894 1.2,4.8894 1.65,3.9894 2.46,3.5394 8.4,0.3894 15.6,0.3894 21.54,3.6294 22.35,3.9894 22.8,4.8894 22.8,5.7894 22.71,12.6294 19.11,18.8394 13.35,22.4394 12.9,22.7094 12.45,22.7994 12,22.7994ZM12,1.9194c-3.15,0 -6.3,0.81 -9.18,2.34 -0.54,0.27 -0.9,0.9 -0.9,1.53 0.09,6.57 3.51,12.51 9.18,16.02 0.54,0.36 1.26,0.36 1.8,0C18.57,18.3894 21.9,12.3594 22.08,5.7894 22.08,5.1594 21.72,4.5294 21.18,4.2594 18.3,2.7294 15.15,1.9194 12,1.9194Z"/> + android:pathData="M20.73,4.9794C15.24,2.0994 8.76,2.0994 3.27,4.9794 3,5.1594 2.82,5.4294 2.82,5.7894c0.09,6.48 3.51,12.06 8.73,15.3 0.27,0.18 0.63,0.18 0.9,0 5.13,-3.15 8.64,-8.82 8.73,-15.3C21.18,5.4294 21,5.1594 20.73,4.9794ZM12,15.8694c-2.79,0 -4.95,-2.25 -4.95,-4.95 0,-2.7 2.25,-4.95 4.95,-4.95 2.7,0 4.95,2.25 4.95,4.95 0,2.79 -2.16,4.95 -4.95,4.95z"/> + android:pathData="m15.15,13.4394c0.54,-0.72 0.9,-1.53 0.9,-2.52 0,-2.25 -1.8,-4.05 -4.05,-4.05 -0.9,0 -1.8,0.36 -2.52,0.9z"/> + android:pathData="m8.85,8.4894c-0.54,0.72 -0.9,1.53 -0.9,2.52 0,2.25 1.8,4.05 4.05,4.05 0.9,0 1.8,-0.36 2.52,-0.9z"/> diff --git a/app/src/main/res/drawable/ic_sponsor_block_disable_white_24dp.xml b/app/src/main/res/drawable/ic_sponsor_block_disable_white_24dp.xml index 6cc8cd3b4..261cc6dc6 100644 --- a/app/src/main/res/drawable/ic_sponsor_block_disable_white_24dp.xml +++ b/app/src/main/res/drawable/ic_sponsor_block_disable_white_24dp.xml @@ -6,14 +6,14 @@ android:tint="#FFFFFF"> + android:pathData="M12,22.7994C11.55,22.7994 11.1,22.7094 10.74,22.4394 4.89,18.8394 1.29,12.6294 1.2,5.7894 1.2,4.8894 1.65,3.9894 2.46,3.5394 8.4,0.3894 15.6,0.3894 21.54,3.6294 22.35,3.9894 22.8,4.8894 22.8,5.7894 22.71,12.6294 19.11,18.8394 13.35,22.4394 12.9,22.7094 12.45,22.7994 12,22.7994ZM12,1.9194c-3.15,0 -6.3,0.81 -9.18,2.34 -0.54,0.27 -0.9,0.9 -0.9,1.53 0.09,6.57 3.51,12.51 9.18,16.02 0.54,0.36 1.26,0.36 1.8,0C18.57,18.3894 21.9,12.3594 22.08,5.7894 22.08,5.1594 21.72,4.5294 21.18,4.2594 18.3,2.7294 15.15,1.9194 12,1.9194Z"/> + android:pathData="M20.73,4.9794C15.24,2.0994 8.76,2.0994 3.27,4.9794 3,5.1594 2.82,5.4294 2.82,5.7894c0.09,6.48 3.51,12.06 8.73,15.3 0.27,0.18 0.63,0.18 0.9,0 5.13,-3.15 8.64,-8.82 8.73,-15.3C21.18,5.4294 21,5.1594 20.73,4.9794ZM12,15.8694c-2.79,0 -4.95,-2.25 -4.95,-4.95 0,-2.7 2.25,-4.95 4.95,-4.95 2.7,0 4.95,2.25 4.95,4.95 0,2.79 -2.16,4.95 -4.95,4.95z"/> + android:pathData="m15.15,13.4394c0.54,-0.72 0.9,-1.53 0.9,-2.52 0,-2.25 -1.8,-4.05 -4.05,-4.05 -0.9,0 -1.8,0.36 -2.52,0.9z"/> + android:pathData="m8.85,8.4894c-0.54,0.72 -0.9,1.53 -0.9,2.52 0,2.25 1.8,4.05 4.05,4.05 0.9,0 1.8,-0.36 2.52,-0.9z"/> diff --git a/app/src/main/res/drawable/ic_sponsor_block_enable_black_24dp.xml b/app/src/main/res/drawable/ic_sponsor_block_enable_black_24dp.xml index f5abd06ac..ed75b6a6c 100644 --- a/app/src/main/res/drawable/ic_sponsor_block_enable_black_24dp.xml +++ b/app/src/main/res/drawable/ic_sponsor_block_enable_black_24dp.xml @@ -5,8 +5,8 @@ android:viewportHeight="24"> + android:pathData="M12,22.7994C11.55,22.7994 11.1,22.7094 10.74,22.4394 4.89,18.8394 1.29,12.6294 1.2,5.7894 1.2,4.8894 1.65,3.9894 2.46,3.5394 8.4,0.3894 15.6,0.3894 21.54,3.6294 22.35,3.9894 22.8,4.8894 22.8,5.7894 22.71,12.6294 19.11,18.8394 13.35,22.4394 12.9,22.7094 12.45,22.7994 12,22.7994ZM12,1.9194c-3.15,0 -6.3,0.81 -9.18,2.34 -0.54,0.27 -0.9,0.9 -0.9,1.53 0.09,6.57 3.51,12.51 9.18,16.02 0.54,0.36 1.26,0.36 1.8,0C18.57,18.3894 21.9,12.3594 22.08,5.7894 22.08,5.1594 21.72,4.5294 21.18,4.2594 18.3,2.7294 15.15,1.9194 12,1.9194Z"/> + android:pathData="M20.73,4.9794C15.24,2.0994 8.76,2.0994 3.27,4.9794 3,5.1594 2.82,5.4294 2.82,5.7894c0.09,6.48 3.51,12.06 8.73,15.3 0.27,0.18 0.63,0.18 0.9,0 5.13,-3.15 8.64,-8.82 8.73,-15.3C21.18,5.4294 21,5.1594 20.73,4.9794ZM9.66,15.1494L9.66,6.7794l7.29,4.23z"/> diff --git a/app/src/main/res/drawable/ic_sponsor_block_enable_white_24dp.xml b/app/src/main/res/drawable/ic_sponsor_block_enable_white_24dp.xml index 2bda0ba7b..00536eefc 100644 --- a/app/src/main/res/drawable/ic_sponsor_block_enable_white_24dp.xml +++ b/app/src/main/res/drawable/ic_sponsor_block_enable_white_24dp.xml @@ -6,8 +6,8 @@ android:tint="#FFFFFF"> + android:pathData="M12,22.7994C11.55,22.7994 11.1,22.7094 10.74,22.4394 4.89,18.8394 1.29,12.6294 1.2,5.7894 1.2,4.8894 1.65,3.9894 2.46,3.5394 8.4,0.3894 15.6,0.3894 21.54,3.6294 22.35,3.9894 22.8,4.8894 22.8,5.7894 22.71,12.6294 19.11,18.8394 13.35,22.4394 12.9,22.7094 12.45,22.7994 12,22.7994ZM12,1.9194c-3.15,0 -6.3,0.81 -9.18,2.34 -0.54,0.27 -0.9,0.9 -0.9,1.53 0.09,6.57 3.51,12.51 9.18,16.02 0.54,0.36 1.26,0.36 1.8,0C18.57,18.3894 21.9,12.3594 22.08,5.7894 22.08,5.1594 21.72,4.5294 21.18,4.2594 18.3,2.7294 15.15,1.9194 12,1.9194Z"/> + android:pathData="M20.73,4.9794C15.24,2.0994 8.76,2.0994 3.27,4.9794 3,5.1594 2.82,5.4294 2.82,5.7894c0.09,6.48 3.51,12.06 8.73,15.3 0.27,0.18 0.63,0.18 0.9,0 5.13,-3.15 8.64,-8.82 8.73,-15.3C21.18,5.4294 21,5.1594 20.73,4.9794ZM9.66,15.1494L9.66,6.7794l7.29,4.23z"/> diff --git a/app/src/main/res/drawable/ic_sponsor_block_exclude_black_24dp.xml b/app/src/main/res/drawable/ic_sponsor_block_exclude_black_24dp.xml index f15834eed..779a400f6 100644 --- a/app/src/main/res/drawable/ic_sponsor_block_exclude_black_24dp.xml +++ b/app/src/main/res/drawable/ic_sponsor_block_exclude_black_24dp.xml @@ -5,8 +5,8 @@ android:viewportHeight="24"> + android:pathData="M12,22.7994C11.55,22.7994 11.1,22.7094 10.74,22.4394 4.89,18.8394 1.29,12.6294 1.2,5.7894 1.2,4.8894 1.65,3.9894 2.46,3.5394 8.4,0.3894 15.6,0.3894 21.54,3.6294 22.35,3.9894 22.8,4.8894 22.8,5.7894 22.71,12.6294 19.11,18.8394 13.35,22.4394 12.9,22.7094 12.45,22.7994 12,22.7994ZM12,1.9194c-3.15,0 -6.3,0.81 -9.18,2.34 -0.54,0.27 -0.9,0.9 -0.9,1.53 0.09,6.57 3.51,12.51 9.18,16.02 0.54,0.36 1.26,0.36 1.8,0C18.57,18.3894 21.9,12.3594 22.08,5.7894 22.08,5.1594 21.72,4.5294 21.18,4.2594 18.3,2.7294 15.15,1.9194 12,1.9194Z"/> + android:pathData="M20.73,4.9794C15.24,2.0994 8.76,2.0994 3.27,4.9794 3,5.1594 2.82,5.4294 2.82,5.7894c0.09,6.48 3.51,12.06 8.73,15.3 0.27,0.18 0.63,0.18 0.9,0 5.13,-3.15 8.64,-8.82 8.73,-15.3C21.18,5.4294 21,5.1594 20.73,4.9794ZM12,15.4194c0,0 -4.5,-3.6 -4.5,-5.94 0,-1.53 0.99,-2.43 2.25,-2.43 1.08,0 2.25,1.17 2.25,1.17 0,0 1.08,-1.17 2.25,-1.17 1.26,0 2.25,0.81 2.25,2.43 0,2.34 -4.5,5.94 -4.5,5.94z"/> diff --git a/app/src/main/res/drawable/ic_sponsor_block_exclude_white_24dp.xml b/app/src/main/res/drawable/ic_sponsor_block_exclude_white_24dp.xml index 8fafdd75a..9df5ebbb5 100644 --- a/app/src/main/res/drawable/ic_sponsor_block_exclude_white_24dp.xml +++ b/app/src/main/res/drawable/ic_sponsor_block_exclude_white_24dp.xml @@ -6,8 +6,8 @@ android:tint="#FFFFFF"> + android:pathData="M12,22.7994C11.55,22.7994 11.1,22.7094 10.74,22.4394 4.89,18.8394 1.29,12.6294 1.2,5.7894 1.2,4.8894 1.65,3.9894 2.46,3.5394 8.4,0.3894 15.6,0.3894 21.54,3.6294 22.35,3.9894 22.8,4.8894 22.8,5.7894 22.71,12.6294 19.11,18.8394 13.35,22.4394 12.9,22.7094 12.45,22.7994 12,22.7994ZM12,1.9194c-3.15,0 -6.3,0.81 -9.18,2.34 -0.54,0.27 -0.9,0.9 -0.9,1.53 0.09,6.57 3.51,12.51 9.18,16.02 0.54,0.36 1.26,0.36 1.8,0C18.57,18.3894 21.9,12.3594 22.08,5.7894 22.08,5.1594 21.72,4.5294 21.18,4.2594 18.3,2.7294 15.15,1.9194 12,1.9194Z"/> + android:pathData="M20.73,4.9794C15.24,2.0994 8.76,2.0994 3.27,4.9794 3,5.1594 2.82,5.4294 2.82,5.7894c0.09,6.48 3.51,12.06 8.73,15.3 0.27,0.18 0.63,0.18 0.9,0 5.13,-3.15 8.64,-8.82 8.73,-15.3C21.18,5.4294 21,5.1594 20.73,4.9794ZM12,15.4194c0,0 -4.5,-3.6 -4.5,-5.94 0,-1.53 0.99,-2.43 2.25,-2.43 1.08,0 2.25,1.17 2.25,1.17 0,0 1.08,-1.17 2.25,-1.17 1.26,0 2.25,0.81 2.25,2.43 0,2.34 -4.5,5.94 -4.5,5.94z"/> diff --git a/app/src/main/res/layout/player.xml b/app/src/main/res/layout/player.xml index 187164707..d67f2f7e6 100644 --- a/app/src/main/res/layout/player.xml +++ b/app/src/main/res/layout/player.xml @@ -211,114 +211,123 @@ android:gravity="top" android:visibility="invisible" tools:ignore="RtlHardcoded" - tools:visibility="visible"> + tools:visibility="visible" + android:baselineAligned="false"> - - - - - + android:layout_height="match_parent" + android:layout_weight="1"> - + - + - + - + - + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ddff8be15..92e02b42e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -700,12 +700,12 @@ https://sponsor.ajay.app/ https://sponsor.ajay.app/api/ https://gist.github.com/ajayyy/aa9f8ded2b573d4f73a3ffa0ef74f796 - Skipped sponsor - Skipped intermission/intro - Skipped endcards/credits - Skipped interaction reminder - Skipped unpaid/self promo - Skipped non-music + Skipped sponsor + Skipped intermission/intro + Skipped endcards/credits + Skipped interaction reminder + Skipped unpaid/self promo + Skipped non-music Toggle skipping sponsors Clear Whitelist Clear the list of uploaders SponsorBlock will ignore.