From 6bd0ac20dcfc76bfd044fb9f2f03ce98d6efc535 Mon Sep 17 00:00:00 2001 From: MarcaD <152095496+MarcaDian@users.noreply.github.com> Date: Sun, 19 May 2024 00:15:14 +0300 Subject: [PATCH] feat(YouTube - Navigation buttons): Add option to hide navigation button labels (#635) Co-authored-by: oSumAtrIX --- .../youtube/patches/NavigationButtonsPatch.java | 10 +++++++++- .../integrations/youtube/settings/Settings.java | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/NavigationButtonsPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/NavigationButtonsPatch.java index e7406abe..33e6bc3a 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/NavigationButtonsPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/NavigationButtonsPatch.java @@ -1,5 +1,6 @@ package app.revanced.integrations.youtube.patches; +import static app.revanced.integrations.shared.Utils.hideViewUnderCondition; import static app.revanced.integrations.youtube.shared.NavigationBar.NavigationButton; import android.view.View; @@ -7,7 +8,7 @@ import android.view.View; import java.util.EnumMap; import java.util.Map; -import app.revanced.integrations.shared.Logger; +import android.widget.TextView; import app.revanced.integrations.youtube.settings.Settings; @SuppressWarnings("unused") @@ -40,4 +41,11 @@ public final class NavigationButtonsPatch { tabView.setVisibility(View.GONE); } } + + /** + * Injection point. + */ + public static void hideNavigationButtonLabels(TextView navigationLabelsView) { + hideViewUnderCondition(Settings.HIDE_NAVIGATION_BUTTON_LABELS, navigationLabelsView); + } } diff --git a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java index 4af2ec73..b71e1809 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java @@ -187,6 +187,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_CREATE_BUTTON = new BooleanSetting("revanced_hide_create_button", TRUE, true); public static final BooleanSetting HIDE_SHORTS_BUTTON = new BooleanSetting("revanced_hide_shorts_button", TRUE, true); public static final BooleanSetting HIDE_SUBSCRIPTIONS_BUTTON = new BooleanSetting("revanced_hide_subscriptions_button", FALSE, true); + public static final BooleanSetting HIDE_NAVIGATION_BUTTON_LABELS = new BooleanSetting("revanced_hide_navigation_button_labels", FALSE, true); public static final BooleanSetting SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON = new BooleanSetting("revanced_switch_create_with_notifications_button", TRUE, true); // Shorts