Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/src/main/java/app/revanced/manager/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class MainActivity : ComponentActivity() {
)
val theme by vm.prefs.theme.getAsState()
val dynamicColor by vm.prefs.dynamicColor.getAsState()
val pureBlackTheme by vm.prefs.pureBlackTheme.getAsState()

EventEffect(vm.legacyImportActivityFlow) {
try {
Expand All @@ -91,7 +92,8 @@ class MainActivity : ComponentActivity() {

ReVancedManagerTheme(
darkTheme = theme == Theme.SYSTEM && isSystemInDarkTheme() || theme == Theme.DARK,
dynamicColor = dynamicColor
dynamicColor = dynamicColor,
pureBlackTheme = pureBlackTheme
) {
ReVancedManager(vm)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class PreferencesManager(
context: Context
) : BasePreferencesManager(context, "settings") {
val dynamicColor = booleanPreference("dynamic_color", true)
val pureBlackTheme = booleanPreference("pure_black_theme", false)
val theme = enumPreference("theme", Theme.SYSTEM)

val api = stringPreference("api_url", "https://api.revanced.app")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.revanced.manager.ui.screen.settings

import android.os.Build
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -96,6 +97,14 @@ fun GeneralSettingsScreen(
description = R.string.dynamic_color_description
)
}
AnimatedVisibility(theme != Theme.LIGHT) {
BooleanItem(
preference = prefs.pureBlackTheme,
coroutineScope = coroutineScope,
headline = R.string.pure_black_theme,
description = R.string.pure_black_theme_description
)
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/app/revanced/manager/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private val LightColorScheme = lightColorScheme(
fun ReVancedManagerTheme(
darkTheme: Boolean,
dynamicColor: Boolean,
pureBlackTheme: Boolean,
content: @Composable () -> Unit
) {
val colorScheme = when {
Expand All @@ -93,6 +94,10 @@ fun ReVancedManagerTheme(

darkTheme -> DarkColorScheme
else -> LightColorScheme
}.let {
if (darkTheme && pureBlackTheme)
it.copy(background = Color.Black, surface = Color.Black)
else it
}

val view = LocalView.current
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
<string name="contributors_description">View the contributors of ReVanced</string>
<string name="dynamic_color">Dynamic color</string>
<string name="dynamic_color_description">Adapt colors to the wallpaper</string>
<string name="pure_black_theme">Pure black theme</string>
<string name="pure_black_theme_description">Use pure black backgrounds for dark theme</string>
<string name="theme">Theme</string>
<string name="theme_description">Choose between light or dark theme</string>
<string name="safeguards">Safeguards</string>
Expand Down
Loading