parent
269b91a2b9
commit
5070050095
|
@ -103,7 +103,6 @@ tasks {
|
||||||
"ZCASH_RELEASE_PACKAGE_NAME" to "co.electriccoin.zcash",
|
"ZCASH_RELEASE_PACKAGE_NAME" to "co.electriccoin.zcash",
|
||||||
"ZCASH_SUPPORT_EMAIL_ADDRESS" to "support@electriccoin.co",
|
"ZCASH_SUPPORT_EMAIL_ADDRESS" to "support@electriccoin.co",
|
||||||
"IS_SECURE_SCREEN_PROTECTION_ACTIVE" to "true",
|
"IS_SECURE_SCREEN_PROTECTION_ACTIVE" to "true",
|
||||||
"IS_DARK_MODE_ENABLED" to "false",
|
|
||||||
"IS_SCREEN_ROTATION_ENABLED" to "false",
|
"IS_SCREEN_ROTATION_ENABLED" to "false",
|
||||||
|
|
||||||
"ZCASH_DEBUG_KEYSTORE_PATH" to "",
|
"ZCASH_DEBUG_KEYSTORE_PATH" to "",
|
||||||
|
|
|
@ -75,9 +75,6 @@ ZCASH_SUPPORT_EMAIL_ADDRESS=support@electriccoin.co
|
||||||
# Recommended protection of screens with sensitive data.
|
# Recommended protection of screens with sensitive data.
|
||||||
# It is enabled by default to protect the developers from revealing their wallet secrets by mistake.
|
# It is enabled by default to protect the developers from revealing their wallet secrets by mistake.
|
||||||
IS_SECURE_SCREEN_PROTECTION_ACTIVE=true
|
IS_SECURE_SCREEN_PROTECTION_ACTIVE=true
|
||||||
# Forcibly turn on or off the UI dark mode support. If enabled, then the device's dark mode system setting value is
|
|
||||||
# applied.
|
|
||||||
IS_DARK_MODE_ENABLED=false
|
|
||||||
# Set whether the screen rotation is enabled or the screen orientation is locked in the portrait mode.
|
# Set whether the screen rotation is enabled or the screen orientation is locked in the portrait mode.
|
||||||
IS_SCREEN_ROTATION_ENABLED=false
|
IS_SCREEN_ROTATION_ENABLED=false
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import com.android.build.api.variant.BuildConfigField
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.library")
|
id("com.android.library")
|
||||||
kotlin("android")
|
kotlin("android")
|
||||||
|
@ -30,20 +28,6 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
androidComponents {
|
|
||||||
onVariants { variant ->
|
|
||||||
// Configure dark mode support for the app runtime
|
|
||||||
variant.buildConfigFields.put(
|
|
||||||
"IS_APP_DARK_MODE_ENABLED",
|
|
||||||
BuildConfigField(
|
|
||||||
type = "boolean",
|
|
||||||
value = project.property("IS_DARK_MODE_ENABLED").toString(),
|
|
||||||
comment = "Whether is the app dark mode supported"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(libs.androidx.annotation)
|
implementation(libs.androidx.annotation)
|
||||||
implementation(libs.androidx.constraintlayout)
|
implementation(libs.androidx.constraintlayout)
|
||||||
|
|
|
@ -4,7 +4,6 @@ import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.CompositionLocalProvider
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
import co.electriccoin.zcash.ui.design.BuildConfig
|
|
||||||
import co.electriccoin.zcash.ui.design.theme.internal.DarkColorPalette
|
import co.electriccoin.zcash.ui.design.theme.internal.DarkColorPalette
|
||||||
import co.electriccoin.zcash.ui.design.theme.internal.DarkExtendedColorPalette
|
import co.electriccoin.zcash.ui.design.theme.internal.DarkExtendedColorPalette
|
||||||
import co.electriccoin.zcash.ui.design.theme.internal.ExtendedTypography
|
import co.electriccoin.zcash.ui.design.theme.internal.ExtendedTypography
|
||||||
|
@ -27,9 +26,7 @@ fun ZcashTheme(
|
||||||
forceDarkMode: Boolean = false,
|
forceDarkMode: Boolean = false,
|
||||||
content: @Composable () -> Unit
|
content: @Composable () -> Unit
|
||||||
) {
|
) {
|
||||||
// forceDarkMode takes precedence, then decides, based on the globally defined Gradle property
|
val useDarkMode = forceDarkMode || isSystemInDarkTheme()
|
||||||
// IS_APP_DARK_MODE_ENABLED, whether the device's system dark mode is on or off.
|
|
||||||
val useDarkMode = forceDarkMode || (BuildConfig.IS_APP_DARK_MODE_ENABLED && isSystemInDarkTheme())
|
|
||||||
|
|
||||||
val baseColors =
|
val baseColors =
|
||||||
if (useDarkMode) {
|
if (useDarkMode) {
|
||||||
|
|
Loading…
Reference in New Issue