Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Commit ac262a8

Browse files
committed
feat(YouTube/Navigation bar components): add Enable translucent navigation bar settings inotia00/ReVanced_Extended#2177
1 parent 2763611 commit ac262a8

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

app/src/main/java/app/revanced/integrations/youtube/patches/general/GeneralPatch.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ public static boolean enableNarrowNavigationButton(boolean original) {
309309
return Settings.ENABLE_NARROW_NAVIGATION_BUTTONS.get() || original;
310310
}
311311

312+
public static boolean enableTranslucentNavigationBar() {
313+
return Settings.ENABLE_TRANSLUCENT_NAVIGATION_BAR.get();
314+
}
315+
312316
public static boolean switchCreateWithNotificationButton(boolean original) {
313317
return Settings.SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON.get() || original;
314318
}

app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public class Settings extends BaseSettings {
169169
public static final BooleanSetting HIDE_NAVIGATION_SUBSCRIPTIONS_BUTTON = new BooleanSetting("revanced_hide_navigation_subscriptions_button", FALSE, true);
170170
public static final BooleanSetting HIDE_NAVIGATION_LABEL = new BooleanSetting("revanced_hide_navigation_label", FALSE, true);
171171
public static final BooleanSetting SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON = new BooleanSetting("revanced_switch_create_with_notifications_button", TRUE, true);
172+
public static final BooleanSetting ENABLE_TRANSLUCENT_NAVIGATION_BAR = new BooleanSetting("revanced_enable_translucent_navigation_bar", FALSE, true);
172173

173174
// PreferenceScreen: General - Settings menu
174175
public static final BooleanSetting HIDE_SETTINGS_MENU = new BooleanSetting("revanced_hide_settings_menu", FALSE);

app/src/main/java/app/revanced/integrations/youtube/settings/preference/ReVancedSettingsPreference.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static app.revanced.integrations.youtube.utils.ExtendedUtils.isSpoofingToLessThan;
44

55
import android.app.Activity;
6+
import android.os.Build;
67
import android.preference.Preference;
78

89
import androidx.annotation.NonNull;
@@ -188,6 +189,10 @@ private static void NavigationPreferenceLinks() {
188189
Settings.REPLACE_TOOLBAR_CREATE_BUTTON,
189190
Settings.REPLACE_TOOLBAR_CREATE_BUTTON_TYPE
190191
);
192+
enableDisablePreferences(
193+
Build.VERSION.SDK_INT < 31,
194+
Settings.ENABLE_TRANSLUCENT_NAVIGATION_BAR
195+
);
191196
}
192197

193198
/**

0 commit comments

Comments
 (0)