SponsorBlock: Improved enable/disable icons

Re-did the enable/disable icons to be cleaner and their behavior more understandable (w/ toast). Made icons more consistent with others (black, white, actually 24dp).
This commit is contained in:
polymorphicshade 2020-08-19 09:36:23 -06:00
parent 76c649ada0
commit bf78cbb63e
10 changed files with 79 additions and 15 deletions

View file

@ -56,6 +56,8 @@ import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
@ -646,6 +648,12 @@ public class VideoPlayerImpl extends VideoPlayer
public void onBlockingSponsorsButtonClicked() {
super.onBlockingSponsorsButtonClicked();
setBlockSponsorsButton(blockSponsorsButton, isBlockingSponsors());
Toast.makeText(context,
isBlockingSponsors()
? "SponsorBlock enabled"
: "SponsorBlock disabled",
Toast.LENGTH_SHORT).show();
}
@Override
@ -1591,8 +1599,8 @@ public class VideoPlayerImpl extends VideoPlayer
protected void setBlockSponsorsButton(final ImageButton button,
final boolean isBlockingSponsors) {
button.setImageDrawable(AppCompatResources.getDrawable(service, isBlockingSponsors
? R.drawable.ic_sponsorblock_disable_white_24dp
: R.drawable.ic_sponsorblock_enable_white_24dp));
? R.drawable.ic_sponsor_block_enable_white_24dp
: R.drawable.ic_sponsor_block_disable_white_24dp));
}
/**

View file

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,24c-0.5,0 -1,-0.1 -1.4,-0.4C4.1,19.6 0.1,12.7 0,5.1c0,-1 0.5,-2 1.4,-2.5C8,-0.9 16,-0.9 22.6,2.7C23.5,3.1 24,4.1 24,5.1c-0.1,7.6 -4.1,14.5 -10.5,18.5C13,23.9 12.5,24 12,24zM12,0.8c-3.5,0 -7,0.9 -10.2,2.6c-0.6,0.3 -1,1 -1,1.7C0.9,12.4 4.7,19 11,22.9c0.6,0.4 1.4,0.4 2,0c6.3,-3.8 10,-10.5 10.2,-17.8c0,-0.7 -0.4,-1.4 -1,-1.7C19,1.7 15.5,0.8 12,0.8z"/>
<path
android:fillColor="#FF000000"
android:pathData="M21.7,4.2C15.6,1 8.4,1 2.3,4.2C2,4.4 1.8,4.7 1.8,5.1c0.1,7.2 3.9,13.4 9.7,17c0.3,0.2 0.7,0.2 1,0c5.7,-3.5 9.6,-9.8 9.7,-17C22.2,4.7 22,4.4 21.7,4.2zM12,16.3c-3.1,0 -5.5,-2.5 -5.5,-5.5c0,-3 2.5,-5.5 5.5,-5.5s5.5,2.5 5.5,5.5C17.5,13.9 15.1,16.3 12,16.3z"/>
<path
android:fillColor="#FF000000"
android:pathData="M15.5,13.6c0.6,-0.8 1,-1.7 1,-2.8c0,-2.5 -2,-4.5 -4.5,-4.5c-1,0 -2,0.4 -2.8,1L15.5,13.6z"/>
<path
android:fillColor="#FF000000"
android:pathData="M8.5,8.1c-0.6,0.8 -1,1.7 -1,2.8c0,2.5 2,4.5 4.5,4.5c1,0 2,-0.4 2.8,-1L8.5,8.1z"/>
</vector>

View file

@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF">
<path
android:fillColor="#FF000000"
android:pathData="M12,24c-0.5,0 -1,-0.1 -1.4,-0.4C4.1,19.6 0.1,12.7 0,5.1c0,-1 0.5,-2 1.4,-2.5C8,-0.9 16,-0.9 22.6,2.7C23.5,3.1 24,4.1 24,5.1c-0.1,7.6 -4.1,14.5 -10.5,18.5C13,23.9 12.5,24 12,24zM12,0.8c-3.5,0 -7,0.9 -10.2,2.6c-0.6,0.3 -1,1 -1,1.7C0.9,12.4 4.7,19 11,22.9c0.6,0.4 1.4,0.4 2,0c6.3,-3.8 10,-10.5 10.2,-17.8c0,-0.7 -0.4,-1.4 -1,-1.7C19,1.7 15.5,0.8 12,0.8z"/>
<path
android:fillColor="#FF000000"
android:pathData="M21.7,4.2C15.6,1 8.4,1 2.3,4.2C2,4.4 1.8,4.7 1.8,5.1c0.1,7.2 3.9,13.4 9.7,17c0.3,0.2 0.7,0.2 1,0c5.7,-3.5 9.6,-9.8 9.7,-17C22.2,4.7 22,4.4 21.7,4.2zM12,16.3c-3.1,0 -5.5,-2.5 -5.5,-5.5c0,-3 2.5,-5.5 5.5,-5.5s5.5,2.5 5.5,5.5C17.5,13.9 15.1,16.3 12,16.3z"/>
<path
android:fillColor="#FF000000"
android:pathData="M15.5,13.6c0.6,-0.8 1,-1.7 1,-2.8c0,-2.5 -2,-4.5 -4.5,-4.5c-1,0 -2,0.4 -2.8,1L15.5,13.6z"/>
<path
android:fillColor="#FF000000"
android:pathData="M8.5,8.1c-0.6,0.8 -1,1.7 -1,2.8c0,2.5 2,4.5 4.5,4.5c1,0 2,-0.4 2.8,-1L8.5,8.1z"/>
</vector>

View file

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,24c-0.5,0 -1,-0.1 -1.4,-0.4C4.1,19.6 0.1,12.7 0,5.1c0,-1 0.5,-2 1.4,-2.5C8,-0.9 16,-0.9 22.6,2.7C23.5,3.1 24,4.1 24,5.1c-0.1,7.6 -4.1,14.5 -10.5,18.5C13,23.9 12.5,24 12,24zM12,0.8c-3.5,0 -7,0.9 -10.2,2.6c-0.6,0.3 -1,1 -1,1.7C0.9,12.4 4.7,19 11,22.9c0.6,0.4 1.4,0.4 2,0c6.3,-3.8 10,-10.5 10.2,-17.8c0,-0.7 -0.4,-1.4 -1,-1.7C19,1.7 15.5,0.8 12,0.8z"/>
<path
android:fillColor="#FF000000"
android:pathData="M21.7,4.2C15.6,1 8.4,1 2.3,4.2C2,4.4 1.8,4.7 1.8,5.1c0.1,7.2 3.9,13.4 9.7,17c0.3,0.2 0.7,0.2 1,0c5.7,-3.5 9.6,-9.8 9.7,-17C22.2,4.7 22,4.4 21.7,4.2zM9.4,15.5V6.2l8.1,4.7L9.4,15.5z"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF">
<path
android:fillColor="#FF000000"
android:pathData="M12,24c-0.5,0 -1,-0.1 -1.4,-0.4C4.1,19.6 0.1,12.7 0,5.1c0,-1 0.5,-2 1.4,-2.5C8,-0.9 16,-0.9 22.6,2.7C23.5,3.1 24,4.1 24,5.1c-0.1,7.6 -4.1,14.5 -10.5,18.5C13,23.9 12.5,24 12,24zM12,0.8c-3.5,0 -7,0.9 -10.2,2.6c-0.6,0.3 -1,1 -1,1.7C0.9,12.4 4.7,19 11,22.9c0.6,0.4 1.4,0.4 2,0c6.3,-3.8 10,-10.5 10.2,-17.8c0,-0.7 -0.4,-1.4 -1,-1.7C19,1.7 15.5,0.8 12,0.8z"/>
<path
android:fillColor="#FF000000"
android:pathData="M21.7,4.2C15.6,1 8.4,1 2.3,4.2C2,4.4 1.8,4.7 1.8,5.1c0.1,7.2 3.9,13.4 9.7,17c0.3,0.2 0.7,0.2 1,0c5.7,-3.5 9.6,-9.8 9.7,-17C22.2,4.7 22,4.4 21.7,4.2zM9.4,15.5V6.2l8.1,4.7L9.4,15.5z"/>
</vector>

File diff suppressed because one or more lines are too long

View file

@ -1,6 +0,0 @@
<vector android:height="24dp" android:viewportHeight="25.400005"
android:viewportWidth="25.399996" android:width="23.999992dp" xmlns:android="http://schemas.android.com/apk/res/android"
android:tint="#FFFFFF">
<path android:fillColor="#FF000000"
android:pathData="m12.638,25.3999c-0.2786,-0.002 -0.6752,-0.0642 -0.8813,-0.1374 -0.2061,-0.0733 -0.6241,-0.283 -0.929,-0.4662 -0.3048,-0.1832 -1.0124,-0.675 -1.5724,-1.0929 -0.56,-0.4179 -1.4781,-1.1951 -2.0401,-1.727 -0.562,-0.532 -1.3809,-1.3936 -1.8197,-1.9146 -0.4388,-0.5211 -1.1538,-1.481 -1.5889,-2.1332 -0.4351,-0.6522 -1.0762,-1.7665 -1.4246,-2.4763 -0.3484,-0.7098 -0.7962,-1.7298 -0.9951,-2.2668 -0.1989,-0.537 -0.5112,-1.5622 -0.6941,-2.2782 -0.1829,-0.716 -0.411,-1.8368 -0.5071,-2.4905 -0.096,-0.6538 -0.179,-1.7904 -0.1843,-2.5258 -0.0085,-1.1718 0.0167,-1.3942 0.2041,-1.7977 0.1176,-0.2533 0.3864,-0.6322 0.5973,-0.8419 0.23,-0.2288 0.8413,-0.6047 1.5275,-0.9394 0.6292,-0.3068 1.5882,-0.7227 2.131,-0.9241 0.5428,-0.2014 1.4831,-0.4958 2.0896,-0.6542 0.6065,-0.1584 1.6624,-0.3876 2.3465,-0.5093 1.0646,-0.1895 1.6024,-0.2218 3.7315,-0.2242 1.9471,-0.002 2.7255,0.0363 3.5822,0.1772 0.602,0.0991 1.5611,0.2926 2.1314,0.4302 0.5702,0.1376 1.4798,0.4036 2.0213,0.5912 0.5415,0.1876 1.4533,0.5455 2.0264,0.7953 0.573,0.2498 1.3096,0.6265 1.6369,0.8371 0.3766,0.2423 0.7051,0.5555 0.8947,0.8531 0.1648,0.2586 0.3489,0.6492 0.4091,0.868 0.0701,0.2546 0.0877,0.879 0.0488,1.7349 -0.0334,0.7355 -0.1492,1.8721 -0.2574,2.5259 -0.1081,0.6537 -0.3076,1.6121 -0.4432,2.1296 -0.1356,0.5175 -0.409,1.409 -0.6075,1.9811 -0.1985,0.572 -0.666,1.6641 -1.039,2.4268 -0.373,0.7627 -1.0337,1.9218 -1.4683,2.5757 -0.4346,0.654 -1.1287,1.59 -1.5425,2.0801 -0.4138,0.4901 -1.1942,1.3167 -1.7342,1.8369 -0.54,0.5202 -1.3253,1.217 -1.7449,1.5485 -0.4197,0.3315 -1.1552,0.8598 -1.6346,1.174 -0.4793,0.3142 -1.0722,0.6314 -1.3175,0.7049 -0.2453,0.0735 -0.6739,0.1317 -0.9526,0.1293zM12.8415,24.3793c0.3751,-0.0216 0.6532,-0.1186 1.0448,-0.3643 0.2935,-0.1842 0.9367,-0.6314 1.4293,-0.9938 0.4926,-0.3624 1.2872,-1.0029 1.7659,-1.4233 0.4787,-0.4204 1.3008,-1.2626 1.8269,-1.8715 0.5261,-0.6089 1.3111,-1.6347 1.7444,-2.2796 0.4333,-0.6449 1.0927,-1.7857 1.4651,-2.5352 0.3725,-0.7495 0.884,-1.9826 1.1368,-2.7401 0.2527,-0.7575 0.5712,-1.9345 0.7076,-2.6155 0.1365,-0.681 0.2953,-1.671 0.353,-2.2 0.0577,-0.529 0.1039,-1.2868 0.1027,-1.6839 -0.001,-0.4851 -0.0621,-0.8534 -0.1849,-1.1223 -0.1005,-0.2202 -0.33,-0.5238 -0.5102,-0.6746 -0.1801,-0.1509 -0.5918,-0.4071 -0.9149,-0.5695 -0.3231,-0.1623 -1.0664,-0.4904 -1.6519,-0.7289 -0.5855,-0.2385 -1.5347,-0.5727 -2.1093,-0.7426 -0.5746,-0.1699 -1.6493,-0.4231 -2.3881,-0.5626 -1.0355,-0.1955 -1.7886,-0.2657 -3.2863,-0.3064 -1.2105,-0.0328 -2.3359,-0.008 -2.9852,0.0649 -0.5732,0.0647 -1.5894,0.2265 -2.2581,0.3597 -0.6687,0.1331 -1.7434,0.4145 -2.3882,0.6253 -0.6447,0.2108 -1.7388,0.6374 -2.4313,0.948 -0.6925,0.3106 -1.439,0.7181 -1.6589,0.9055 -0.2344,0.1998 -0.471,0.5261 -0.5717,0.7886 -0.1441,0.3756 -0.1611,0.6372 -0.1052,1.6212 0.0366,0.6453 0.1538,1.7025 0.2603,2.3493 0.1065,0.6468 0.3509,1.7453 0.5431,2.4412 0.1921,0.6959 0.5769,1.816 0.855,2.4893 0.2781,0.6733 0.776,1.7086 1.1065,2.3007 0.3305,0.5921 0.8504,1.4332 1.1553,1.869 0.3049,0.4358 0.815,1.1115 1.1334,1.5014 0.3184,0.39 0.9937,1.1218 1.5005,1.6264 0.5068,0.5045 1.3245,1.2375 1.8171,1.6288 0.4925,0.3913 1.2314,0.934 1.6418,1.2061 0.4105,0.2721 0.8806,0.5451 1.0448,0.6066 0.1642,0.0615 0.5285,0.0985 0.8096,0.0823zM12.7958,23.4902c-0.2922,0.0369 -0.4808,-0.0234 -0.9362,-0.2992 -0.3137,-0.19 -1.0072,-0.6723 -1.5411,-1.0718 -0.5339,-0.3995 -1.4454,-1.1944 -2.0255,-1.7665 -0.58,-0.5721 -1.3384,-1.3967 -1.6853,-1.8326 -0.3469,-0.4358 -0.932,-1.2515 -1.3002,-1.8125 -0.3682,-0.561 -0.9155,-1.5194 -1.2162,-2.1296 -0.3007,-0.6102 -0.7107,-1.5492 -0.9111,-2.0866 -0.2004,-0.5374 -0.494,-1.4957 -0.6524,-2.1296 -0.1584,-0.6339 -0.3563,-1.6206 -0.4397,-2.1927 -0.0834,-0.572 -0.1638,-1.5374 -0.1787,-2.1452 -0.0257,-1.0484 -0.0149,-1.1182 0.2116,-1.3593 0.1313,-0.1398 0.6463,-0.4507 1.1443,-0.6909 0.4981,-0.2402 1.3434,-0.5991 1.8785,-0.7977 0.5351,-0.1986 1.3823,-0.4701 1.8825,-0.6033 0.5003,-0.1333 1.473,-0.3417 2.1615,-0.4631 1.037,-0.1829 1.6277,-0.2213 3.441,-0.224 1.6543,-0.002 2.4565,0.0406 3.2837,0.1759 0.602,0.0985 1.5235,0.2861 2.0477,0.4168 0.5242,0.1308 1.4197,0.3989 1.9901,0.5958 0.5704,0.197 1.5334,0.5987 2.1401,0.8928 0.8994,0.4359 1.1369,0.5972 1.2865,0.8736 0.171,0.3162 0.1754,0.438 0.064,1.809 -0.0657,0.8085 -0.2324,2.0272 -0.3706,2.7082 -0.1382,0.681 -0.4471,1.8232 -0.6864,2.5383 -0.2393,0.7151 -0.6546,1.7625 -0.9229,2.3277 -0.2683,0.5652 -0.7472,1.4509 -1.0642,1.9681 -0.3171,0.5173 -0.88,1.3419 -1.2509,1.8325 -0.371,0.4906 -1.0432,1.2838 -1.4939,1.7626 -0.4507,0.4788 -1.2475,1.2263 -1.7706,1.6609 -0.5232,0.4347 -1.3491,1.0617 -1.8355,1.3932 -0.561,0.3825 -1.018,0.6198 -1.2502,0.6491zM9.9443,16.2914c0.0285,0 1.9203,-1.0732 4.2041,-2.385 2.2838,-1.3117 4.1841,-2.4154 4.2229,-2.4525 0.0388,-0.0371 -1.6365,-1.0477 -3.7231,-2.2457 -2.0865,-1.198 -4.0101,-2.3017 -4.2747,-2.4526l-0.4811,-0.2744v4.9051c0,2.6978 0.0233,4.9051 0.0518,4.9051z" android:strokeWidth="0.0992791"/>
</vector>

View file

@ -315,7 +315,7 @@
android:clickable="true"
android:focusable="true"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_sponsorblock_disable_white_24dp"
app:srcCompat="@drawable/ic_sponsor_block_disable_white_24dp"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/sponsorblock_toggle_skipping"
tools:ignore="RtlHardcoded" />

View file

@ -82,6 +82,8 @@
<attr name="ic_sort" format="reference"/>
<attr name="ic_help" format="reference"/>
<attr name="ic_arrow_back" format="reference"/>
<attr name="ic_sponsor_block_enable" format="reference"/>
<attr name="ic_sponsor_block_disable" format="reference"/>
<attr name="progress_horizontal_drawable" format="reference"/>
<!-- Can't refer to colors directly in drawable's xml-->

View file

@ -97,6 +97,8 @@
<item name="ic_sort">@drawable/ic_sort_black_24dp</item>
<item name="ic_help">@drawable/ic_help_black_24dp</item>
<item name="ic_arrow_back">@drawable/ic_arrow_back_black_24dp</item>
<item name="ic_sponsor_block_enable">@drawable/ic_sponsor_block_enable_black_24dp</item>
<item name="ic_sponsor_block_disable">@drawable/ic_sponsor_block_disable_black_24dp</item>
<item name="separator_color">@color/light_separator_color</item>
<item name="contrast_background_color">@color/light_contrast_background_color</item>
@ -204,6 +206,8 @@
<item name="ic_sort">@drawable/ic_sort_white_24dp</item>
<item name="ic_help">@drawable/ic_help_white_24dp</item>
<item name="ic_arrow_back">@drawable/ic_arrow_back_white_24dp</item>
<item name="ic_sponsor_block_enable">@drawable/ic_sponsor_block_enable_white_24dp</item>
<item name="ic_sponsor_block_disable">@drawable/ic_sponsor_block_disable_white_24dp</item>
<item name="separator_color">@color/dark_separator_color</item>
<item name="contrast_background_color">@color/dark_contrast_background_color</item>