mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-22 18:23:59 +00:00
Add SB bold icon placeholder code
This commit is contained in:
@@ -1,16 +1,27 @@
|
||||
package app.revanced.extension.youtube.sponsorblock.ui;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.ResourceType;
|
||||
import app.revanced.extension.shared.Utils;
|
||||
import app.revanced.extension.shared.settings.BaseSettings;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.sponsorblock.SegmentPlaybackController;
|
||||
import app.revanced.extension.youtube.videoplayer.PlayerControlButton;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class CreateSegmentButton {
|
||||
|
||||
private static final int DRAWABLE_SB_LOGO = Utils.getResourceIdentifierOrThrow(
|
||||
ResourceType.DRAWABLE, BaseSettings.SETTINGS_DISABLE_BOLD_ICONS.get()
|
||||
? "revanced_sb_logo"
|
||||
: "revanced_sb_logo_bold"
|
||||
);
|
||||
|
||||
@Nullable
|
||||
private static PlayerControlButton instance;
|
||||
|
||||
@@ -31,6 +42,14 @@ public class CreateSegmentButton {
|
||||
v -> SponsorBlockViewController.toggleNewSegmentLayoutVisibility(),
|
||||
null
|
||||
);
|
||||
|
||||
// FIXME: Bold YT player icons are currently forced off.
|
||||
// Enable this logic when the new player icons are not forced off.
|
||||
ImageView icon = Utils.getChildViewByResourceName(controlsView,
|
||||
"revanced_sb_create_segment_button");
|
||||
if (false) {
|
||||
icon.setImageResource(DRAWABLE_SB_LOGO);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Logger.printException(() -> "initialize failure", ex);
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ private val sponsorBlockResourcePatch = resourcePatch {
|
||||
"revanced_sb_edit.xml",
|
||||
"revanced_sb_forward.xml",
|
||||
"revanced_sb_logo.xml",
|
||||
"revanced_sb_logo_bold.xml",
|
||||
"revanced_sb_publish.xml",
|
||||
"revanced_sb_voting.xml",
|
||||
)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<!--
|
||||
https://github.com/ajayyy/SponsorBlock/blob/e1d656f43f8b3cfb40e1c521e4103d61db756872/public/icons/PlayerStartIconSponsorBlocker.svg
|
||||
Changes made: The SponsorBlock logo was inverted.
|
||||
https://github.com/ajayyy/SponsorBlock/blob/e1d656f43f8b3cfb40e1c521e4103d61db756872/public/icons/PlayerStartIconSponsorBlocker.svg
|
||||
Changes made: The SponsorBlock logo was inverted.
|
||||
|
||||
Copyright 2021 Ajay Ramachandran <dev@ajay.app>
|
||||
Copyright 2021 Ajay Ramachandran <dev@ajay.app>
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M 12.000145,2.0000008 C 8.8230689,1.9990926 5.6959192,2.7864027 2.9017488,4.2906678 2.3373945,4.5948398 1.9899198,5.1860103 2.000223,5.8244635 2.0930396,12.358829 5.4926743,18.31271 11.094442,21.749998 c 0.557183,0.333336 1.253849,0.333336 1.811031,0 5.601767,-3.438045 9.001096,-9.391169 9.094295,-15.9255345 0.01052,-0.6386247 -0.337035,-1.2300179 -0.9016,-1.5341683 -2.794107,-1.5040456 -5.92111,-2.2912233 -9.098023,-2.2902944 z m 0.08082,0.8705548 c 3.003625,0.013255 5.957553,0.7636027 8.599879,2.1845129 0.277414,0.151228 0.448533,0.4421907 0.44513,0.7568723 C 21.034684,12.23921 17.58825,17.8544 12.446767,21.009378 c -0.274165,0.167124 -0.619386,0.167124 -0.893551,0 C 6.4117365,17.854399 2.9652339,12.239209 2.8739372,5.8119397 2.8705209,5.4972741 3.0416092,5.2063196 3.3189962,5.0550685 6.0095892,3.608201 9.0224769,2.8570356 12.080969,2.8705556 Z M 9.6351953,6.7701615 v 8.3406435 l 7.2606727,-4.170358 z"/>
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M 12.000145,2.0000008 C 8.8230689,1.9990926 5.6959192,2.7864027 2.9017488,4.2906678 2.3373945,4.5948398 1.9899198,5.1860103 2.000223,5.8244635 2.0930396,12.358829 5.4926743,18.31271 11.094442,21.749998 c 0.557183,0.333336 1.253849,0.333336 1.811031,0 5.601767,-3.438045 9.001096,-9.391169 9.094295,-15.9255345 0.01052,-0.6386247 -0.337035,-1.2300179 -0.9016,-1.5341683 -2.794107,-1.5040456 -5.92111,-2.2912233 -9.098023,-2.2902944 z m 0.08082,0.8705548 c 3.003625,0.013255 5.957553,0.7636027 8.599879,2.1845129 0.277414,0.151228 0.448533,0.4421907 0.44513,0.7568723 C 21.034684,12.23921 17.58825,17.8544 12.446767,21.009378 c -0.274165,0.167124 -0.619386,0.167124 -0.893551,0 C 6.4117365,17.854399 2.9652339,12.239209 2.8739372,5.8119397 2.8705209,5.4972741 3.0416092,5.2063196 3.3189962,5.0550685 6.0095892,3.608201 9.0224769,2.8570356 12.080969,2.8705556 Z M 9.6351953,6.7701615 v 8.3406435 l 7.2606727,-4.170358 z" />
|
||||
</vector>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<!--
|
||||
https://github.com/ajayyy/SponsorBlock/blob/e1d656f43f8b3cfb40e1c521e4103d61db756872/public/icons/PlayerStartIconSponsorBlocker.svg
|
||||
Changes made: The SponsorBlock logo was inverted.
|
||||
|
||||
Copyright 2021 Ajay Ramachandran <dev@ajay.app>
|
||||
-->
|
||||
<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="@android:color/white"
|
||||
android:pathData="M1.99219,3.51563 C1.37141,3.8503,0.988667,4.49868,1,5.20117 C1.1021,12.3909,4.8421,18.9426,11.0039,22.7246 C11.6168,23.0914,12.3832,23.0914,12.9961,22.7246 C19.1579,18.9417,22.8975,12.3909,23,5.20117 C23.0116,4.49849,22.6288,3.85028,22.0078,3.51563 C15.7798,0.162157,8.20704,0.168825,1.99219,3.51563 Z M20.5723,5.00586 C20.8388,5.151,21.0033,5.52221,21,5.82422 C20.9123,11.9927,17.3689,17.7513,12.4297,20.7793 C12.1663,20.9397,11.8337,20.9397,11.5703,20.7793 C6.63106,17.7513,3.08771,11.9927,3,5.82422 C2.99672,5.52222,3.18352,5.14551,3.42773,5.00586 C8.3842,2.1716,15.408,2.23147,20.5723,5.00586 Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M9.635,7.47461 L9.635,14.4066 C9.63455,14.952,10.1735,15.2913,10.6008,15.0145 L16.0542,11.4863 L16.897,10.9413 L16.0542,10.3954 L10.6004,6.86715 C10.1733,6.59109,9.63507,6.92975,9.635,7.47461 Z" />
|
||||
</vector>
|
||||
Reference in New Issue
Block a user