Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
feat(youtube/hide-shorts-components): hide navigation bar
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed May 18, 2023
1 parent 5ec90db commit ac13d10
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
import static app.revanced.integrations.utils.ReVancedUtils.hideViewBy1dpUnderCondition;
import static app.revanced.integrations.utils.ReVancedUtils.hideViewUnderCondition;

import android.annotation.SuppressLint;
import android.os.Build;
import android.view.View;

import com.google.android.libraries.youtube.rendering.ui.pivotbar.PivotBar;

import app.revanced.integrations.settings.SettingsEnum;

public final class ShortsFilter extends Filter {
public static PivotBar pivotBar;
@SuppressLint("StaticFieldLeak")

private final StringFilterGroup reelChannelBar = new StringFilterGroup(
null,
"reel_channel_bar"
Expand Down Expand Up @@ -69,4 +75,18 @@ public static void hideShortsRemixButton(final View remixButtonView) {
public static void hideShortsShareButton(final View shareButtonView) {
hideViewUnderCondition(SettingsEnum.HIDE_SHORTS_SHARE_BUTTON, shareButtonView);
}

public static void hideNavigationBar() {
if (!SettingsEnum.HIDE_SHORTS_NAVIGATION_BAR.getBoolean()) return;
if (pivotBar == null) return;

pivotBar.setVisibility(View.GONE);
}

public static View hideNavigationBar(final View navigationBarView) {
if (SettingsEnum.HIDE_SHORTS_NAVIGATION_BAR.getBoolean())
return null; // Hides the navigation bar.

return navigationBarView;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public enum SettingsEnum {
HIDE_SHORTS_COMMENTS_BUTTON("revanced_hide_shorts_comments_button", BOOLEAN, FALSE),
HIDE_SHORTS_REMIX_BUTTON("revanced_hide_shorts_remix_button", BOOLEAN, FALSE),
HIDE_SHORTS_SHARE_BUTTON("revanced_hide_shorts_share_button", BOOLEAN, FALSE),
HIDE_SHORTS_NAVIGATION_BAR("revanced_hide_shorts_navigation_bar", BOOLEAN, TRUE, true),
HIDE_SHORTS("revanced_hide_shorts", BOOLEAN, FALSE, true),

// Misc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.google.android.libraries.youtube.rendering.ui.pivotbar;

import android.content.Context;
import android.widget.HorizontalScrollView;

public class PivotBar extends HorizontalScrollView {
public PivotBar(Context context) {
super(context);
}
}

0 comments on commit ac13d10

Please sign in to comment.