diff --git a/gradle.properties b/gradle.properties index 07bab043..3f9887b7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -131,7 +131,7 @@ ZCASH_EMULATOR_WTF_API_KEY= # Optional absolute path to a Zcash SDK checkout. # When blank, it pulls the SDK from Maven. # When set, it uses the path for a Gradle included build. Path can either be absolute or relative to the root of this app's Gradle project. -SDK_INCLUDED_BUILD_PATH= +SDK_INCLUDED_BUILD_PATH=/Users/milancerovsky/Developer/zcash/zcash-android-wallet-sdk # When blank, it pulls the BIP-39 library from Maven. # When set, it uses the path for a Gradle included build. Path can either be absolute or relative to the root of this app's Gradle project. diff --git a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ExchangeRateColors.kt b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ExchangeRateColors.kt index 0575d052..709fff6e 100644 --- a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ExchangeRateColors.kt +++ b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ExchangeRateColors.kt @@ -3,9 +3,9 @@ package co.electriccoin.zcash.ui.design.theme import androidx.compose.runtime.Immutable -import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color +// TODO [#1555]: replace by new design system @Immutable data class ExchangeRateColors( val btnSecondaryBg: Color, @@ -29,6 +29,3 @@ internal val DarkExchangeRateColorPalette = btnSecondaryFg = Color(0xFFFFFFFF), btnSpinnerDisabled = Color(0xFF3D3A3B) ) - -@Suppress("CompositionLocalAllowlist") -internal val LocalExchangeRateColors = staticCompositionLocalOf { error("no colors specified") } diff --git a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZashiColors.kt b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZashiColors.kt index 4fe925a4..e64b8497 100644 --- a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZashiColors.kt +++ b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZashiColors.kt @@ -6,6 +6,7 @@ import androidx.compose.runtime.Immutable import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color +// TODO [#1555]: extract colors to separate file @Immutable data class ZashiColors( val textLight: Color, @@ -23,6 +24,7 @@ data class ZashiColors( val btnPrimaryFg: Color, val btnPrimaryFgDisabled: Color, val btnTextFg: Color, + val exchangeRateColors: ExchangeRateColors ) internal val LightZashiColorPalette = @@ -41,7 +43,8 @@ internal val LightZashiColorPalette = btnPrimaryBgDisabled = Color(0xFFEBEBE6), btnPrimaryFg = Color(0xFFFFFFFF), btnPrimaryFgDisabled = Color(0xFF94907B), - btnTextFg = Color(0xFF231F20) + btnTextFg = Color(0xFF231F20), + exchangeRateColors = LightExchangeRateColorPalette ) internal val DarkZashiColorPalette = @@ -60,7 +63,8 @@ internal val DarkZashiColorPalette = btnPrimaryBgDisabled = Color(0xFF343031), btnPrimaryFg = Color(0xFF231F20), btnPrimaryFgDisabled = Color(0xFF7E7C7C), - btnTextFg = Color(0xFFE8E8E8) + btnTextFg = Color(0xFFE8E8E8), + exchangeRateColors = DarkExchangeRateColorPalette ) @Suppress("CompositionLocalAllowlist") diff --git a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZcashTheme.kt b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZcashTheme.kt index 48b2fc25..85c3d5d2 100644 --- a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZcashTheme.kt +++ b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/theme/ZcashTheme.kt @@ -30,12 +30,10 @@ fun ZcashTheme( val baseColors = if (useDarkMode) DarkColorPalette else LightColorPalette val extendedColors = if (useDarkMode) DarkExtendedColorPalette else LightExtendedColorPalette val zashiColors = if (useDarkMode) DarkZashiColorPalette else LightZashiColorPalette - val exchangeRateColors = if (useDarkMode) DarkExchangeRateColorPalette else LightExchangeRateColorPalette CompositionLocalProvider( LocalExtendedColors provides extendedColors, LocalZashiColors provides zashiColors, - LocalExchangeRateColors provides exchangeRateColors, ) { ProvideDimens { MaterialTheme( @@ -70,8 +68,4 @@ object ZcashTheme { val zashiColors: ZashiColors @Composable get() = LocalZashiColors.current - - val exchangeRateColors: ExchangeRateColors - @Composable - get() = LocalExchangeRateColors.current } diff --git a/ui-lib/build.gradle.kts b/ui-lib/build.gradle.kts index a2524a60..3dd34bde 100644 --- a/ui-lib/build.gradle.kts +++ b/ui-lib/build.gradle.kts @@ -122,7 +122,6 @@ dependencies { implementation(projects.sdkExtLib) implementation(projects.spackleAndroidLib) api(projects.uiDesignLib) - implementation("androidx.graphics:graphics-shapes-android:1.0.0-rc01") androidTestImplementation(projects.testLib) androidTestImplementation(libs.bundles.androidx.test) diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/exchangerate/widget/StyledExchangeBalance.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/exchangerate/widget/StyledExchangeBalance.kt index c236fded..e168cd0d 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/exchangerate/widget/StyledExchangeBalance.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/exchangerate/widget/StyledExchangeBalance.kt @@ -65,7 +65,7 @@ fun StyledExchangeBalance( isHideBalances: Boolean = false, hiddenBalancePlaceholder: StringResource = stringRes(co.electriccoin.zcash.ui.design.R.string.hide_balance_placeholder), - textColor: Color = ZcashTheme.exchangeRateColors.btnSecondaryFg, + textColor: Color = ZcashTheme.zashiColors.exchangeRateColors.btnSecondaryFg, style: TextStyle = ZcashTheme.typography.primary.titleSmall.copy(fontWeight = FontWeight.SemiBold) ) { when (state) { @@ -161,7 +161,7 @@ private fun ExchangeAvailableRateLabelInternal( if (state.isRefreshEnabled) { textColor } else { - ZcashTheme.exchangeRateColors.btnSpinnerDisabled + ZcashTheme.zashiColors.exchangeRateColors.btnSpinnerDisabled } ) ) @@ -275,7 +275,7 @@ private fun ExchangeRateButton( ButtonDefaults.elevatedButtonColors( containerColor = if (isEnabled && enableBorder) { - ZcashTheme.exchangeRateColors.btnSecondaryBg + ZcashTheme.zashiColors.exchangeRateColors.btnSecondaryBg } else { Color.Unspecified }, @@ -285,7 +285,7 @@ private fun ExchangeRateButton( ), border = if (isEnabled && enableBorder) { - BorderStroke(1.dp, ZcashTheme.exchangeRateColors.btnSecondaryBorder) + BorderStroke(1.dp, ZcashTheme.zashiColors.exchangeRateColors.btnSecondaryBorder) } else { BorderStroke(1.dp, Color.Transparent) },