File tree Expand file tree Collapse file tree 5 files changed +20
-1
lines changed
java/app/revanced/manager Expand file tree Collapse file tree 5 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ class MainActivity : ComponentActivity() {
8181 )
8282 val theme by vm.prefs.theme.getAsState()
8383 val dynamicColor by vm.prefs.dynamicColor.getAsState()
84+ val pureBlackTheme by vm.prefs.pureBlackTheme.getAsState()
8485
8586 EventEffect (vm.legacyImportActivityFlow) {
8687 try {
@@ -91,7 +92,8 @@ class MainActivity : ComponentActivity() {
9192
9293 ReVancedManagerTheme (
9394 darkTheme = theme == Theme .SYSTEM && isSystemInDarkTheme() || theme == Theme .DARK ,
94- dynamicColor = dynamicColor
95+ dynamicColor = dynamicColor,
96+ pureBlackTheme = pureBlackTheme
9597 ) {
9698 ReVancedManager (vm)
9799 }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class PreferencesManager(
99 context : Context
1010) : BasePreferencesManager(context, " settings" ) {
1111 val dynamicColor = booleanPreference(" dynamic_color" , true )
12+ val pureBlackTheme = booleanPreference(" pure_black_theme" , false )
1213 val theme = enumPreference(" theme" , Theme .SYSTEM )
1314
1415 val api = stringPreference(" api_url" , " https://api.revanced.app" )
Original file line number Diff line number Diff line change 11package app.revanced.manager.ui.screen.settings
22
33import android.os.Build
4+ import androidx.compose.animation.AnimatedVisibility
45import androidx.compose.foundation.clickable
56import androidx.compose.foundation.layout.Column
67import androidx.compose.foundation.layout.Row
@@ -96,6 +97,14 @@ fun GeneralSettingsScreen(
9697 description = R .string.dynamic_color_description
9798 )
9899 }
100+ AnimatedVisibility (theme != Theme .LIGHT ) {
101+ BooleanItem (
102+ preference = prefs.pureBlackTheme,
103+ coroutineScope = coroutineScope,
104+ headline = R .string.pure_black_theme,
105+ description = R .string.pure_black_theme_description
106+ )
107+ }
99108 }
100109 }
101110}
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ private val LightColorScheme = lightColorScheme(
8080fun ReVancedManagerTheme (
8181 darkTheme : Boolean ,
8282 dynamicColor : Boolean ,
83+ pureBlackTheme : Boolean ,
8384 content : @Composable () -> Unit
8485) {
8586 val colorScheme = when {
@@ -93,6 +94,10 @@ fun ReVancedManagerTheme(
9394
9495 darkTheme -> DarkColorScheme
9596 else -> LightColorScheme
97+ }.let {
98+ if (darkTheme && pureBlackTheme)
99+ it.copy(background = Color .Black , surface = Color .Black )
100+ else it
96101 }
97102
98103 val view = LocalView .current
Original file line number Diff line number Diff line change 8686 <string name =" contributors_description" >View the contributors of ReVanced</string >
8787 <string name =" dynamic_color" >Dynamic color</string >
8888 <string name =" dynamic_color_description" >Adapt colors to the wallpaper</string >
89+ <string name =" pure_black_theme" >Pure black theme</string >
90+ <string name =" pure_black_theme_description" >Use pure black backgrounds for dark theme</string >
8991 <string name =" theme" >Theme</string >
9092 <string name =" theme_description" >Choose between light or dark theme</string >
9193 <string name =" safeguards" >Safeguards</string >
You can’t perform that action at this time.
0 commit comments