mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
feat(YouTube - Navigation bar components): Remove settings Disable translucent status bar
, Disable light translucent bar
and Disable dark translucent bar
This commit is contained in:
@ -462,16 +462,6 @@ public class Utils {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isDarkModeEnabled() {
|
||||
return isDarkModeEnabled(context);
|
||||
}
|
||||
|
||||
public static boolean isDarkModeEnabled(Context context) {
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
final int currentNightMode = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
return currentNightMode == Configuration.UI_MODE_NIGHT_YES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether the device's API level is higher than a specific SDK version.
|
||||
*/
|
||||
|
@ -5,7 +5,6 @@ import static app.revanced.extension.shared.utils.Utils.getChildView;
|
||||
import static app.revanced.extension.shared.utils.Utils.hideViewByLayoutParams;
|
||||
import static app.revanced.extension.shared.utils.Utils.hideViewGroupByMarginLayoutParams;
|
||||
import static app.revanced.extension.shared.utils.Utils.hideViewUnderCondition;
|
||||
import static app.revanced.extension.shared.utils.Utils.isSDKAbove;
|
||||
import static app.revanced.extension.youtube.patches.utils.PatchStatus.ImageSearchButton;
|
||||
import static app.revanced.extension.youtube.shared.NavigationBar.NavigationButton;
|
||||
|
||||
@ -245,48 +244,6 @@ public class GeneralPatch {
|
||||
hideViewUnderCondition(Settings.HIDE_NAVIGATION_BAR.get(), view);
|
||||
}
|
||||
|
||||
public static boolean useTranslucentNavigationStatusBar(boolean original) {
|
||||
try {
|
||||
if (Settings.DISABLE_TRANSLUCENT_STATUS_BAR.get()) {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Logger.printException(() -> "Failed to load useTranslucentNavigationStatusBar", ex);
|
||||
}
|
||||
|
||||
return original;
|
||||
}
|
||||
|
||||
private static final Boolean DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT
|
||||
= Settings.DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT.get();
|
||||
|
||||
private static final Boolean DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK
|
||||
= Settings.DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK.get();
|
||||
|
||||
public static boolean useTranslucentNavigationButtons(boolean original) {
|
||||
try {
|
||||
// Feature requires Android 13+
|
||||
if (!isSDKAbove(33)) {
|
||||
return original;
|
||||
}
|
||||
|
||||
if (!DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK && !DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT) {
|
||||
return original;
|
||||
}
|
||||
|
||||
if (DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK && DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Utils.isDarkModeEnabled()
|
||||
? !DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK
|
||||
: !DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT;
|
||||
} catch (Exception ex) {
|
||||
Logger.printException(() -> "Failed to load useTranslucentNavigationButtons", ex);
|
||||
}
|
||||
return original;
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region [Remove viewer discretion dialog] patch
|
||||
|
@ -147,7 +147,6 @@ 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);
|
||||
@ -190,8 +189,6 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_NAVIGATION_SUBSCRIPTIONS_BUTTON = new BooleanSetting("revanced_hide_navigation_subscriptions_button", FALSE, true);
|
||||
public static final BooleanSetting HIDE_NAVIGATION_LABEL = new BooleanSetting("revanced_hide_navigation_label", FALSE, true);
|
||||
public static final BooleanSetting SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON = new BooleanSetting("revanced_switch_create_with_notifications_button", TRUE, true, "revanced_switch_create_with_notifications_button_user_dialog_message");
|
||||
public static final BooleanSetting DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT = new BooleanSetting("revanced_disable_translucent_navigation_bar_light", FALSE, true);
|
||||
public static final BooleanSetting DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK = new BooleanSetting("revanced_disable_translucent_navigation_bar_dark", FALSE, true);
|
||||
public static final BooleanSetting HIDE_NAVIGATION_BAR = new BooleanSetting("revanced_hide_navigation_bar", FALSE, true);
|
||||
|
||||
// PreferenceScreen: General - Override buttons
|
||||
|
@ -203,11 +203,6 @@ public class ReVancedSettingsPreference extends ReVancedPreferenceFragment {
|
||||
Settings.REPLACE_TOOLBAR_CREATE_BUTTON,
|
||||
Settings.REPLACE_TOOLBAR_CREATE_BUTTON_TYPE
|
||||
);
|
||||
enableDisablePreferences(
|
||||
!isSDKAbove(33),
|
||||
Settings.DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT,
|
||||
Settings.DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user