feat(YouTube - Navigation buttons): Add option to hide navigation button labels (#635)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
MarcaD 2024-05-19 00:15:14 +03:00 committed by GitHub
parent 78cf116e58
commit 6bd0ac20dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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