Skip to content

Commit

Permalink
feat(YouTube - Navigation bar components): Add `Disable translucent s…
Browse files Browse the repository at this point in the history
…tatus bar` setting
  • Loading branch information
inotia00 authored and anddea committed Dec 21, 2024
1 parent efeb5fb commit fe09dbc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ public static void hideNavigationBar(View view) {
hideViewUnderCondition(Settings.HIDE_NAVIGATION_BAR.get(), view);
}

public static boolean useTranslucentNavigationStatusBar(boolean original) {
if (Settings.DISABLE_TRANSLUCENT_STATUS_BAR.get()) {
return false;
}

return original;
}

private static final Boolean DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT
= Settings.DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT.get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public class Settings extends BaseSettings {
new ChangeStartPagePatch.ChangeStartPageTypeAvailability());
public static final BooleanSetting DISABLE_AUTO_AUDIO_TRACKS = new BooleanSetting("revanced_disable_auto_audio_tracks", FALSE);
public static final BooleanSetting DISABLE_SPLASH_ANIMATION = new BooleanSetting("revanced_disable_splash_animation", FALSE, true);
public static final BooleanSetting DISABLE_TRANSLUCENT_STATUS_BAR = new BooleanSetting("revanced_disable_translucent_status_bar", FALSE, true);
public static final BooleanSetting ENABLE_GRADIENT_LOADING_SCREEN = new BooleanSetting("revanced_enable_gradient_loading_screen", FALSE, true);
public static final BooleanSetting HIDE_FLOATING_MICROPHONE = new BooleanSetting("revanced_hide_floating_microphone", TRUE, true);
public static final BooleanSetting HIDE_GRAY_SEPARATOR = new BooleanSetting("revanced_hide_gray_separator", TRUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ internal val setEnumMapFingerprint = legacyFingerprint(
literals = listOf(ytFillBell),
)

internal const val TRANSLUCENT_NAVIGATION_STATUS_BAR_FEATURE_FLAG = 45400535L

internal val translucentNavigationStatusBarFeatureFlagFingerprint = legacyFingerprint(
name = "translucentNavigationStatusBarFeatureFlagFingerprint",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "Z",
literals = listOf(TRANSLUCENT_NAVIGATION_STATUS_BAR_FEATURE_FLAG)
)

internal const val TRANSLUCENT_NAVIGATION_BUTTONS_FEATURE_FLAG = 45630927L

internal val translucentNavigationButtonsFeatureFlagFingerprint = legacyFingerprint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ val navigationBarComponentsPatch = bytecodePatch(

if (is_19_25_or_greater) {
arrayOf(
Triple(
translucentNavigationStatusBarFeatureFlagFingerprint,
TRANSLUCENT_NAVIGATION_STATUS_BAR_FEATURE_FLAG,
"useTranslucentNavigationStatusBar"
),
Triple(
translucentNavigationButtonsFeatureFlagFingerprint,
TRANSLUCENT_NAVIGATION_BUTTONS_FEATURE_FLAG,
Expand All @@ -103,6 +108,7 @@ val navigationBarComponentsPatch = bytecodePatch(
)
}

settingArray += "SETTINGS: DISABLE_TRANSLUCENT_STATUS_BAR"
settingArray += "SETTINGS: TRANSLUCENT_NAVIGATION_BAR"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
<!-- SETTINGS: DISABLE_SPLASH_ANIMATION
<SwitchPreference android:title="@string/revanced_disable_splash_animation_title" android:key="revanced_disable_splash_animation" android:summaryOn="@string/revanced_disable_splash_animation_summary_on" android:summaryOff="@string/revanced_disable_splash_animation_summary_off" />SETTINGS: DISABLE_SPLASH_ANIMATION -->

<!-- SETTINGS: DISABLE_TRANSLUCENT_STATUS_BAR
<SwitchPreference android:title="@string/revanced_disable_translucent_status_bar_title" android:key="revanced_disable_translucent_status_bar" android:summaryOn="@string/revanced_disable_translucent_status_bar_summary_on" android:summaryOff="@string/revanced_disable_translucent_status_bar_summary_off" />SETTINGS: DISABLE_TRANSLUCENT_STATUS_BAR -->

<!-- SETTINGS: ENABLE_GRADIENT_LOADING_SCREEN
<SwitchPreference android:title="@string/revanced_enable_gradient_loading_screen_title" android:key="revanced_enable_gradient_loading_screen" android:summaryOn="@string/revanced_enable_gradient_loading_screen_summary_on" android:summaryOff="@string/revanced_enable_gradient_loading_screen_summary_off" />SETTINGS: ENABLE_GRADIENT_LOADING_SCREEN -->

Expand Down

0 comments on commit fe09dbc

Please sign in to comment.