[#1085] Grid pattern in the screen background

- Closes #1085
- Closes #1091
- These are prerequisites for the Dark mode adoption within #1011
- A few unused UI components have been removed to simplify the dark mode adoption
- BlankSurface and GridSurface have been added and used instead of the previous GradientSurface
- A new BlankBgScaffold, GridBgScaffold, BlankBgColumn, and GridBgColumn UI components have been prepared to provide an easy grid or blank screen background adoption across the whole app
- Several colors from resources have been eliminated, as the design doc simplified its color palette
- The grid pattern has been added to the screens according to the design doc and iOS platform
- Changelog updated
This commit is contained in:
Honza Rychnovský 2024-05-30 13:32:35 +02:00 committed by GitHub
parent fbf4a73208
commit 030d2e20b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 770 additions and 628 deletions

View File

@ -9,6 +9,12 @@ directly impact users rather than highlighting other key architectural updates.*
## [Unreleased] ## [Unreleased]
### Added
- Grid pattern background has been added to several screens
### Changed
- The color palette used across the app has been reworked to align with the updated design document
## [1.1 (655)] - 2024-05-24 ## [1.1 (655)] - 2024-05-24
### Added ### Added

View File

@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ButtonDefaults.buttonColors import androidx.compose.material3.ButtonDefaults.buttonColors
import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@ -48,14 +47,12 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun ButtonComposablePreview() { private fun ButtonComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
Column(Modifier.padding(ZcashTheme.dimens.spacingDefault)) { Column(Modifier.padding(ZcashTheme.dimens.spacingDefault)) {
PrimaryButton(onClick = { }, text = "Primary") PrimaryButton(onClick = { }, text = "Primary")
PrimaryButton(onClick = { }, text = "Primary...", showProgressBar = true) PrimaryButton(onClick = { }, text = "Primary...", showProgressBar = true)
PrimaryButton(onClick = { }, text = "Primary Small", minHeight = ZcashTheme.dimens.buttonHeightSmall) PrimaryButton(onClick = { }, text = "Primary Small", minHeight = ZcashTheme.dimens.buttonHeightSmall)
SecondaryButton(onClick = { }, text = "Secondary") SecondaryButton(onClick = { }, text = "Secondary")
TertiaryButton(onClick = { }, text = "Tertiary")
TertiaryButton(onClick = { }, text = "Tertiary", enabled = false)
NavigationButton(onClick = { }, text = "Navigation") NavigationButton(onClick = { }, text = "Navigation")
@Suppress("MagicNumber") @Suppress("MagicNumber")
Row { Row {
@ -257,41 +254,6 @@ fun NavigationButton(
} }
} }
@Composable
fun TertiaryButton(
onClick: () -> Unit,
text: String,
modifier: Modifier = Modifier,
outerPaddingValues: PaddingValues =
PaddingValues(
horizontal = ZcashTheme.dimens.spacingNone,
vertical = ZcashTheme.dimens.spacingSmall
),
enabled: Boolean = true
) {
Button(
shape = RectangleShape,
onClick = onClick,
modifier =
modifier.then(
Modifier
.fillMaxWidth()
.padding(outerPaddingValues)
.defaultMinSize(ZcashTheme.dimens.buttonWidth, ZcashTheme.dimens.buttonHeight)
),
enabled = enabled,
elevation = ButtonDefaults.buttonElevation(0.dp, 0.dp, 0.dp),
colors = buttonColors(containerColor = ZcashTheme.colors.tertiary)
) {
Text(
style = MaterialTheme.typography.labelLarge,
textAlign = TextAlign.Center,
text = text,
color = ZcashTheme.colors.onTertiary
)
}
}
@Suppress("LongParameterList") @Suppress("LongParameterList")
fun Modifier.shadow( fun Modifier.shadow(
contentColor: Color = Color.Black, contentColor: Color = Color.Black,

View File

@ -0,0 +1,64 @@
package co.electriccoin.zcash.ui.design.component
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Preview("Column with blank background")
@Composable
private fun BlankBgColumnComposablePreview() {
ZcashTheme(forceDarkMode = false) {
BlankBgColumn {
Text(text = "Blank background column")
}
}
}
@Preview("Column with grip pattern background")
@Composable
private fun GridBgScaffoldComposablePreview() {
ZcashTheme(forceDarkMode = false) {
GridBgColumn {
Text(text = "Grid pattern background column")
}
}
}
@Composable
fun BlankBgColumn(
modifier: Modifier = Modifier,
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
content: @Composable ColumnScope.() -> Unit
) {
Column(
modifier = modifier.then(Modifier.background(ZcashTheme.colors.backgroundColor)),
horizontalAlignment = horizontalAlignment,
verticalArrangement = verticalArrangement,
content = content,
)
}
@Composable
fun GridBgColumn(
modifier: Modifier = Modifier,
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
content: @Composable ColumnScope.() -> Unit
) {
GridSurface {
Column(
horizontalAlignment = horizontalAlignment,
verticalArrangement = verticalArrangement,
content = content,
modifier = modifier,
)
}
}

View File

@ -18,7 +18,7 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun TopScreenLogoRegularComposablePreview() { private fun TopScreenLogoRegularComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
TopScreenLogoTitle( TopScreenLogoTitle(
title = "Test screen title", title = "Test screen title",
logoContentDescription = "Test logo content description" logoContentDescription = "Test logo content description"
@ -31,7 +31,7 @@ private fun TopScreenLogoRegularComposablePreview() {
@Composable @Composable
private fun TopScreenLogoLongComposablePreview() { private fun TopScreenLogoLongComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
TopScreenLogoTitle( TopScreenLogoTitle(
title = "Test screen title which is very very long and can overflow the allowed title length", title = "Test screen title which is very very long and can overflow the allowed title length",
logoContentDescription = "Test logo content description" logoContentDescription = "Test logo content description"

View File

@ -1,24 +0,0 @@
package co.electriccoin.zcash.ui.design.component
import androidx.compose.foundation.background
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable
fun GradientSurface(
modifier: Modifier = Modifier,
content: @Composable () -> Unit
) {
Surface(
color = Color.Transparent,
modifier =
modifier
.background(ZcashTheme.colors.surfaceGradient()),
shape = RectangleShape,
content = content
)
}

View File

@ -21,7 +21,7 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun CircularScreenProgressIndicatorComposablePreview() { private fun CircularScreenProgressIndicatorComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
Column { Column {
CircularScreenProgressIndicator() CircularScreenProgressIndicator()
CircularMidProgressIndicator() CircularMidProgressIndicator()
@ -79,7 +79,7 @@ fun CircularSmallProgressIndicator(
@Composable @Composable
private fun LinearProgressIndicatorComposablePreview() { private fun LinearProgressIndicatorComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
@Suppress("MagicNumber") @Suppress("MagicNumber")
SmallLinearProgressIndicator(0.75f) SmallLinearProgressIndicator(0.75f)
} }

View File

@ -0,0 +1,68 @@
package co.electriccoin.zcash.ui.design.component
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Preview("Scaffold with blank background")
@Composable
private fun BlankBgScaffoldComposablePreview() {
ZcashTheme(forceDarkMode = false) {
BlankBgScaffold {
Text(text = "Blank background scaffold")
}
}
}
@Preview("Scaffold with grip pattern background")
@Composable
private fun GridBgScaffoldComposablePreview() {
ZcashTheme(forceDarkMode = false) {
GridBgScaffold {
Text(text = "Grid pattern background scaffold")
}
}
}
@Composable
fun BlankBgScaffold(
modifier: Modifier = Modifier,
topBar: @Composable () -> Unit = {},
bottomBar: @Composable () -> Unit = {},
snackbarHost: @Composable () -> Unit = {},
content: @Composable (PaddingValues) -> Unit
) {
Scaffold(
containerColor = ZcashTheme.colors.backgroundColor,
topBar = topBar,
snackbarHost = snackbarHost,
bottomBar = bottomBar,
content = content,
modifier = modifier,
)
}
@Composable
fun GridBgScaffold(
modifier: Modifier = Modifier,
topBar: @Composable () -> Unit = {},
bottomBar: @Composable () -> Unit = {},
snackbarHost: @Composable () -> Unit = {},
content: @Composable (PaddingValues) -> Unit
) {
GridSurface {
Scaffold(
containerColor = Color.Transparent,
topBar = topBar,
snackbarHost = snackbarHost,
bottomBar = bottomBar,
content = content,
modifier = modifier,
)
}
}

View File

@ -0,0 +1,116 @@
package co.electriccoin.zcash.ui.design.component
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Preview("Blank background")
@Composable
private fun BlankSurfacePreview() {
ZcashTheme(forceDarkMode = false) {
BlankSurface {
Text(
text = "Test text on the blank app background",
modifier = Modifier.fillMaxSize()
)
}
}
}
@Preview("Grid background")
@Composable
private fun GridSurfacePreview() {
ZcashTheme(forceDarkMode = false) {
GridSurface {
Text(
text = "Test text on the grip app background",
modifier = Modifier.fillMaxSize()
)
}
}
}
@Composable
fun BlankSurface(
modifier: Modifier = Modifier,
content: @Composable () -> Unit
) {
Surface(
color = ZcashTheme.colors.backgroundColor,
shape = RectangleShape,
content = content,
modifier = modifier
)
}
@Composable
fun GridSurface(
modifier: Modifier = Modifier,
content: @Composable () -> Unit
) {
Surface(
color = Color.Transparent,
shape = RectangleShape,
content = content,
modifier =
modifier.then(
Modifier
.gridBackground(
backgroundColor = ZcashTheme.colors.backgroundColor,
gridSize = ZcashTheme.dimens.gridCellSize,
gridColor = ZcashTheme.colors.gridColor,
gridLineWidth = ZcashTheme.dimens.gridLineWidth
)
)
)
}
fun Modifier.gridBackground(
backgroundColor: Color,
gridSize: Dp,
gridColor: Color,
gridLineWidth: Dp
): Modifier {
return then(
background(backgroundColor)
.drawBehind {
val gridWidth = size.width
val gridHeight = size.height
val stepX = gridSize.toPx()
val stepY = gridSize.toPx()
val xSteps = (gridWidth / stepX).toInt()
val ySteps = (gridHeight / stepY).toInt()
for (i in 0..xSteps) {
val x = i * stepX
drawLine(
start = Offset(x, 0f),
end = Offset(x, gridHeight),
color = gridColor,
strokeWidth = gridLineWidth.toPx()
)
}
for (i in 0..ySteps) {
val y = i * stepY
drawLine(
start = Offset(0f, y),
end = Offset(gridWidth, y),
color = gridColor,
strokeWidth = gridLineWidth.toPx()
)
}
}
)
}

View File

@ -42,7 +42,7 @@ import java.util.Locale
@Composable @Composable
private fun ReferenceComposablePreview() { private fun ReferenceComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
Column { Column {
Reference( Reference(
text = "Test reference text", text = "Test reference text",
@ -70,7 +70,7 @@ private fun ReferenceComposablePreview() {
@Composable @Composable
private fun StyledBalanceComposablePreview() { private fun StyledBalanceComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
Column { Column {
StyledBalance( StyledBalance(
balanceString = "1,234.56789012", balanceString = "1,234.56789012",
@ -411,7 +411,7 @@ fun BodyWithFiatCurrencySymbol(
@Composable @Composable
private fun NavigationTabTextPreview() { private fun NavigationTabTextPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
Column { Column {
NavigationTabText( NavigationTabText(
text = "Account", text = "Account",
@ -443,7 +443,7 @@ fun NavigationTabText(
}, },
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Visible, overflow = TextOverflow.Visible,
color = ZcashTheme.colors.tabTextColor, color = ZcashTheme.colors.textCommon,
modifier = modifier =
Modifier Modifier
.clip(RoundedCornerShape(ZcashTheme.dimens.regularRippleEffectCorner)) .clip(RoundedCornerShape(ZcashTheme.dimens.regularRippleEffectCorner))

View File

@ -50,8 +50,8 @@ fun FormTextField(
keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text),
colors: TextFieldColors = colors: TextFieldColors =
TextFieldDefaults.colors( TextFieldDefaults.colors(
focusedContainerColor = Color.Transparent, focusedContainerColor = ZcashTheme.colors.backgroundColor,
unfocusedContainerColor = Color.Transparent, unfocusedContainerColor = ZcashTheme.colors.backgroundColor,
disabledContainerColor = ZcashTheme.colors.textDisabled, disabledContainerColor = ZcashTheme.colors.textDisabled,
errorContainerColor = Color.Transparent, errorContainerColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent, focusedIndicatorColor = Color.Transparent,
@ -120,7 +120,7 @@ fun FormTextField(
BodySmall( BodySmall(
text = error, text = error,
color = ZcashTheme.colors.textFieldError, color = ZcashTheme.colors.textFieldWarning,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )

View File

@ -33,6 +33,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
@ -49,7 +50,7 @@ import co.electriccoin.zcash.ui.design.theme.internal.TopAppBarColors
@Composable @Composable
private fun TopAppBarTextComposablePreview() { private fun TopAppBarTextComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar(titleText = "Screen A", backText = "Back") SmallTopAppBar(titleText = "Screen A", backText = "Back")
} }
} }
@ -59,7 +60,7 @@ private fun TopAppBarTextComposablePreview() {
@Composable @Composable
private fun TopAppBarTextRestoringComposablePreview() { private fun TopAppBarTextRestoringComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar( SmallTopAppBar(
titleText = "Screen A", titleText = "Screen A",
backText = "Back", backText = "Back",
@ -73,7 +74,7 @@ private fun TopAppBarTextRestoringComposablePreview() {
@Composable @Composable
private fun TopAppBarTextRestoringLongComposablePreview() { private fun TopAppBarTextRestoringLongComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar( SmallTopAppBar(
titleText = "Screen A", titleText = "Screen A",
backText = "Back", backText = "Back",
@ -87,7 +88,7 @@ private fun TopAppBarTextRestoringLongComposablePreview() {
@Composable @Composable
private fun TopAppBarLogoComposablePreview() { private fun TopAppBarLogoComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar(showTitleLogo = true, backText = "Back") SmallTopAppBar(showTitleLogo = true, backText = "Back")
} }
} }
@ -97,7 +98,7 @@ private fun TopAppBarLogoComposablePreview() {
@Composable @Composable
private fun TopAppBarLogoRestoringComposablePreview() { private fun TopAppBarLogoRestoringComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar( SmallTopAppBar(
showTitleLogo = true, showTitleLogo = true,
backText = "Back", backText = "Back",
@ -111,7 +112,7 @@ private fun TopAppBarLogoRestoringComposablePreview() {
@Composable @Composable
private fun TopAppBarRegularMenuComposablePreview() { private fun TopAppBarRegularMenuComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar( SmallTopAppBar(
titleText = "Screen B", titleText = "Screen B",
regularActions = { regularActions = {
@ -129,7 +130,7 @@ private fun TopAppBarRegularMenuComposablePreview() {
@Composable @Composable
private fun TopAppBarOneVisibleActionMenuComposablePreview() { private fun TopAppBarOneVisibleActionMenuComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar( SmallTopAppBar(
titleText = "Screen C", titleText = "Screen C",
backText = "Back", backText = "Back",
@ -147,7 +148,7 @@ private fun TopAppBarOneVisibleActionMenuComposablePreview() {
@Composable @Composable
private fun TopAppBarHamburgerMenuComposablePreview() { private fun TopAppBarHamburgerMenuComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar( SmallTopAppBar(
titleText = "Screen D", titleText = "Screen D",
backText = "Back", backText = "Back",
@ -165,7 +166,7 @@ private fun TopAppBarHamburgerMenuComposablePreview() {
@Composable @Composable
private fun TopAppBarHamburgerPlusActionComposablePreview() { private fun TopAppBarHamburgerPlusActionComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SmallTopAppBar( SmallTopAppBar(
titleText = "Screen E", titleText = "Screen E",
hamburgerMenuActions = { hamburgerMenuActions = {
@ -260,6 +261,42 @@ private fun TopBarOneVisibleActionMenuExample(
) )
} }
@Composable
@Suppress("LongParameterList")
fun GridBgSmallTopAppBar(
modifier: Modifier = Modifier,
backContentDescriptionText: String? = null,
backText: String? = null,
colors: TopAppBarColors = ZcashTheme.colors.topAppBarColors,
hamburgerMenuActions: (@Composable RowScope.() -> Unit)? = null,
onBack: (() -> Unit)? = null,
regularActions: (@Composable RowScope.() -> Unit)? = null,
restoringLabel: String? = null,
showTitleLogo: Boolean = false,
titleText: String? = null,
) {
SmallTopAppBar(
modifier =
modifier.then(
Modifier.gridBackground(
backgroundColor = ZcashTheme.colors.backgroundColor,
gridSize = ZcashTheme.dimens.gridCellSize,
gridColor = ZcashTheme.colors.gridColor,
gridLineWidth = ZcashTheme.dimens.gridLineWidth
)
),
backContentDescriptionText = backContentDescriptionText,
backText = backText,
colors = colors.copyColors(containerColor = Color.Transparent),
hamburgerMenuActions = hamburgerMenuActions,
onBack = onBack,
regularActions = regularActions,
restoringLabel = restoringLabel,
showTitleLogo = showTitleLogo,
titleText = titleText
)
}
@Composable @Composable
@Suppress("LongParameterList", "LongMethod") @Suppress("LongParameterList", "LongMethod")
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class)

View File

@ -30,6 +30,9 @@ data class Dimens(
val buttonWidth: Dp, val buttonWidth: Dp,
val buttonHeight: Dp, val buttonHeight: Dp,
val buttonHeightSmall: Dp, val buttonHeightSmall: Dp,
// Screen background grid
val gridCellSize: Dp,
val gridLineWidth: Dp,
// Chip // Chip
val chipShadowElevation: Dp, val chipShadowElevation: Dp,
val chipStroke: Dp, val chipStroke: Dp,
@ -79,6 +82,8 @@ private val defaultDimens =
buttonWidth = 244.dp, buttonWidth = 244.dp,
buttonHeight = 56.dp, buttonHeight = 56.dp,
buttonHeightSmall = 38.dp, buttonHeightSmall = 38.dp,
gridCellSize = 14.dp,
gridLineWidth = 1.dp,
chipShadowElevation = 4.dp, chipShadowElevation = 4.dp,
chipStroke = 0.5.dp, chipStroke = 0.5.dp,
circularScreenProgressWidth = 48.dp, circularScreenProgressWidth = 48.dp,

View File

@ -1,50 +1,35 @@
package co.electriccoin.zcash.ui.design.theme package co.electriccoin.zcash.ui.design.theme
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import co.electriccoin.zcash.ui.design.theme.internal.TopAppBarColors import co.electriccoin.zcash.ui.design.theme.internal.TopAppBarColors
@Immutable @Immutable
data class ExtendedColors( data class ExtendedColors(
val surfaceEnd: Color, val backgroundColor: Color,
val gridColor: Color,
val onBackgroundHeader: Color, val onBackgroundHeader: Color,
val tertiary: Color,
val onTertiary: Color,
val callout: Color,
val onCallout: Color,
val circularProgressBarSmall: Color, val circularProgressBarSmall: Color,
val circularProgressBarSmallDark: Color, val circularProgressBarSmallDark: Color,
val circularProgressBarScreen: Color, val circularProgressBarScreen: Color,
val linearProgressBarTrack: Color, val linearProgressBarTrack: Color,
val linearProgressBarBackground: Color, val linearProgressBarBackground: Color,
val chipIndex: Color,
val textCommon: Color, val textCommon: Color,
val textMedium: Color, val textDescription: Color,
val textDisabled: Color, val textDisabled: Color,
val textFieldHint: Color, val textFieldHint: Color,
val textFieldError: Color,
val textFieldWarning: Color, val textFieldWarning: Color,
val textFieldFrame: Color, val textFieldFrame: Color,
val textDescription: Color,
val textDescriptionDark: Color, val textDescriptionDark: Color,
val textPending: Color,
val layoutStroke: Color, val layoutStroke: Color,
val overlay: Color, val overlay: Color,
val highlight: Color,
val reference: Color, val reference: Color,
val disabledButtonColor: Color, val disabledButtonColor: Color,
val disabledButtonTextColor: Color, val disabledButtonTextColor: Color,
val buttonShadowColor: Color,
val screenTitleColor: Color,
val aboutTextColor: Color,
val welcomeAnimationColor: Color, val welcomeAnimationColor: Color,
val complementaryColor: Color, val complementaryColor: Color,
val dividerColor: Color, val dividerColor: Color,
val darkDividerColor: Color, val darkDividerColor: Color,
val tabTextColor: Color,
val panelBackgroundColor: Color, val panelBackgroundColor: Color,
val cameraDisabledBackgroundColor: Color, val cameraDisabledBackgroundColor: Color,
val cameraDisabledFrameColor: Color, val cameraDisabledFrameColor: Color,
@ -55,14 +40,4 @@ data class ExtendedColors(
val historySyncingColor: Color, val historySyncingColor: Color,
val topAppBarColors: TopAppBarColors, val topAppBarColors: TopAppBarColors,
val transparentTopAppBarColors: TopAppBarColors val transparentTopAppBarColors: TopAppBarColors
) {
@Composable
fun surfaceGradient() =
Brush.verticalGradient(
colors =
listOf(
MaterialTheme.colorScheme.surface,
ZcashTheme.colors.surfaceEnd
) )
)
}

View File

@ -11,45 +11,33 @@ import co.electriccoin.zcash.ui.design.theme.ExtendedColors
// TODO [#998]: Check and enhance screen dark mode // TODO [#998]: Check and enhance screen dark mode
// TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998 // TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998
// TODO [#1091]: Clear unused color resources
// TODO [#1091]: https://github.com/Electric-Coin-Company/zashi-android/issues/1091
internal object Dark { internal object Dark {
val backgroundStart = Color(0xFF000000) val backgroundColor = Color(0xFF231F20)
val backgroundEnd = Color(0xFF000000) val gridColor = Color(0xFF272727)
val textHeaderOnBackground = Color(0xFFFFFFFF) val textHeaderOnBackground = Color(0xFFFFFFFF)
val textBodyOnBackground = Color(0xFFFFFFFF) val textBodyOnBackground = Color(0xFFFFFFFF)
val textPrimaryButton = Color(0xFF000000) val textPrimaryButton = Color(0xFF000000)
val textSecondaryButton = Color(0xFF000000) val textSecondaryButton = Color(0xFF000000)
val textTertiaryButton = Color.White
val textCommon = Color(0xFFFFFFFF) val textCommon = Color(0xFFFFFFFF)
val textMedium = Color(0xFF353535)
val textDisabled = Color(0xFFB7B7B7) val textDisabled = Color(0xFFB7B7B7)
val textChipIndex = Color(0xFFFFB900)
val textFieldFrame = Color(0xFF231F20) val textFieldFrame = Color(0xFF231F20)
val textFieldError = Color(0xFFFF0000)
val textFieldWarning = Color(0xFFF40202) val textFieldWarning = Color(0xFFF40202)
val textFieldHint = Color(0xFFB7B7B7) val textFieldHint = Color(0xFFB7B7B7)
val textDescription = Color(0xFF777777) val textDescription = Color(0xFF777777)
val textDescriptionDark = Color(0xFF4D4D4D) val textDescriptionDark = Color(0xFF4D4D4D)
val textProgress = Color(0xFF8B8A8A)
val aboutTextColor = Color(0xFF4E4E4E)
val screenTitleColor = Color(0xFF040404)
val welcomeAnimationColor = Color(0xFF231F20) val welcomeAnimationColor = Color(0xFF231F20)
val complementaryColor = Color(0xFFF4B728) val complementaryColor = Color(0xFFF4B728)
val dividerColor = Color(0xFFDDDDDD) val dividerColor = Color(0xFFDDDDDD)
val darkDividerColor = Color(0xFF000000) val darkDividerColor = Color(0xFF000000)
val tabTextColor = Color(0xFF040404)
val layoutStroke = Color(0xFFFFFFFF) val layoutStroke = Color(0xFFFFFFFF)
val panelBackgroundColor = Color(0xFFEAEAEA) val panelBackgroundColor = Color(0xFFF6F6F6)
val cameraDisabledBackgroundColor = Color(0xFF5E5C5C) val cameraDisabledBackgroundColor = Color(0xFF5E5C5C)
val cameraDisabledFrameColor = Color(0xFFFFFFFF) val cameraDisabledFrameColor = Color(0xFFFFFFFF)
val primaryButton = Color(0xFFFFFFFF) val primaryButton = Color(0xFFFFFFFF)
val secondaryButton = Color(0xFFFFFFFF) val secondaryButton = Color(0xFFFFFFFF)
val tertiaryButton = Color.Transparent
val radioButtonColor = Color(0xFF070707) val radioButtonColor = Color(0xFF070707)
val radioButtonTextColor = Color(0xFF4E4E4E) val radioButtonTextColor = Color(0xFF4E4E4E)
@ -60,19 +48,13 @@ internal object Dark {
val linearProgressBarTrack = Color(0xFFD9D9D9) val linearProgressBarTrack = Color(0xFFD9D9D9)
val linearProgressBarBackground = complementaryColor val linearProgressBarBackground = complementaryColor
val callout = Color(0xFFFFFFFF)
val onCallout = Color(0xFFFFFFFF)
val overlay = Color(0x22000000) val overlay = Color(0x22000000)
val highlight = Color(0xFFFFD800)
val reference = Color(0xFFFFFFFF) val reference = Color(0xFFFFFFFF)
val disabledButtonColor = Color(0xFFB7B7B7) val disabledButtonColor = Color(0xFFB7B7B7)
val disabledButtonTextColor = Color(0xFFDDDDDD) val disabledButtonTextColor = Color(0xFFDDDDDD)
val buttonShadowColor = Color(0xFFFFFFFF)
val historyBackgroundColor = Color(0xFFF6F6F6) val historyBackgroundColor = Color(0xFFF6F6F6)
val historyRedColor = textFieldWarning val historyRedColor = textFieldWarning
val historySyncingColor = panelBackgroundColor val historySyncingColor = panelBackgroundColor
@ -82,41 +64,32 @@ internal object Dark {
} }
internal object Light { internal object Light {
val backgroundStart = Color(0xFFFFFFFF) val backgroundColor = Color(0xFFFFFFFF)
val backgroundEnd = Color(0xFFFFFFFF) val gridColor = Color(0xFFFBFBFB)
val textHeaderOnBackground = Color(0xFF000000) val textHeaderOnBackground = Color(0xFF000000)
val textBodyOnBackground = Color(0xFF000000) val textBodyOnBackground = Color(0xFF000000)
val textPrimaryButton = Color(0xFFFFFFFF) val textPrimaryButton = Color(0xFFFFFFFF)
val textSecondaryButton = Color(0xFF000000) val textSecondaryButton = Color(0xFF000000)
val textTertiaryButton = Color(0xFF000000)
val textCommon = Color(0xFF000000) val textCommon = Color(0xFF000000)
val textMedium = Color(0xFF353535)
val textDisabled = Color(0xFFB7B7B7) val textDisabled = Color(0xFFB7B7B7)
val textFieldFrame = Color(0xFF231F20) val textFieldFrame = Color(0xFF231F20)
val textFieldError = Color(0xFFCD0002)
val textFieldWarning = Color(0xFFF40202) val textFieldWarning = Color(0xFFF40202)
val textFieldHint = Color(0xFFB7B7B7) val textFieldHint = Color(0xFFB7B7B7)
val textChipIndex = Color(0xFFEE8592)
val textDescription = Color(0xFF777777) val textDescription = Color(0xFF777777)
val textDescriptionDark = Color(0xFF4D4D4D) val textDescriptionDark = Color(0xFF4D4D4D)
val textProgress = Color(0xFF8B8A8A)
val screenTitleColor = Color(0xFF040404)
val aboutTextColor = Color(0xFF4E4E4E)
val welcomeAnimationColor = Color(0xFF231F20) val welcomeAnimationColor = Color(0xFF231F20)
val complementaryColor = Color(0xFFF4B728) val complementaryColor = Color(0xFFF4B728)
val dividerColor = Color(0xFFDDDDDD) val dividerColor = Color(0xFFDDDDDD)
val darkDividerColor = Color(0xFF000000) val darkDividerColor = Color(0xFF000000)
val tabTextColor = Color(0xFF040404)
val layoutStroke = Color(0xFF000000) val layoutStroke = Color(0xFF000000)
val panelBackgroundColor = Color(0xFFEAEAEA) val panelBackgroundColor = Color(0xFFEBEBEB)
val cameraDisabledBackgroundColor = Color(0xFF5E5C5C) val cameraDisabledBackgroundColor = Color(0xFF5E5C5C)
val cameraDisabledFrameColor = Color(0xFFFFFFFF) val cameraDisabledFrameColor = Color(0xFFFFFFFF)
val primaryButton = Color(0xFF000000) val primaryButton = Color(0xFF000000)
val secondaryButton = Color(0xFFFFFFFF) val secondaryButton = Color(0xFFFFFFFF)
val tertiaryButton = Color.Transparent
val radioButtonColor = Color(0xFF070707) val radioButtonColor = Color(0xFF070707)
val radioButtonTextColor = Color(0xFF4E4E4E) val radioButtonTextColor = Color(0xFF4E4E4E)
@ -127,21 +100,16 @@ internal object Light {
val linearProgressBarTrack = Color(0xFFD9D9D9) val linearProgressBarTrack = Color(0xFFD9D9D9)
val linearProgressBarBackground = complementaryColor val linearProgressBarBackground = complementaryColor
val callout = Color(0xFFFFFFFF)
val onCallout = Color(0xFFFFFFFF)
val overlay = Color(0x22000000) val overlay = Color(0x22000000)
val highlight = Color(0xFFFFD800)
val reference = Color(0xFF000000) val reference = Color(0xFF000000)
val disabledButtonColor = Color(0xFFB7B7B7) val disabledButtonColor = Color(0xFFB7B7B7)
val disabledButtonTextColor = Color(0xFFDDDDDD) val disabledButtonTextColor = Color(0xFFDDDDDD)
val buttonShadowColor = Color(0xFF000000)
val historyBackgroundColor = Color(0xFFF6F6F6) val historyBackgroundColor = Color(0xFFF6F6F6)
val historyRedColor = textFieldWarning val historyRedColor = textFieldWarning
val historySyncingColor = Dark.panelBackgroundColor val historySyncingColor = panelBackgroundColor
val topAppBarColors = LightTopAppBarColors() val topAppBarColors = LightTopAppBarColors()
val transparentTopAppBarColors = TransparentTopAppBarColors() val transparentTopAppBarColors = TransparentTopAppBarColors()
@ -153,9 +121,9 @@ internal val DarkColorPalette =
secondary = Dark.secondaryButton, secondary = Dark.secondaryButton,
onPrimary = Dark.textPrimaryButton, onPrimary = Dark.textPrimaryButton,
onSecondary = Dark.textSecondaryButton, onSecondary = Dark.textSecondaryButton,
surface = Dark.backgroundStart, surface = Dark.backgroundColor,
onSurface = Dark.textBodyOnBackground, onSurface = Dark.textBodyOnBackground,
background = Dark.backgroundStart, background = Dark.backgroundColor,
onBackground = Dark.textBodyOnBackground, onBackground = Dark.textBodyOnBackground,
) )
@ -165,50 +133,38 @@ internal val LightColorPalette =
secondary = Light.secondaryButton, secondary = Light.secondaryButton,
onPrimary = Light.textPrimaryButton, onPrimary = Light.textPrimaryButton,
onSecondary = Light.textSecondaryButton, onSecondary = Light.textSecondaryButton,
surface = Light.backgroundStart, surface = Light.backgroundColor,
onSurface = Light.textBodyOnBackground, onSurface = Light.textBodyOnBackground,
background = Light.backgroundStart, background = Light.backgroundColor,
onBackground = Light.textBodyOnBackground, onBackground = Light.textBodyOnBackground,
) )
internal val DarkExtendedColorPalette = internal val DarkExtendedColorPalette =
ExtendedColors( ExtendedColors(
surfaceEnd = Dark.backgroundEnd, backgroundColor = Dark.backgroundColor,
gridColor = Dark.gridColor,
onBackgroundHeader = Dark.textHeaderOnBackground, onBackgroundHeader = Dark.textHeaderOnBackground,
tertiary = Dark.tertiaryButton,
onTertiary = Dark.textTertiaryButton,
callout = Dark.callout,
onCallout = Dark.onCallout,
circularProgressBarSmall = Dark.circularProgressBarSmall, circularProgressBarSmall = Dark.circularProgressBarSmall,
circularProgressBarSmallDark = Dark.circularProgressBarSmallDark, circularProgressBarSmallDark = Dark.circularProgressBarSmallDark,
circularProgressBarScreen = Dark.circularProgressBarScreen, circularProgressBarScreen = Dark.circularProgressBarScreen,
linearProgressBarTrack = Dark.linearProgressBarTrack, linearProgressBarTrack = Dark.linearProgressBarTrack,
linearProgressBarBackground = Dark.linearProgressBarBackground, linearProgressBarBackground = Dark.linearProgressBarBackground,
chipIndex = Dark.textChipIndex,
textCommon = Dark.textCommon, textCommon = Dark.textCommon,
textMedium = Dark.textMedium,
textDisabled = Dark.textDisabled, textDisabled = Dark.textDisabled,
textFieldFrame = Dark.textFieldFrame, textFieldFrame = Dark.textFieldFrame,
textFieldError = Dark.textFieldError,
textFieldWarning = Dark.textFieldWarning, textFieldWarning = Dark.textFieldWarning,
textFieldHint = Dark.textFieldHint, textFieldHint = Dark.textFieldHint,
textDescription = Dark.textDescription, textDescription = Dark.textDescription,
textDescriptionDark = Dark.textDescriptionDark, textDescriptionDark = Dark.textDescriptionDark,
textPending = Dark.textProgress,
layoutStroke = Dark.layoutStroke, layoutStroke = Dark.layoutStroke,
overlay = Dark.overlay, overlay = Dark.overlay,
highlight = Dark.highlight,
disabledButtonTextColor = Dark.disabledButtonTextColor, disabledButtonTextColor = Dark.disabledButtonTextColor,
disabledButtonColor = Dark.disabledButtonColor, disabledButtonColor = Dark.disabledButtonColor,
reference = Dark.reference, reference = Dark.reference,
buttonShadowColor = Dark.buttonShadowColor,
screenTitleColor = Dark.screenTitleColor,
aboutTextColor = Dark.aboutTextColor,
welcomeAnimationColor = Dark.welcomeAnimationColor, welcomeAnimationColor = Dark.welcomeAnimationColor,
complementaryColor = Dark.complementaryColor, complementaryColor = Dark.complementaryColor,
dividerColor = Dark.dividerColor, dividerColor = Dark.dividerColor,
darkDividerColor = Dark.darkDividerColor, darkDividerColor = Dark.darkDividerColor,
tabTextColor = Dark.tabTextColor,
panelBackgroundColor = Dark.panelBackgroundColor, panelBackgroundColor = Dark.panelBackgroundColor,
cameraDisabledBackgroundColor = Dark.cameraDisabledBackgroundColor, cameraDisabledBackgroundColor = Dark.cameraDisabledBackgroundColor,
cameraDisabledFrameColor = Dark.cameraDisabledFrameColor, cameraDisabledFrameColor = Dark.cameraDisabledFrameColor,
@ -223,42 +179,30 @@ internal val DarkExtendedColorPalette =
internal val LightExtendedColorPalette = internal val LightExtendedColorPalette =
ExtendedColors( ExtendedColors(
surfaceEnd = Light.backgroundEnd, backgroundColor = Light.backgroundColor,
gridColor = Light.gridColor,
onBackgroundHeader = Light.textHeaderOnBackground, onBackgroundHeader = Light.textHeaderOnBackground,
tertiary = Light.tertiaryButton,
onTertiary = Light.textTertiaryButton,
callout = Light.callout,
onCallout = Light.onCallout,
circularProgressBarScreen = Light.circularProgressBarScreen, circularProgressBarScreen = Light.circularProgressBarScreen,
circularProgressBarSmall = Light.circularProgressBarSmall, circularProgressBarSmall = Light.circularProgressBarSmall,
circularProgressBarSmallDark = Light.circularProgressBarSmallDark, circularProgressBarSmallDark = Light.circularProgressBarSmallDark,
linearProgressBarTrack = Light.linearProgressBarTrack, linearProgressBarTrack = Light.linearProgressBarTrack,
linearProgressBarBackground = Light.linearProgressBarBackground, linearProgressBarBackground = Light.linearProgressBarBackground,
chipIndex = Light.textChipIndex,
textCommon = Light.textCommon, textCommon = Light.textCommon,
textMedium = Light.textMedium,
textDisabled = Light.textDisabled, textDisabled = Light.textDisabled,
textFieldFrame = Light.textFieldFrame, textFieldFrame = Light.textFieldFrame,
textFieldError = Light.textFieldError,
textFieldWarning = Light.textFieldWarning, textFieldWarning = Light.textFieldWarning,
textFieldHint = Light.textFieldHint, textFieldHint = Light.textFieldHint,
textDescription = Light.textDescription, textDescription = Light.textDescription,
textDescriptionDark = Light.textDescriptionDark, textDescriptionDark = Light.textDescriptionDark,
textPending = Light.textProgress,
layoutStroke = Light.layoutStroke, layoutStroke = Light.layoutStroke,
overlay = Light.overlay, overlay = Light.overlay,
highlight = Light.highlight,
disabledButtonTextColor = Light.disabledButtonTextColor, disabledButtonTextColor = Light.disabledButtonTextColor,
disabledButtonColor = Light.disabledButtonColor, disabledButtonColor = Light.disabledButtonColor,
reference = Light.reference, reference = Light.reference,
buttonShadowColor = Light.buttonShadowColor,
screenTitleColor = Light.screenTitleColor,
aboutTextColor = Light.aboutTextColor,
welcomeAnimationColor = Light.welcomeAnimationColor, welcomeAnimationColor = Light.welcomeAnimationColor,
complementaryColor = Light.complementaryColor, complementaryColor = Light.complementaryColor,
dividerColor = Light.dividerColor, dividerColor = Light.dividerColor,
darkDividerColor = Light.darkDividerColor, darkDividerColor = Light.darkDividerColor,
tabTextColor = Light.tabTextColor,
panelBackgroundColor = Light.panelBackgroundColor, panelBackgroundColor = Light.panelBackgroundColor,
cameraDisabledBackgroundColor = Light.cameraDisabledBackgroundColor, cameraDisabledBackgroundColor = Light.cameraDisabledBackgroundColor,
cameraDisabledFrameColor = Light.cameraDisabledFrameColor, cameraDisabledFrameColor = Light.cameraDisabledFrameColor,
@ -275,42 +219,30 @@ internal val LightExtendedColorPalette =
internal val LocalExtendedColors = internal val LocalExtendedColors =
staticCompositionLocalOf { staticCompositionLocalOf {
ExtendedColors( ExtendedColors(
surfaceEnd = Color.Unspecified, backgroundColor = Color.Unspecified,
gridColor = Color.Unspecified,
onBackgroundHeader = Color.Unspecified, onBackgroundHeader = Color.Unspecified,
tertiary = Color.Unspecified,
onTertiary = Color.Unspecified,
callout = Color.Unspecified,
onCallout = Color.Unspecified,
circularProgressBarScreen = Color.Unspecified, circularProgressBarScreen = Color.Unspecified,
circularProgressBarSmall = Color.Unspecified, circularProgressBarSmall = Color.Unspecified,
circularProgressBarSmallDark = Color.Unspecified, circularProgressBarSmallDark = Color.Unspecified,
linearProgressBarTrack = Color.Unspecified, linearProgressBarTrack = Color.Unspecified,
linearProgressBarBackground = Color.Unspecified, linearProgressBarBackground = Color.Unspecified,
chipIndex = Color.Unspecified,
textCommon = Color.Unspecified, textCommon = Color.Unspecified,
textMedium = Color.Unspecified,
textDisabled = Color.Unspecified, textDisabled = Color.Unspecified,
textFieldHint = Color.Unspecified, textFieldHint = Color.Unspecified,
textFieldError = Color.Unspecified,
textFieldWarning = Color.Unspecified, textFieldWarning = Color.Unspecified,
textFieldFrame = Color.Unspecified, textFieldFrame = Color.Unspecified,
textDescription = Color.Unspecified, textDescription = Color.Unspecified,
textDescriptionDark = Color.Unspecified, textDescriptionDark = Color.Unspecified,
textPending = Color.Unspecified,
layoutStroke = Color.Unspecified, layoutStroke = Color.Unspecified,
overlay = Color.Unspecified, overlay = Color.Unspecified,
highlight = Color.Unspecified,
disabledButtonTextColor = Color.Unspecified, disabledButtonTextColor = Color.Unspecified,
disabledButtonColor = Color.Unspecified, disabledButtonColor = Color.Unspecified,
reference = Color.Unspecified, reference = Color.Unspecified,
buttonShadowColor = Color.Unspecified,
screenTitleColor = Color.Unspecified,
aboutTextColor = Color.Unspecified,
welcomeAnimationColor = Color.Unspecified, welcomeAnimationColor = Color.Unspecified,
complementaryColor = Color.Unspecified, complementaryColor = Color.Unspecified,
dividerColor = Color.Unspecified, dividerColor = Color.Unspecified,
darkDividerColor = Color.Unspecified, darkDividerColor = Color.Unspecified,
tabTextColor = Color.Unspecified,
panelBackgroundColor = Color.Unspecified, panelBackgroundColor = Color.Unspecified,
cameraDisabledBackgroundColor = Color.Unspecified, cameraDisabledBackgroundColor = Color.Unspecified,
cameraDisabledFrameColor = Color.Unspecified, cameraDisabledFrameColor = Color.Unspecified,

View File

@ -23,6 +23,14 @@ interface TopAppBarColors {
titleContentColor = titleColor, titleContentColor = titleColor,
actionIconContentColor = actionColor actionIconContentColor = actionColor
) )
fun copyColors(
containerColor: Color = this.containerColor,
navigationColor: Color = this.navigationColor,
titleColor: Color = this.titleColor,
subTitleColor: Color = this.subTitleColor,
actionColor: Color = this.actionColor,
): TopAppBarColors
} }
@Immutable @Immutable
@ -32,7 +40,21 @@ internal data class DefaultTopAppBarColors(
override val titleColor: Color = Color.Unspecified, override val titleColor: Color = Color.Unspecified,
override val subTitleColor: Color = Color.Unspecified, override val subTitleColor: Color = Color.Unspecified,
override val actionColor: Color = Color.Unspecified, override val actionColor: Color = Color.Unspecified,
) : TopAppBarColors ) : TopAppBarColors {
override fun copyColors(
containerColor: Color,
navigationColor: Color,
titleColor: Color,
subTitleColor: Color,
actionColor: Color
) = this.copy(
containerColor = containerColor,
navigationColor = navigationColor,
titleColor = titleColor,
subTitleColor = subTitleColor,
actionColor = actionColor
)
}
@Immutable @Immutable
internal data class LightTopAppBarColors( internal data class LightTopAppBarColors(
@ -41,7 +63,21 @@ internal data class LightTopAppBarColors(
override val titleColor: Color = Color(0xFF000000), override val titleColor: Color = Color(0xFF000000),
override val subTitleColor: Color = Color(0xFF8A8888), override val subTitleColor: Color = Color(0xFF8A8888),
override val actionColor: Color = Color(0xFF000000), override val actionColor: Color = Color(0xFF000000),
) : TopAppBarColors ) : TopAppBarColors {
override fun copyColors(
containerColor: Color,
navigationColor: Color,
titleColor: Color,
subTitleColor: Color,
actionColor: Color
) = this.copy(
containerColor = containerColor,
navigationColor = navigationColor,
titleColor = titleColor,
subTitleColor = subTitleColor,
actionColor = actionColor
)
}
@Immutable @Immutable
internal data class DarkTopAppBarColors( internal data class DarkTopAppBarColors(
@ -50,7 +86,21 @@ internal data class DarkTopAppBarColors(
override val titleColor: Color = Color(0xFFFFFFFF), override val titleColor: Color = Color(0xFFFFFFFF),
override val subTitleColor: Color = Color(0xFF8A8888), override val subTitleColor: Color = Color(0xFF8A8888),
override val actionColor: Color = Color(0xFFFFFFFF), override val actionColor: Color = Color(0xFFFFFFFF),
) : TopAppBarColors ) : TopAppBarColors {
override fun copyColors(
containerColor: Color,
navigationColor: Color,
titleColor: Color,
subTitleColor: Color,
actionColor: Color
) = this.copy(
containerColor = containerColor,
navigationColor = navigationColor,
titleColor = titleColor,
subTitleColor = subTitleColor,
actionColor = actionColor
)
}
@Immutable @Immutable
internal data class TransparentTopAppBarColors( internal data class TransparentTopAppBarColors(
@ -59,4 +109,18 @@ internal data class TransparentTopAppBarColors(
override val titleColor: Color = Color(0xFFFFFFFF), override val titleColor: Color = Color(0xFFFFFFFF),
override val subTitleColor: Color = Color(0xFFFFFFFF), override val subTitleColor: Color = Color(0xFFFFFFFF),
override val actionColor: Color = Color(0xFFFFFFFF), override val actionColor: Color = Color(0xFFFFFFFF),
) : TopAppBarColors ) : TopAppBarColors {
override fun copyColors(
containerColor: Color,
navigationColor: Color,
titleColor: Color,
subTitleColor: Color,
actionColor: Color
) = this.copy(
containerColor = containerColor,
navigationColor = navigationColor,
titleColor = titleColor,
subTitleColor = subTitleColor,
actionColor = actionColor
)
}

View File

@ -38,8 +38,8 @@ import co.electriccoin.zcash.ui.common.viewmodel.SecretState
import co.electriccoin.zcash.ui.common.viewmodel.WalletViewModel import co.electriccoin.zcash.ui.common.viewmodel.WalletViewModel
import co.electriccoin.zcash.ui.configuration.RemoteConfig import co.electriccoin.zcash.ui.configuration.RemoteConfig
import co.electriccoin.zcash.ui.design.component.AnimationConstants import co.electriccoin.zcash.ui.design.component.AnimationConstants
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.ConfigurationOverride import co.electriccoin.zcash.ui.design.component.ConfigurationOverride
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.Override import co.electriccoin.zcash.ui.design.component.Override
import co.electriccoin.zcash.ui.design.component.WelcomeAnimationAutostart import co.electriccoin.zcash.ui.design.component.WelcomeAnimationAutostart
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -132,7 +132,7 @@ class MainActivity : AppCompatActivity() {
setContent { setContent {
Override(configurationOverrideFlow) { Override(configurationOverrideFlow) {
ZcashTheme { ZcashTheme {
GradientSurface( BlankSurface(
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
.fillMaxHeight() .fillMaxHeight()

View File

@ -22,9 +22,9 @@ import cash.z.ecc.android.sdk.model.Zatoshi
import cash.z.ecc.android.sdk.model.toZecString import cash.z.ecc.android.sdk.model.toZecString
import cash.z.ecc.sdk.type.ZcashCurrency import cash.z.ecc.sdk.type.ZcashCurrency
import co.electriccoin.zcash.ui.design.R import co.electriccoin.zcash.ui.design.R
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.CircularSmallProgressIndicator import co.electriccoin.zcash.ui.design.component.CircularSmallProgressIndicator
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.Reference import co.electriccoin.zcash.ui.design.component.Reference
import co.electriccoin.zcash.ui.design.component.StyledBalance import co.electriccoin.zcash.ui.design.component.StyledBalance
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -33,7 +33,7 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun BalanceWidgetPreview() { private fun BalanceWidgetPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface( BlankSurface(
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
) { ) {
@Suppress("MagicNumber") @Suppress("MagicNumber")
@ -57,7 +57,7 @@ private fun BalanceWidgetPreview() {
@Composable @Composable
private fun BalanceWidgetNotAvailableYetPreview() { private fun BalanceWidgetNotAvailableYetPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface( BlankSurface(
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
) { ) {
@Suppress("MagicNumber") @Suppress("MagicNumber")

View File

@ -25,8 +25,8 @@ import cash.z.ecc.sdk.extension.toPercentageWithDecimal
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.model.WalletSnapshot import co.electriccoin.zcash.ui.common.model.WalletSnapshot
import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.AppAlertDialog
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.BodySmall import co.electriccoin.zcash.ui.design.component.BodySmall
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.SmallLinearProgressIndicator import co.electriccoin.zcash.ui.design.component.SmallLinearProgressIndicator
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.fixture.WalletSnapshotFixture import co.electriccoin.zcash.ui.fixture.WalletSnapshotFixture
@ -37,7 +37,7 @@ import co.electriccoin.zcash.ui.screen.balances.model.WalletDisplayValues
@Composable @Composable
private fun BalanceWidgetPreview() { private fun BalanceWidgetPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface( BlankSurface(
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
) { ) {
SynchronizationStatus( SynchronizationStatus(

View File

@ -18,7 +18,6 @@ import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -42,7 +41,7 @@ import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.model.VersionInfo import co.electriccoin.zcash.ui.common.model.VersionInfo
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.fixture.ConfigInfoFixture import co.electriccoin.zcash.ui.fixture.ConfigInfoFixture
@ -53,18 +52,16 @@ import co.electriccoin.zcash.ui.screen.support.model.ConfigInfo
@Composable @Composable
private fun AboutPreview() { private fun AboutPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
About( About(
onBack = {}, onBack = {},
configInfo = ConfigInfoFixture.new(), configInfo = ConfigInfoFixture.new(),
onPrivacyPolicy = {}, onPrivacyPolicy = {},
snackbarHostState = SnackbarHostState(), snackbarHostState = SnackbarHostState(),
versionInfo = VersionInfoFixture.new(), versionInfo = VersionInfoFixture.new(),
walletRestoringState = WalletRestoringState.NONE, walletRestoringState = WalletRestoringState.NONE
) )
} }
} }
}
@Composable @Composable
@Suppress("LongParameterList") @Suppress("LongParameterList")
@ -76,7 +73,7 @@ fun About(
versionInfo: VersionInfo, versionInfo: VersionInfo,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold( BlankBgScaffold(
topBar = { topBar = {
AboutTopAppBar( AboutTopAppBar(
onBack = onBack, onBack = onBack,
@ -214,7 +211,7 @@ fun AboutMainContent(
Text( Text(
text = stringResource(id = R.string.about_description), text = stringResource(id = R.string.about_description),
color = ZcashTheme.colors.aboutTextColor, color = ZcashTheme.colors.textDescriptionDark,
style = ZcashTheme.extendedTypography.aboutText style = ZcashTheme.extendedTypography.aboutText
) )
@ -236,18 +233,18 @@ fun PrivacyPolicyLink(onPrivacyPolicy: () -> Unit) {
ClickableText( ClickableText(
text = text =
buildAnnotatedString { buildAnnotatedString {
withStyle(SpanStyle(color = ZcashTheme.colors.aboutTextColor)) { withStyle(SpanStyle(color = ZcashTheme.colors.textDescriptionDark)) {
append(textPart1) append(textPart1)
} }
withStyle( withStyle(
SpanStyle( SpanStyle(
textDecoration = TextDecoration.Underline, textDecoration = TextDecoration.Underline,
color = ZcashTheme.colors.aboutTextColor, color = ZcashTheme.colors.textDescriptionDark,
) )
) { ) {
append(textPart2) append(textPart2)
} }
withStyle(SpanStyle(color = ZcashTheme.colors.aboutTextColor)) { withStyle(SpanStyle(color = ZcashTheme.colors.textDescriptionDark)) {
append(textPart3) append(textPart3)
} }
}, },

View File

@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -25,7 +24,7 @@ import co.electriccoin.zcash.ui.common.compose.StatusDialog
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.common.model.WalletSnapshot import co.electriccoin.zcash.ui.common.model.WalletSnapshot
import co.electriccoin.zcash.ui.common.test.CommonTag import co.electriccoin.zcash.ui.common.test.CommonTag
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.fixture.BalanceStateFixture import co.electriccoin.zcash.ui.fixture.BalanceStateFixture
@ -39,7 +38,6 @@ import co.electriccoin.zcash.ui.screen.balances.model.StatusAction
@Composable @Composable
private fun HistoryLoadingComposablePreview() { private fun HistoryLoadingComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
Account( Account(
balanceState = BalanceStateFixture.new(), balanceState = BalanceStateFixture.new(),
goBalances = {}, goBalances = {},
@ -55,16 +53,18 @@ private fun HistoryLoadingComposablePreview() {
) )
} }
} }
}
@Composable @Composable
@Preview("Account History List") @Preview("Account History List")
private fun HistoryListComposablePreview() { private fun HistoryListComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
@Suppress("MagicNumber") @Suppress("MagicNumber")
Account( Account(
balanceState = BalanceState.Available(Zatoshi(123_000_000L), Zatoshi(123_000_000L)), balanceState =
BalanceState.Available(
Zatoshi(123_000_000L),
Zatoshi(123_000_000L)
),
goBalances = {}, goBalances = {},
goSettings = {}, goSettings = {},
hideStatusDialog = {}, hideStatusDialog = {},
@ -78,7 +78,6 @@ private fun HistoryListComposablePreview() {
) )
} }
} }
}
@Composable @Composable
@Suppress("LongParameterList") @Suppress("LongParameterList")
@ -95,7 +94,7 @@ internal fun Account(
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
walletSnapshot: WalletSnapshot, walletSnapshot: WalletSnapshot,
) { ) {
Scaffold( BlankBgScaffold(
topBar = { topBar = {
AccountTopAppBar( AccountTopAppBar(
showRestoring = walletRestoringState == WalletRestoringState.RESTORING, showRestoring = walletRestoringState == WalletRestoringState.RESTORING,

View File

@ -49,8 +49,8 @@ import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.compose.SynchronizationStatus import co.electriccoin.zcash.ui.common.compose.SynchronizationStatus
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.common.model.WalletSnapshot import co.electriccoin.zcash.ui.common.model.WalletSnapshot
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.CircularMidProgressIndicator import co.electriccoin.zcash.ui.design.component.CircularMidProgressIndicator
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.StyledBalance import co.electriccoin.zcash.ui.design.component.StyledBalance
import co.electriccoin.zcash.ui.design.component.TextWithIcon import co.electriccoin.zcash.ui.design.component.TextWithIcon
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -74,7 +74,6 @@ import java.util.Locale
@Preview("History") @Preview("History")
private fun ComposablePreview() { private fun ComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
HistoryContainer( HistoryContainer(
onTransactionItemAction = {}, onTransactionItemAction = {},
onStatusClick = {}, onStatusClick = {},
@ -84,13 +83,11 @@ private fun ComposablePreview() {
) )
} }
} }
}
@Composable @Composable
@Preview("History List") @Preview("History List")
private fun ComposableHistoryListPreview() { private fun ComposableHistoryListPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
HistoryContainer( HistoryContainer(
transactionState = TransactionUiState.Done(transactions = TransactionsFixture.new()), transactionState = TransactionUiState.Done(transactions = TransactionsFixture.new()),
onTransactionItemAction = {}, onTransactionItemAction = {},
@ -100,7 +97,6 @@ private fun ComposableHistoryListPreview() {
) )
} }
} }
}
private val dateFormat: DateFormat by lazy { private val dateFormat: DateFormat by lazy {
SimpleDateFormat( SimpleDateFormat(
@ -234,7 +230,7 @@ private fun HistoryList(
@Preview("History List Item") @Preview("History List Item")
private fun ComposableHistoryListItemPreview() { private fun ComposableHistoryListItemPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
HistoryItem( HistoryItem(
onAction = {}, onAction = {},
transaction = TransactionUiFixture.new() transaction = TransactionUiFixture.new()
@ -773,7 +769,7 @@ private fun HistoryItemMessagePart(
Text( Text(
text = stringResource(id = R.string.account_history_item_message), text = stringResource(id = R.string.account_history_item_message),
style = ZcashTheme.extendedTypography.transactionItemStyles.contentMedium, style = ZcashTheme.extendedTypography.transactionItemStyles.contentMedium,
color = ZcashTheme.colors.textMedium color = ZcashTheme.colors.textCommon
) )
Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingSmall)) Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingSmall))

View File

@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
@ -21,7 +20,7 @@ import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -35,18 +34,16 @@ import co.electriccoin.zcash.ui.screen.advancedsettings.AdvancedSettingsTag
@Composable @Composable
private fun PreviewAdvancedSettings() { private fun PreviewAdvancedSettings() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
AdvancedSettings( AdvancedSettings(
onBack = {}, onBack = {},
onDeleteWallet = {}, onDeleteWallet = {},
onExportPrivateData = {}, onExportPrivateData = {},
onChooseServer = {}, onChooseServer = {},
onSeedRecovery = {}, onSeedRecovery = {},
walletRestoringState = WalletRestoringState.NONE, walletRestoringState = WalletRestoringState.NONE
) )
} }
} }
}
@Composable @Composable
@Suppress("LongParameterList") @Suppress("LongParameterList")
@ -58,12 +55,14 @@ fun AdvancedSettings(
onSeedRecovery: () -> Unit, onSeedRecovery: () -> Unit,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold(topBar = { BlankBgScaffold(
topBar = {
AdvancedSettingsTopAppBar( AdvancedSettingsTopAppBar(
onBack = onBack, onBack = onBack,
showRestoring = walletRestoringState == WalletRestoringState.RESTORING, showRestoring = walletRestoringState == WalletRestoringState.RESTORING,
) )
}) { paddingValues -> }
) { paddingValues ->
AdvancedSettingsMainContent( AdvancedSettingsMainContent(
modifier = modifier =
Modifier Modifier

View File

@ -14,7 +14,7 @@ import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.viewmodel.AuthenticationResult import co.electriccoin.zcash.ui.common.viewmodel.AuthenticationResult
import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.AppAlertDialog
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.WelcomeAnimation import co.electriccoin.zcash.ui.design.component.WelcomeAnimation
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -22,7 +22,7 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun PreviewAppAccessAuthentication() { private fun PreviewAppAccessAuthentication() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
AppAccessAuthentication( AppAccessAuthentication(
welcomeAnimVisibility = true welcomeAnimVisibility = true
) )
@ -34,7 +34,7 @@ private fun PreviewAppAccessAuthentication() {
@Composable @Composable
private fun PreviewErrorAuthentication() { private fun PreviewErrorAuthentication() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
AuthenticationErrorDialog( AuthenticationErrorDialog(
onDismiss = {}, onDismiss = {},
onRetry = {}, onRetry = {},

View File

@ -25,7 +25,6 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -68,12 +67,13 @@ import co.electriccoin.zcash.ui.common.model.spendableBalance
import co.electriccoin.zcash.ui.common.model.valuePendingBalance import co.electriccoin.zcash.ui.common.model.valuePendingBalance
import co.electriccoin.zcash.ui.common.test.CommonTag import co.electriccoin.zcash.ui.common.test.CommonTag
import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.AppAlertDialog
import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.BodySmall import co.electriccoin.zcash.ui.design.component.BodySmall
import co.electriccoin.zcash.ui.design.component.BodyWithFiatCurrencySymbol import co.electriccoin.zcash.ui.design.component.BodyWithFiatCurrencySymbol
import co.electriccoin.zcash.ui.design.component.CircularScreenProgressIndicator import co.electriccoin.zcash.ui.design.component.CircularScreenProgressIndicator
import co.electriccoin.zcash.ui.design.component.CircularSmallProgressIndicator import co.electriccoin.zcash.ui.design.component.CircularSmallProgressIndicator
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.Reference import co.electriccoin.zcash.ui.design.component.Reference
import co.electriccoin.zcash.ui.design.component.Small import co.electriccoin.zcash.ui.design.component.Small
@ -91,7 +91,6 @@ import co.electriccoin.zcash.ui.screen.balances.model.WalletDisplayValues
@Composable @Composable
private fun ComposableBalancesPreview() { private fun ComposableBalancesPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
Balances( Balances(
balanceState = BalanceStateFixture.new(), balanceState = BalanceStateFixture.new(),
isFiatConversionEnabled = false, isFiatConversionEnabled = false,
@ -110,13 +109,11 @@ private fun ComposableBalancesPreview() {
) )
} }
} }
}
@Preview("BalancesShieldFailure") @Preview("BalancesShieldFailure")
@Composable @Composable
private fun ComposableBalancesShieldFailurePreview() { private fun ComposableBalancesShieldFailurePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
Balances( Balances(
balanceState = BalanceStateFixture.new(), balanceState = BalanceStateFixture.new(),
isFiatConversionEnabled = false, isFiatConversionEnabled = false,
@ -135,13 +132,12 @@ private fun ComposableBalancesShieldFailurePreview() {
) )
} }
} }
}
@Preview("BalancesShieldErrorDialog") @Preview("BalancesShieldErrorDialog")
@Composable @Composable
private fun ComposableBalancesShieldErrorDialogPreview() { private fun ComposableBalancesShieldErrorDialogPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
ShieldingErrorDialog( ShieldingErrorDialog(
reason = "Test Error Text", reason = "Test Error Text",
onDone = {} onDone = {}
@ -168,7 +164,7 @@ fun Balances(
walletSnapshot: WalletSnapshot?, walletSnapshot: WalletSnapshot?,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold( BlankBgScaffold(
topBar = { topBar = {
BalancesTopAppBar( BalancesTopAppBar(
showRestoring = walletRestoringState == WalletRestoringState.RESTORING, showRestoring = walletRestoringState == WalletRestoringState.RESTORING,
@ -470,7 +466,7 @@ fun TransparentBalanceRow(
ZcashTheme.extendedTypography.balanceSingleStyles.first, ZcashTheme.extendedTypography.balanceSingleStyles.first,
ZcashTheme.extendedTypography.balanceSingleStyles.second ZcashTheme.extendedTypography.balanceSingleStyles.second
), ),
textColor = ZcashTheme.colors.textPending textColor = ZcashTheme.colors.textDescriptionDark
) )
Spacer(modifier = Modifier.width(ZcashTheme.dimens.spacingTiny)) Spacer(modifier = Modifier.width(ZcashTheme.dimens.spacingTiny))
@ -627,7 +623,7 @@ fun ChangePendingRow(walletSnapshot: WalletSnapshot) {
ZcashTheme.extendedTypography.balanceSingleStyles.first, ZcashTheme.extendedTypography.balanceSingleStyles.first,
ZcashTheme.extendedTypography.balanceSingleStyles.second ZcashTheme.extendedTypography.balanceSingleStyles.second
), ),
textColor = ZcashTheme.colors.textPending textColor = ZcashTheme.colors.textDescriptionDark
) )
Spacer(modifier = Modifier.width(12.dp)) Spacer(modifier = Modifier.width(12.dp))
@ -661,7 +657,7 @@ fun PendingTransactionsRow(walletSnapshot: WalletSnapshot) {
ZcashTheme.extendedTypography.balanceSingleStyles.first, ZcashTheme.extendedTypography.balanceSingleStyles.first,
ZcashTheme.extendedTypography.balanceSingleStyles.second ZcashTheme.extendedTypography.balanceSingleStyles.second
), ),
textColor = ZcashTheme.colors.textPending textColor = ZcashTheme.colors.textDescriptionDark
) )
Spacer(modifier = Modifier.width(12.dp)) Spacer(modifier = Modifier.width(12.dp))

View File

@ -17,7 +17,6 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.DividerDefaults import androidx.compose.material3.DividerDefaults
import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableIntStateOf
@ -41,8 +40,8 @@ import co.electriccoin.lightwallet.client.model.LightWalletEndpoint
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.AppAlertDialog
import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.FormTextField import co.electriccoin.zcash.ui.design.component.FormTextField
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.RadioButton import co.electriccoin.zcash.ui.design.component.RadioButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
@ -56,7 +55,6 @@ import kotlinx.collections.immutable.toImmutableList
@Composable @Composable
private fun PreviewChooseServer() { private fun PreviewChooseServer() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
ChooseServer( ChooseServer(
availableServers = emptyList<LightWalletEndpoint>().toImmutableList(), availableServers = emptyList<LightWalletEndpoint>().toImmutableList(),
onBack = {}, onBack = {},
@ -71,7 +69,6 @@ private fun PreviewChooseServer() {
) )
} }
} }
}
@Composable @Composable
@Suppress("LongMethod", "LongParameterList") @Suppress("LongMethod", "LongParameterList")
@ -123,7 +120,7 @@ fun ChooseServer(
mutableStateOf(initialCustomServerValue) mutableStateOf(initialCustomServerValue)
} }
Scaffold( BlankBgScaffold(
topBar = { topBar = {
ChooseServerTopAppBar( ChooseServerTopAppBar(
onBack = onBack, onBack = onBack,

View File

@ -6,14 +6,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import co.electriccoin.zcash.spackle.model.Index import co.electriccoin.zcash.spackle.model.Index
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.ChipIndexed import co.electriccoin.zcash.ui.design.component.ChipIndexed
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.Header import co.electriccoin.zcash.ui.design.component.Header
import co.electriccoin.zcash.ui.design.component.NavigationButton import co.electriccoin.zcash.ui.design.component.NavigationButton
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SecondaryButton import co.electriccoin.zcash.ui.design.component.SecondaryButton
import co.electriccoin.zcash.ui.design.component.TertiaryButton
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Preview("DesignGuide") @Preview("DesignGuide")
@ -28,7 +27,7 @@ private fun ComposablePreview() {
// Allowing magic numbers since this is debug-only // Allowing magic numbers since this is debug-only
@Suppress("MagicNumber") @Suppress("MagicNumber")
fun DesignGuide() { fun DesignGuide() {
GradientSurface { BlankSurface {
Column { Column {
Header(text = "H1") Header(text = "H1")
Body(text = "body") Body(text = "body")
@ -36,7 +35,6 @@ fun DesignGuide() {
NavigationButton(onClick = { }, text = "Next") NavigationButton(onClick = { }, text = "Next")
PrimaryButton(onClick = { }, text = "Primary button", outerPaddingValues = PaddingValues(24.dp)) PrimaryButton(onClick = { }, text = "Primary button", outerPaddingValues = PaddingValues(24.dp))
SecondaryButton(onClick = { }, text = "Secondary button", outerPaddingValues = PaddingValues(24.dp)) SecondaryButton(onClick = { }, text = "Secondary button", outerPaddingValues = PaddingValues(24.dp))
TertiaryButton(onClick = { }, text = "Tertiary button", outerPaddingValues = PaddingValues(24.dp))
ChipIndexed(Index(1), "edict") ChipIndexed(Index(1), "edict")
} }
} }

View File

@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -25,9 +24,9 @@ import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.CheckBox import co.electriccoin.zcash.ui.design.component.CheckBox
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.GridBgSmallTopAppBar
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -35,7 +34,6 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun ExportPrivateDataPreview() { private fun ExportPrivateDataPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
DeleteWallet( DeleteWallet(
snackbarHostState = SnackbarHostState(), snackbarHostState = SnackbarHostState(),
onBack = {}, onBack = {},
@ -44,7 +42,6 @@ private fun ExportPrivateDataPreview() {
) )
} }
} }
}
@Composable @Composable
fun DeleteWallet( fun DeleteWallet(
@ -53,7 +50,7 @@ fun DeleteWallet(
onConfirm: () -> Unit, onConfirm: () -> Unit,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold( GridBgScaffold(
topBar = { topBar = {
DeleteWalletDataTopAppBar( DeleteWalletDataTopAppBar(
onBack = onBack, onBack = onBack,
@ -83,7 +80,7 @@ private fun DeleteWalletDataTopAppBar(
onBack: () -> Unit, onBack: () -> Unit,
showRestoring: Boolean showRestoring: Boolean
) { ) {
SmallTopAppBar( GridBgSmallTopAppBar(
restoringLabel = restoringLabel =
if (showRestoring) { if (showRestoring) {
stringResource(id = R.string.restoring_wallet_label) stringResource(id = R.string.restoring_wallet_label)

View File

@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -27,9 +26,9 @@ import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.CheckBox import co.electriccoin.zcash.ui.design.component.CheckBox
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.GridBgSmallTopAppBar
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -37,7 +36,6 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun ExportPrivateDataPreview() { private fun ExportPrivateDataPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
ExportPrivateData( ExportPrivateData(
snackbarHostState = SnackbarHostState(), snackbarHostState = SnackbarHostState(),
onBack = {}, onBack = {},
@ -47,7 +45,6 @@ private fun ExportPrivateDataPreview() {
) )
} }
} }
}
// TODO [#998]: Check and enhance screen dark mode // TODO [#998]: Check and enhance screen dark mode
// TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998 // TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998
@ -60,7 +57,7 @@ fun ExportPrivateData(
onConfirm: () -> Unit, onConfirm: () -> Unit,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold( GridBgScaffold(
topBar = { topBar = {
ExportPrivateDataTopAppBar( ExportPrivateDataTopAppBar(
onBack = onBack, onBack = onBack,
@ -91,7 +88,7 @@ private fun ExportPrivateDataTopAppBar(
onBack: () -> Unit, onBack: () -> Unit,
showRestoring: Boolean showRestoring: Boolean
) { ) {
SmallTopAppBar( GridBgSmallTopAppBar(
restoringLabel = restoringLabel =
if (showRestoring) { if (showRestoring) {
stringResource(id = R.string.restoring_wallet_label) stringResource(id = R.string.restoring_wallet_label)

View File

@ -17,7 +17,6 @@ import androidx.compose.material3.TabRowDefaults
import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.rememberUpdatedState import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.snapshotFlow import androidx.compose.runtime.snapshotFlow
@ -34,7 +33,7 @@ import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.compose.DisableScreenTimeout import co.electriccoin.zcash.ui.common.compose.DisableScreenTimeout
import co.electriccoin.zcash.ui.common.model.WalletSnapshot import co.electriccoin.zcash.ui.common.model.WalletSnapshot
import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.AppAlertDialog
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.NavigationTabText import co.electriccoin.zcash.ui.design.component.NavigationTabText
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.fixture.WalletSnapshotFixture import co.electriccoin.zcash.ui.fixture.WalletSnapshotFixture
@ -50,7 +49,7 @@ import kotlinx.coroutines.launch
@Composable @Composable
private fun ComposablePreview() { private fun ComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
Home( Home(
forcePage = null, forcePage = null,
isKeepScreenOnWhileSyncing = false, isKeepScreenOnWhileSyncing = false,

View File

@ -21,7 +21,6 @@ import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
@ -34,7 +33,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import cash.z.ecc.android.sdk.model.PersistableWallet import cash.z.ecc.android.sdk.model.PersistableWallet
import cash.z.ecc.sdk.fixture.PersistableWalletFixture import cash.z.ecc.sdk.fixture.PersistableWalletFixture
@ -46,19 +44,18 @@ import co.electriccoin.zcash.ui.common.test.CommonTag.WALLET_BIRTHDAY
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.BodySmall import co.electriccoin.zcash.ui.design.component.BodySmall
import co.electriccoin.zcash.ui.design.component.ChipGrid import co.electriccoin.zcash.ui.design.component.ChipGrid
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.GridBgSmallTopAppBar
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.fixture.VersionInfoFixture import co.electriccoin.zcash.ui.fixture.VersionInfoFixture
import kotlinx.collections.immutable.toPersistentList import kotlinx.collections.immutable.toPersistentList
@Preview(name = "NewWalletRecovery", device = Devices.PIXEL_4) @Preview(name = "NewWalletRecovery")
@Composable @Composable
private fun ComposablePreview() { private fun ComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
NewWalletRecovery( NewWalletRecovery(
PersistableWalletFixture.new(), PersistableWalletFixture.new(),
onSeedCopy = {}, onSeedCopy = {},
@ -68,7 +65,6 @@ private fun ComposablePreview() {
) )
} }
} }
}
// TODO [#998]: Check and enhance screen dark mode // TODO [#998]: Check and enhance screen dark mode
// TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998 // TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998
@ -84,7 +80,7 @@ fun NewWalletRecovery(
onComplete: () -> Unit, onComplete: () -> Unit,
versionInfo: VersionInfo, versionInfo: VersionInfo,
) { ) {
Scaffold( GridBgScaffold(
topBar = { topBar = {
NewWalletRecoveryTopAppBar( NewWalletRecoveryTopAppBar(
onSeedCopy = onSeedCopy, onSeedCopy = onSeedCopy,
@ -115,7 +111,7 @@ private fun NewWalletRecoveryTopAppBar(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
onSeedCopy: () -> Unit onSeedCopy: () -> Unit
) { ) {
SmallTopAppBar( GridBgSmallTopAppBar(
modifier = modifier, modifier = modifier,
regularActions = { regularActions = {
if (versionInfo.isDebuggable && !versionInfo.isRunningUnderTestService) { if (versionInfo.isDebuggable && !versionInfo.isRunningUnderTestService) {

View File

@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -25,7 +24,7 @@ import androidx.compose.ui.tooling.preview.Preview
import cash.z.ecc.android.sdk.fixture.WalletFixture import cash.z.ecc.android.sdk.fixture.WalletFixture
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SecondaryButton import co.electriccoin.zcash.ui.design.component.SecondaryButton
import co.electriccoin.zcash.ui.design.component.TitleLarge import co.electriccoin.zcash.ui.design.component.TitleLarge
@ -35,7 +34,6 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun OnboardingComposablePreview() { private fun OnboardingComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
Onboarding( Onboarding(
isDebugMenuEnabled = true, isDebugMenuEnabled = true,
onImportWallet = {}, onImportWallet = {},
@ -44,7 +42,6 @@ private fun OnboardingComposablePreview() {
) )
} }
} }
}
// TODO [#998]: Check and enhance screen dark mode // TODO [#998]: Check and enhance screen dark mode
// TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998 // TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998
@ -63,7 +60,7 @@ fun Onboarding(
onCreateWallet: () -> Unit, onCreateWallet: () -> Unit,
onFixtureWallet: (String) -> Unit onFixtureWallet: (String) -> Unit
) { ) {
Scaffold { paddingValues -> GridBgScaffold { paddingValues ->
OnboardingMainContent( OnboardingMainContent(
isDebugMenuEnabled = isDebugMenuEnabled, isDebugMenuEnabled = isDebugMenuEnabled,
onCreateWallet = onCreateWallet, onCreateWallet = onCreateWallet,

View File

@ -15,7 +15,6 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -43,8 +42,8 @@ import co.electriccoin.zcash.ui.common.compose.ScreenBrightnessState
import co.electriccoin.zcash.ui.common.model.VersionInfo import co.electriccoin.zcash.ui.common.model.VersionInfo
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.common.test.CommonTag import co.electriccoin.zcash.ui.common.test.CommonTag
import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.CircularScreenProgressIndicator import co.electriccoin.zcash.ui.design.component.CircularScreenProgressIndicator
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.Reference import co.electriccoin.zcash.ui.design.component.Reference
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.component.SubHeader import co.electriccoin.zcash.ui.design.component.SubHeader
@ -59,7 +58,6 @@ import kotlin.math.roundToInt
@Composable @Composable
private fun ComposablePreview() { private fun ComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
Receive( Receive(
screenBrightnessState = ScreenBrightnessState.NORMAL, screenBrightnessState = ScreenBrightnessState.NORMAL,
walletAddress = runBlocking { WalletAddressesFixture.new() }, walletAddress = runBlocking { WalletAddressesFixture.new() },
@ -73,7 +71,6 @@ private fun ComposablePreview() {
) )
} }
} }
}
@Suppress("LongParameterList") @Suppress("LongParameterList")
@Composable @Composable
@ -88,7 +85,7 @@ fun Receive(
versionInfo: VersionInfo, versionInfo: VersionInfo,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold( BlankBgScaffold(
topBar = { topBar = {
ReceiveTopAppBar( ReceiveTopAppBar(
onSettings = onSettings, onSettings = onSettings,

View File

@ -25,7 +25,6 @@ import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface import androidx.compose.material3.Surface
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextField import androidx.compose.material3.TextField
@ -42,7 +41,6 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.focusRequester
@ -72,10 +70,10 @@ import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.ChipOnSurface import co.electriccoin.zcash.ui.design.component.ChipOnSurface
import co.electriccoin.zcash.ui.design.component.FormTextField import co.electriccoin.zcash.ui.design.component.FormTextField
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.GridBgSmallTopAppBar
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.Reference import co.electriccoin.zcash.ui.design.component.Reference
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.screen.restore.RestoreTag import co.electriccoin.zcash.ui.screen.restore.RestoreTag
@ -92,7 +90,6 @@ import kotlinx.coroutines.launch
@Composable @Composable
private fun PreviewRestoreSeed() { private fun PreviewRestoreSeed() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
RestoreWallet( RestoreWallet(
ZcashNetwork.Mainnet, ZcashNetwork.Mainnet,
restoreState = RestoreState(RestoreStage.Seed), restoreState = RestoreState(RestoreStage.Seed),
@ -118,7 +115,6 @@ private fun PreviewRestoreSeed() {
) )
} }
} }
}
@Preview("Restore Seed Birthday") @Preview("Restore Seed Birthday")
@Composable @Composable
@ -184,7 +180,7 @@ fun RestoreWallet(
} }
} }
Scaffold( GridBgScaffold(
modifier = Modifier.navigationBarsPadding(), modifier = Modifier.navigationBarsPadding(),
topBar = { topBar = {
when (currentStage) { when (currentStage) {
@ -293,7 +289,7 @@ private fun RestoreSeedTopAppBar(
onClear: () -> Unit, onClear: () -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
SmallTopAppBar( GridBgSmallTopAppBar(
modifier = modifier, modifier = modifier,
backText = stringResource(id = R.string.restore_back).uppercase(), backText = stringResource(id = R.string.restore_back).uppercase(),
backContentDescriptionText = stringResource(R.string.restore_back_content_description), backContentDescriptionText = stringResource(R.string.restore_back_content_description),
@ -311,7 +307,7 @@ private fun RestoreSeedBirthdayTopAppBar(
onBack: () -> Unit, onBack: () -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
SmallTopAppBar( GridBgSmallTopAppBar(
modifier = modifier, modifier = modifier,
backText = stringResource(id = R.string.restore_back).uppercase(), backText = stringResource(id = R.string.restore_back).uppercase(),
backContentDescriptionText = stringResource(R.string.restore_back_content_description), backContentDescriptionText = stringResource(R.string.restore_back_content_description),
@ -319,7 +315,6 @@ private fun RestoreSeedBirthdayTopAppBar(
) )
} }
@OptIn(ExperimentalComposeUiApi::class)
@Suppress("UNUSED_PARAMETER", "LongParameterList", "LongMethod") @Suppress("UNUSED_PARAMETER", "LongParameterList", "LongMethod")
@Composable @Composable
private fun RestoreSeedMainContent( private fun RestoreSeedMainContent(

View File

@ -60,7 +60,7 @@ import cash.z.ecc.android.sdk.type.AddressType
import co.electriccoin.zcash.spackle.Twig import co.electriccoin.zcash.spackle.Twig
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.SecondaryButton import co.electriccoin.zcash.ui.design.component.SecondaryButton
import co.electriccoin.zcash.ui.design.component.Small import co.electriccoin.zcash.ui.design.component.Small
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
@ -84,7 +84,7 @@ import kotlin.math.roundToInt
@Composable @Composable
private fun PreviewScan() { private fun PreviewScan() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
Scan( Scan(
snackbarHostState = SnackbarHostState(), snackbarHostState = SnackbarHostState(),
onBack = {}, onBack = {},

View File

@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
@ -26,9 +25,9 @@ import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.model.VersionInfo import co.electriccoin.zcash.ui.common.model.VersionInfo
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.CheckBox import co.electriccoin.zcash.ui.design.component.CheckBox
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.GridBgSmallTopAppBar
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.fixture.VersionInfoFixture import co.electriccoin.zcash.ui.fixture.VersionInfoFixture
@ -37,7 +36,6 @@ import co.electriccoin.zcash.ui.fixture.VersionInfoFixture
@Composable @Composable
private fun SecurityWarningPreview() { private fun SecurityWarningPreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
SecurityWarning( SecurityWarning(
versionInfo = VersionInfoFixture.new(), versionInfo = VersionInfoFixture.new(),
onBack = {}, onBack = {},
@ -46,7 +44,6 @@ private fun SecurityWarningPreview() {
) )
} }
} }
}
// TODO [#998]: Check and enhance screen dark mode // TODO [#998]: Check and enhance screen dark mode
// TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998 // TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998
@ -59,7 +56,7 @@ fun SecurityWarning(
onAcknowledged: (Boolean) -> Unit, onAcknowledged: (Boolean) -> Unit,
onConfirm: () -> Unit, onConfirm: () -> Unit,
) { ) {
Scaffold( GridBgScaffold(
topBar = { SecurityWarningTopAppBar(onBack = onBack) }, topBar = { SecurityWarningTopAppBar(onBack = onBack) },
) { paddingValues -> ) { paddingValues ->
SecurityWarningContent( SecurityWarningContent(
@ -82,7 +79,7 @@ fun SecurityWarning(
@Composable @Composable
private fun SecurityWarningTopAppBar(onBack: () -> Unit) { private fun SecurityWarningTopAppBar(onBack: () -> Unit) {
SmallTopAppBar( GridBgSmallTopAppBar(
backText = stringResource(R.string.security_warning_back).uppercase(), backText = stringResource(R.string.security_warning_back).uppercase(),
backContentDescriptionText = stringResource(R.string.security_warning_back_content_description), backContentDescriptionText = stringResource(R.string.security_warning_back_content_description),
onBack = onBack, onBack = onBack,

View File

@ -21,7 +21,6 @@ import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
@ -47,9 +46,9 @@ import co.electriccoin.zcash.ui.common.test.CommonTag.WALLET_BIRTHDAY
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.BodySmall import co.electriccoin.zcash.ui.design.component.BodySmall
import co.electriccoin.zcash.ui.design.component.ChipGrid import co.electriccoin.zcash.ui.design.component.ChipGrid
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.GridBgSmallTopAppBar
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle import co.electriccoin.zcash.ui.design.component.TopScreenLogoTitle
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.fixture.VersionInfoFixture import co.electriccoin.zcash.ui.fixture.VersionInfoFixture
@ -59,7 +58,6 @@ import kotlinx.collections.immutable.toPersistentList
@Composable @Composable
private fun ComposablePreview() { private fun ComposablePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
SeedRecovery( SeedRecovery(
PersistableWalletFixture.new(), PersistableWalletFixture.new(),
onBack = {}, onBack = {},
@ -71,7 +69,6 @@ private fun ComposablePreview() {
) )
} }
} }
}
// TODO [#998]: Check and enhance screen dark mode // TODO [#998]: Check and enhance screen dark mode
// TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998 // TODO [#998]: https://github.com/Electric-Coin-Company/zashi-android/issues/998
@ -90,7 +87,7 @@ fun SeedRecovery(
versionInfo: VersionInfo, versionInfo: VersionInfo,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold( GridBgScaffold(
topBar = { topBar = {
SeedRecoveryTopAppBar( SeedRecoveryTopAppBar(
onBack = onBack, onBack = onBack,
@ -125,7 +122,7 @@ private fun SeedRecoveryTopAppBar(
showRestoring: Boolean, showRestoring: Boolean,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
SmallTopAppBar( GridBgSmallTopAppBar(
restoringLabel = restoringLabel =
if (showRestoring) { if (showRestoring) {
stringResource(id = R.string.restoring_wallet_label) stringResource(id = R.string.restoring_wallet_label)

View File

@ -22,7 +22,6 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableIntStateOf
@ -66,10 +65,11 @@ import co.electriccoin.zcash.ui.common.model.spendableBalance
import co.electriccoin.zcash.ui.common.test.CommonTag import co.electriccoin.zcash.ui.common.test.CommonTag
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.AppAlertDialog
import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.BodySmall import co.electriccoin.zcash.ui.design.component.BodySmall
import co.electriccoin.zcash.ui.design.component.FormTextField import co.electriccoin.zcash.ui.design.component.FormTextField
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.Small import co.electriccoin.zcash.ui.design.component.Small
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
@ -88,7 +88,6 @@ import java.util.Locale
@Preview("SendForm") @Preview("SendForm")
private fun PreviewSendForm() { private fun PreviewSendForm() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
Send( Send(
sendStage = SendStage.Form, sendStage = SendStage.Form,
onCreateZecSend = {}, onCreateZecSend = {},
@ -110,7 +109,6 @@ private fun PreviewSendForm() {
) )
} }
} }
}
// TODO [#1260]: Cover Send screens UI with tests // TODO [#1260]: Cover Send screens UI with tests
// TODO [#1260]: https://github.com/Electric-Coin-Company/zashi-android/issues/1260 // TODO [#1260]: https://github.com/Electric-Coin-Company/zashi-android/issues/1260
@ -136,7 +134,7 @@ fun Send(
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
walletSnapshot: WalletSnapshot, walletSnapshot: WalletSnapshot,
) { ) {
Scaffold(topBar = { BlankBgScaffold(topBar = {
SendTopAppBar( SendTopAppBar(
showRestoring = walletRestoringState == WalletRestoringState.RESTORING, showRestoring = walletRestoringState == WalletRestoringState.RESTORING,
onSettings = onSettings onSettings = onSettings
@ -725,7 +723,7 @@ fun SendFormMemoTextField(
if (memoState is MemoState.Correct) { if (memoState is MemoState.Correct) {
ZcashTheme.colors.textFieldHint ZcashTheme.colors.textFieldHint
} else { } else {
ZcashTheme.colors.textFieldError ZcashTheme.colors.textFieldWarning
}, },
textAlign = TextAlign.End, textAlign = TextAlign.End,
modifier = modifier =
@ -741,7 +739,7 @@ fun SendFormMemoTextField(
@Preview("SendFailure") @Preview("SendFailure")
private fun PreviewSendFailure() { private fun PreviewSendFailure() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SendFailure( SendFailure(
onDone = {}, onDone = {},
reason = "Insufficient balance" reason = "Insufficient balance"

View File

@ -19,7 +19,6 @@ import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -46,8 +45,9 @@ import co.electriccoin.zcash.ui.common.compose.BalanceWidgetBigLineOnly
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.AppAlertDialog
import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.Small import co.electriccoin.zcash.ui.design.component.Small
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
@ -64,7 +64,6 @@ import kotlinx.coroutines.runBlocking
@Preview("SendConfirmation") @Preview("SendConfirmation")
private fun PreviewSendConfirmation() { private fun PreviewSendConfirmation() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
SendConfirmationContent( SendConfirmationContent(
zecSend = zecSend =
ZecSend( ZecSend(
@ -79,13 +78,11 @@ private fun PreviewSendConfirmation() {
) )
} }
} }
}
@Composable @Composable
@Preview("SendMultipleTransactionFailure") @Preview("SendMultipleTransactionFailure")
private fun PreviewSendMultipleTransactionFailure() { private fun PreviewSendMultipleTransactionFailure() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
@Suppress("MagicNumber") @Suppress("MagicNumber")
MultipleSubmissionFailure( MultipleSubmissionFailure(
onContactSupport = {}, onContactSupport = {},
@ -108,7 +105,6 @@ private fun PreviewSendMultipleTransactionFailure() {
) )
} }
} }
}
// TODO [#1260]: Cover Send screens UI with tests // TODO [#1260]: Cover Send screens UI with tests
// TODO [#1260]: https://github.com/Electric-Coin-Company/zashi-android/issues/1260 // TODO [#1260]: https://github.com/Electric-Coin-Company/zashi-android/issues/1260
@ -125,7 +121,7 @@ fun SendConfirmation(
zecSend: ZecSend, zecSend: ZecSend,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold( BlankBgScaffold(
topBar = { topBar = {
SendConfirmationTopAppBar( SendConfirmationTopAppBar(
onBack = onBack, onBack = onBack,
@ -375,7 +371,7 @@ fun SendConfirmationActionButtons(
@Preview("SendConfirmationFailure") @Preview("SendConfirmationFailure")
private fun PreviewSendConfirmationFailure() { private fun PreviewSendConfirmationFailure() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
SendFailure( SendFailure(
onDone = {}, onDone = {},
reason = "Failed due to network error" reason = "Failed due to network error"

View File

@ -16,7 +16,6 @@ import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
@ -31,7 +30,7 @@ import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.BlankBgScaffold
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -43,7 +42,6 @@ import co.electriccoin.zcash.ui.screen.settings.model.TroubleshootingParameters
@Composable @Composable
private fun PreviewSettings() { private fun PreviewSettings() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
Settings( Settings(
onAbout = {}, onAbout = {},
onAdvancedSettings = {}, onAdvancedSettings = {},
@ -65,7 +63,6 @@ private fun PreviewSettings() {
) )
} }
} }
}
@Composable @Composable
@Suppress("LongParameterList") @Suppress("LongParameterList")
@ -81,7 +78,7 @@ fun Settings(
troubleshootingParameters: TroubleshootingParameters, troubleshootingParameters: TroubleshootingParameters,
walletRestoringState: WalletRestoringState, walletRestoringState: WalletRestoringState,
) { ) {
Scaffold(topBar = { BlankBgScaffold(topBar = {
SettingsTopAppBar( SettingsTopAppBar(
troubleshootingParameters = troubleshootingParameters, troubleshootingParameters = troubleshootingParameters,
onBackgroundSyncSettingsChanged = onBackgroundSyncSettingsChanged, onBackgroundSyncSettingsChanged = onBackgroundSyncSettingsChanged,

View File

@ -10,7 +10,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -32,18 +31,19 @@ import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.model.WalletRestoringState import co.electriccoin.zcash.ui.common.model.WalletRestoringState
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.AppAlertDialog
import co.electriccoin.zcash.ui.design.component.BlankSurface
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.FormTextField import co.electriccoin.zcash.ui.design.component.FormTextField
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.GridBgSmallTopAppBar
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Preview("Support") @Preview("Support")
@Composable @Composable
private fun PreviewSupport() { private fun PreviewSupport() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface { BlankSurface {
Support( Support(
isShowingDialog = false, isShowingDialog = false,
setShowDialog = {}, setShowDialog = {},
@ -60,14 +60,12 @@ private fun PreviewSupport() {
@Composable @Composable
private fun PreviewSupportPopup() { private fun PreviewSupportPopup() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
SupportConfirmationDialog( SupportConfirmationDialog(
onConfirm = {}, onConfirm = {},
onDismiss = {} onDismiss = {}
) )
} }
} }
}
@Composable @Composable
@Suppress("LongParameterList") @Suppress("LongParameterList")
@ -81,7 +79,7 @@ fun Support(
) { ) {
val (message, setMessage) = rememberSaveable { mutableStateOf("") } val (message, setMessage) = rememberSaveable { mutableStateOf("") }
Scaffold( GridBgScaffold(
topBar = { topBar = {
SupportTopAppBar( SupportTopAppBar(
onBack = onBack, onBack = onBack,
@ -117,7 +115,7 @@ private fun SupportTopAppBar(
onBack: () -> Unit, onBack: () -> Unit,
showRestoring: Boolean showRestoring: Boolean
) { ) {
SmallTopAppBar( GridBgSmallTopAppBar(
restoringLabel = restoringLabel =
if (showRestoring) { if (showRestoring) {
stringResource(id = R.string.restoring_wallet_label) stringResource(id = R.string.restoring_wallet_label)

View File

@ -15,7 +15,6 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.DividerDefaults import androidx.compose.material3.DividerDefaults
import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -31,10 +30,10 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgScaffold
import co.electriccoin.zcash.ui.design.component.GridBgSmallTopAppBar
import co.electriccoin.zcash.ui.design.component.PrimaryButton import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.component.Reference import co.electriccoin.zcash.ui.design.component.Reference
import co.electriccoin.zcash.ui.design.component.SmallTopAppBar
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
import co.electriccoin.zcash.ui.fixture.UpdateInfoFixture import co.electriccoin.zcash.ui.fixture.UpdateInfoFixture
import co.electriccoin.zcash.ui.screen.update.UpdateTag import co.electriccoin.zcash.ui.screen.update.UpdateTag
@ -45,7 +44,6 @@ import co.electriccoin.zcash.ui.screen.update.model.UpdateState
@Composable @Composable
private fun PreviewUpdate() { private fun PreviewUpdate() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
Update( Update(
snackbarHostState = SnackbarHostState(), snackbarHostState = SnackbarHostState(),
UpdateInfoFixture.new(appUpdateInfo = null), UpdateInfoFixture.new(appUpdateInfo = null),
@ -55,7 +53,6 @@ private fun PreviewUpdate() {
) )
} }
} }
}
@Composable @Composable
fun Update( fun Update(
@ -65,7 +62,7 @@ fun Update(
onLater: () -> Unit, onLater: () -> Unit,
onReference: () -> Unit onReference: () -> Unit
) { ) {
Scaffold( GridBgScaffold(
topBar = { topBar = {
UpdateTopAppBar(updateInfo = updateInfo) UpdateTopAppBar(updateInfo = updateInfo)
}, },
@ -81,7 +78,7 @@ fun Update(
) )
} }
) { paddingValues -> ) { paddingValues ->
UpdateContentContent( UpdateContent(
onReference = onReference, onReference = onReference,
updateInfo = updateInfo, updateInfo = updateInfo,
modifier = modifier =
@ -118,7 +115,7 @@ fun UpdateOverlayRunning(updateInfo: UpdateInfo) {
@Composable @Composable
private fun UpdateTopAppBar(updateInfo: UpdateInfo) { private fun UpdateTopAppBar(updateInfo: UpdateInfo) {
SmallTopAppBar( GridBgSmallTopAppBar(
titleText = titleText =
stringResource( stringResource(
updateInfo.isForce.let { force -> updateInfo.isForce.let { force ->
@ -207,7 +204,7 @@ private fun UpdateBottomAppBar(
@Composable @Composable
@Suppress("LongMethod") @Suppress("LongMethod")
private fun UpdateContentContent( private fun UpdateContent(
onReference: () -> Unit, onReference: () -> Unit,
updateInfo: UpdateInfo, updateInfo: UpdateInfo,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,

View File

@ -2,7 +2,6 @@ package co.electriccoin.zcash.ui.screen.warning.view
import androidx.compose.foundation.Image import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
@ -19,7 +18,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.design.component.Body import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.GradientSurface import co.electriccoin.zcash.ui.design.component.GridBgColumn
import co.electriccoin.zcash.ui.design.component.Header import co.electriccoin.zcash.ui.design.component.Header
import co.electriccoin.zcash.ui.design.component.Small import co.electriccoin.zcash.ui.design.component.Small
import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@ -28,21 +27,19 @@ import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Composable @Composable
private fun NotEnoughSpacePreview() { private fun NotEnoughSpacePreview() {
ZcashTheme(forceDarkMode = false) { ZcashTheme(forceDarkMode = false) {
GradientSurface {
NotEnoughSpaceView( NotEnoughSpaceView(
storageSpaceRequiredGigabytes = 1, storageSpaceRequiredGigabytes = 1,
spaceRequiredToContinueMegabytes = 300 spaceRequiredToContinueMegabytes = 300
) )
} }
} }
}
@Composable @Composable
fun NotEnoughSpaceView( fun NotEnoughSpaceView(
storageSpaceRequiredGigabytes: Int, storageSpaceRequiredGigabytes: Int,
spaceRequiredToContinueMegabytes: Int spaceRequiredToContinueMegabytes: Int
) { ) {
Column( GridBgColumn(
Modifier Modifier
.fillMaxSize() .fillMaxSize()
.padding(ZcashTheme.dimens.screenHorizontalSpacingRegular) .padding(ZcashTheme.dimens.screenHorizontalSpacingRegular)