1
mirror of https://github.com/revanced/revanced-integrations synced 2025-11-21 18:35:37 +01:00

Compare commits

...

4 Commits

Author SHA1 Message Date
semantic-release-bot
12c7c6844b chore(release): 0.107.0 [skip ci]
# [0.107.0](https://github.com/revanced/revanced-integrations/compare/v0.106.0...v0.107.0) (2023-05-02)

### Bug Fixes

* **youtube/theme:** set correct default seekbar color ([a91b036](a91b0363a8))

### Features

* **youtube/theme:** change seekbar color via preference ([1185cee](1185ceedf7))
* **youtube:** `navigation-buttons` patch ([68f42fc](68f42fc980))
2023-05-02 05:48:50 +00:00
oSumAtrIX
9b47361af4 chore: merge branch dev to main (#380) 2023-05-02 07:46:36 +02:00
semantic-release-bot
8ba636a910 chore(release): 0.107.0-dev.3 [skip ci]
# [0.107.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.107.0-dev.2...v0.107.0-dev.3) (2023-05-02)

### Features

* **youtube:** `navigation-buttons` patch ([68f42fc](68f42fc980))
2023-05-02 05:40:00 +00:00
oSumAtrIX
68f42fc980 feat(youtube): navigation-buttons patch 2023-05-02 07:37:40 +02:00
7 changed files with 69 additions and 41 deletions

View File

@@ -1,3 +1,23 @@
# [0.107.0](https://github.com/revanced/revanced-integrations/compare/v0.106.0...v0.107.0) (2023-05-02)
### Bug Fixes
* **youtube/theme:** set correct default seekbar color ([a91b036](https://github.com/revanced/revanced-integrations/commit/a91b0363a8aca4e195c9da4e48e2c332c1b1a7a6))
### Features
* **youtube/theme:** change seekbar color via preference ([1185cee](https://github.com/revanced/revanced-integrations/commit/1185ceedf7fdb40759261ae8560e79604c8cb743))
* **youtube:** `navigation-buttons` patch ([68f42fc](https://github.com/revanced/revanced-integrations/commit/68f42fc9800210f6c4d6f8e85c0132bf0cbc06d3))
# [0.107.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.107.0-dev.2...v0.107.0-dev.3) (2023-05-02)
### Features
* **youtube:** `navigation-buttons` patch ([68f42fc](https://github.com/revanced/revanced-integrations/commit/68f42fc9800210f6c4d6f8e85c0132bf0cbc06d3))
# [0.107.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.107.0-dev.1...v0.107.0-dev.2) (2023-05-02)

View File

@@ -1,16 +0,0 @@
package app.revanced.integrations.patches;
import android.view.View;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
public class HideCreateButtonPatch {
//Used by app.revanced.patches.youtube.layout.createbutton.patch.CreateButtonRemoverPatch
public static void hideCreateButton(View view) {
boolean hidden = SettingsEnum.HIDE_CREATE_BUTTON.getBoolean();
LogHelper.printDebug(() -> "Create button: " + (hidden ? "hidden" : "shown"));
view.setVisibility(hidden ? View.GONE : View.VISIBLE);
}
}

View File

@@ -1,24 +0,0 @@
package app.revanced.integrations.patches;
import android.view.View;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
public class HideShortsButtonPatch {
// Used by app.revanced.patches.youtube.layout.shorts.button.patch.ShortsButtonRemoverPatch
public static void hideShortsButton(View view) {
if (lastPivotTab != null && lastPivotTab.name() == "TAB_SHORTS") {
boolean hide = SettingsEnum.HIDE_SHORTS_BUTTON.getBoolean();
LogHelper.printDebug(() -> hide ? "Shorts button: hidden" : "Shorts button: shown");
if (hide) {
view.setVisibility(View.GONE);
}
}
}
//Needed for the ShortsButtonRemoverPatch
public static Enum lastPivotTab;
}

View File

@@ -0,0 +1,38 @@
package app.revanced.integrations.patches;
import android.view.View;
import app.revanced.integrations.settings.SettingsEnum;
public final class NavigationButtonsPatch {
public static Enum lastNavigationButton;
public static void hideCreateButton(final View view) {
view.setVisibility(SettingsEnum.HIDE_CREATE_BUTTON.getBoolean() ? View.GONE : View.VISIBLE);
}
public static boolean switchCreateWithNotificationButton() {
return SettingsEnum.SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON.getBoolean();
}
public static void hideButton(final View buttonView) {
if (lastNavigationButton == null) return;
for (NavigationButton button : NavigationButton.values())
if (button.name.equals(lastNavigationButton.name()))
if (button.enabled) buttonView.setVisibility(View.GONE);
}
private enum NavigationButton {
HOME("PIVOT_HOME", SettingsEnum.HIDE_HOME_BUTTON.getBoolean()),
SHORTS("TAB_SHORTS", SettingsEnum.HIDE_SHORTS_BUTTON.getBoolean()),
SUBSCRIPTIONS("PIVOT_SUBSCRIPTIONS", SettingsEnum.HIDE_SUBSCRIPTIONS_BUTTON.getBoolean());
private final boolean enabled;
private final String name;
NavigationButton(final String name, final boolean enabled) {
this.name = name;
this.enabled = enabled;
}
}
}

View File

@@ -7,11 +7,18 @@ import app.revanced.integrations.utils.ReVancedUtils;
public final class ThemePatch {
public static final int DEFAULT_SEEKBAR_COLOR = 0xffff0000;
public static final int ORIGINAL_SEEKBAR_CLICKED_COLOR = -65536;
private static void resetSeekbarColor() {
ReVancedUtils.showToastShort("Invalid seekbar color value. Using default value.");
SettingsEnum.SEEKBAR_COLOR.saveValue("#" + Integer.toHexString(DEFAULT_SEEKBAR_COLOR));
}
public static int getSeekbarClickedColorValue(final int colorValue) {
// YouTube uses a specific color when the seekbar is clicked. Override in that case.
return colorValue == ORIGINAL_SEEKBAR_CLICKED_COLOR ? getSeekbarColorValue() : colorValue;
}
public static int getSeekbarColorValue() {
try {
return Color.parseColor(SettingsEnum.SEEKBAR_COLOR.getString());

View File

@@ -83,6 +83,7 @@ public enum SettingsEnum {
HIDE_CAST_BUTTON("revanced_hide_cast_button", BOOLEAN, TRUE, true),
HIDE_COMMENTS_SECTION("revanced_hide_comments_section", BOOLEAN, FALSE, true),
HIDE_CREATE_BUTTON("revanced_hide_create_button", BOOLEAN, TRUE, true),
SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON("revanced_switch_create_with_notifications_button", BOOLEAN, TRUE, true),
HIDE_CROWDFUNDING_BOX("revanced_hide_crowdfunding_box", BOOLEAN, FALSE, true),
HIDE_EMAIL_ADDRESS("revanced_hide_email_address", BOOLEAN, FALSE),
HIDE_ENDSCREEN_CARDS("revanced_hide_endscreen_cards", BOOLEAN, TRUE),
@@ -93,7 +94,9 @@ public enum SettingsEnum {
HIDE_PLAYER_BUTTONS("revanced_hide_player_buttons", BOOLEAN, FALSE),
HIDE_PREVIEW_COMMENT("revanced_hide_preview_comment", BOOLEAN, FALSE, true),
HIDE_SEEKBAR("revanced_hide_seekbar", BOOLEAN, FALSE),
HIDE_HOME_BUTTON("revanced_hide_home_button", BOOLEAN, FALSE, true),
HIDE_SHORTS_BUTTON("revanced_hide_shorts_button", BOOLEAN, TRUE, true),
HIDE_SUBSCRIPTIONS_BUTTON("revanced_hide_subscriptions_button", BOOLEAN, FALSE, true),
HIDE_SHORTS_COMMENTS_BUTTON("revanced_hide_shorts_comments_button", BOOLEAN, FALSE),
HIDE_TIMESTAMP("revanced_hide_timestamp", BOOLEAN, FALSE),
HIDE_VIDEO_WATERMARK("revanced_hide_video_watermark", BOOLEAN, TRUE),

View File

@@ -1,3 +1,3 @@
org.gradle.jvmargs = -Xmx2048m
android.useAndroidX = true
version = 0.107.0-dev.2
version = 0.107.0