[#915] Black and white color themes

* [#915] Black and white color themes

- Simplified color model to just black and white colors
- Reworked send fab button to a regular primary button
This commit is contained in:
Honza Rychnovský 2023-08-07 14:52:24 +02:00 committed by GitHub
parent 02ae3166e1
commit 6ec3c95914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 72 additions and 62 deletions

View File

@ -9,38 +9,38 @@ import androidx.compose.ui.graphics.Color
import co.electriccoin.zcash.ui.design.theme.ExtendedColors
internal object Dark {
val backgroundStart = Color(0xff243155)
val backgroundEnd = Color(0xff29365A)
val backgroundStart = Color(0xFF000000)
val backgroundEnd = Color(0xFF000000)
val textHeaderOnBackground = Color(0xffCBDCF2)
val textBodyOnBackground = Color(0xFF93A4BE)
val textPrimaryButton = Color(0xFF0F2341)
val textSecondaryButton = Color(0xFF0F2341)
val textHeaderOnBackground = Color(0xFFFFFFFF)
val textBodyOnBackground = Color(0xFFFFFFFF)
val textPrimaryButton = Color(0xFF000000)
val textSecondaryButton = Color(0xFF000000)
val textTertiaryButton = Color.White
val textNavigationButton = Color.Black
val textCaption = Color(0xFF68728B)
val textCaption = Color(0xFFFFFFFF)
val textChipIndex = Color(0xFFFFB900)
val primaryButton = Color(0xFFFFB900)
val primaryButtonPressed = Color(0xFFFFD800)
val primaryButtonDisabled = Color(0x33F4B728)
val primaryButton = Color(0xFFFFFFFF)
val primaryButtonPressed = Color(0xFFFFFFFF)
val primaryButtonDisabled = Color(0xFFFFFFFF)
val secondaryButton = Color(0xFFA7C0D9)
val secondaryButtonPressed = Color(0xFFC8DCEF)
val secondaryButtonDisabled = Color(0x33C8DCEF)
val secondaryButton = Color(0xFFFFFFFF)
val secondaryButtonPressed = Color(0xFFFFFFFF)
val secondaryButtonDisabled = Color(0xFFFFFFFF)
val tertiaryButton = Color.Transparent
val tertiaryButtonPressed = Color(0xB0C3D2BA)
val tertiaryButtonPressed = Color(0xFFFFFFFF)
val navigationButton = Color(0xFFA7C0D9)
val navigationButtonPressed = Color(0xFFC8DCEF)
val navigationButton = Color(0xFFFFFFFF)
val navigationButtonPressed = Color(0xFFFFFFFF)
val progressStart = Color(0xFFF364CE)
val progressEnd = Color(0xFFF8964F)
val progressBackground = Color(0xFF929bb3)
val callout = Color(0xFFa7bed8)
val onCallout = Color(0xFF3d698f)
val callout = Color(0xFFFFFFFF)
val onCallout = Color(0xFFFFFFFF)
val overlay = Color(0x22000000)
val highlight = Color(0xFFFFD800)
@ -57,40 +57,40 @@ internal object Dark {
}
internal object Light {
val backgroundStart = Color(0xFFE3EFF9)
val backgroundEnd = Color(0xFFD2E4F3)
val backgroundStart = Color(0xFFFFFFFF)
val backgroundEnd = Color(0xFFFFFFFF)
val textHeaderOnBackground = Color(0xff2D3747)
val textBodyOnBackground = Color(0xFF7B8897)
val textNavigationButton = Color(0xFF7B8897)
val textPrimaryButton = Color(0xFFF2F7FC)
val textSecondaryButton = Color(0xFF2E476E)
val textTertiaryButton = Color(0xFF283559)
val textCaption = Color(0xFF2D3747)
val textHeaderOnBackground = Color(0xFF000000)
val textBodyOnBackground = Color(0xFF000000)
val textNavigationButton = Color(0xFFFFFFFF)
val textPrimaryButton = Color(0xFFFFFFFF)
val textSecondaryButton = Color(0xFF000000)
val textTertiaryButton = Color(0xFF000000)
val textCaption = Color(0xFF000000)
val textChipIndex = Color(0xFFEE8592)
// TODO [#159]: The button colors are wrong for light
// TODO [#159]: https://github.com/zcash/secant-android-wallet/issues/159
val primaryButton = Color(0xFF263357)
val primaryButtonPressed = Color(0xFFFFD800)
val primaryButtonDisabled = Color(0x33F4B728)
val primaryButton = Color(0xFF000000)
val primaryButtonPressed = Color(0xFF000000)
val primaryButtonDisabled = Color(0xFF000000)
val secondaryButton = Color(0xFFE8F3FA)
val secondaryButtonPressed = Color(0xFFFAFBFD)
val secondaryButtonDisabled = Color(0xFFE6EFF8)
val secondaryButton = Color(0xFFFFFFFF)
val secondaryButtonPressed = Color(0xFFFFFFFF)
val secondaryButtonDisabled = Color(0xFFFFFFFF)
val tertiaryButton = Color.Transparent
val tertiaryButtonPressed = Color(0xFFFFFFFF)
val navigationButton = Color(0xFFE3EDF7)
val navigationButtonPressed = Color(0xFFE3EDF7)
val navigationButton = Color(0xFFFFFFFF)
val navigationButtonPressed = Color(0xFFFFFFFF)
val progressStart = Color(0xFFF364CE)
val progressEnd = Color(0xFFF8964F)
val progressBackground = Color(0xFFbeccdf)
val progressBackground = Color(0xFFFFFFFF)
val callout = Color(0xFFe6f0f9)
val onCallout = Color(0xFFa1b8d0)
val callout = Color(0xFFFFFFFF)
val onCallout = Color(0xFFFFFFFF)
val overlay = Color(0x22000000)
val highlight = Color(0xFFFFD800)

View File

@ -2,7 +2,6 @@ package co.electriccoin.zcash.ui.screen.support.view
import androidx.compose.ui.test.junit4.StateRestorationTester
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performTextInput
@ -62,7 +61,7 @@ class SupportViewIntegrationTest : UiTestPrerequisites() {
it.assertDoesNotExist()
}
composeTestRule.onNodeWithContentDescription(getStringResource(R.string.support_send)).also {
composeTestRule.onNodeWithText(getStringResource(R.string.support_send)).also {
it.performClick()
}

View File

@ -115,7 +115,7 @@ private fun ComposeContentTestRule.clickBack() {
}
private fun ComposeContentTestRule.clickSend() {
onNodeWithContentDescription(getStringResource(R.string.support_send)).also {
onNodeWithText(getStringResource(R.string.support_send)).also {
it.performClick()
}
}

View File

@ -57,7 +57,6 @@ private fun ShortOnboardingComposablePreview() {
* @param onCreateWallet Callback when the user decides to create a new wallet.
*/
@Composable
@OptIn(ExperimentalMaterial3Api::class)
fun ShortOnboarding(
isDebugMenuEnabled: Boolean,
onImportWallet: () -> Unit,

View File

@ -43,6 +43,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color
@ -404,10 +405,15 @@ private fun NextWordTextField(
Surface(
modifier = modifier
.fillMaxWidth()
.padding(dimens.spacingTiny),
.padding(dimens.spacingTiny)
.shadow(
elevation = 12.dp,
ambientColor = MaterialTheme.colorScheme.primary,
spotColor = MaterialTheme.colorScheme.primary
),
shape = RectangleShape,
color = MaterialTheme.colorScheme.secondary,
shadowElevation = 8.dp
color = MaterialTheme.colorScheme.surface,
) {
/*
* Treat the user input as a password for more secure input, but disable the transformation

View File

@ -1,6 +1,7 @@
package co.electriccoin.zcash.ui.screen.support.view
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
@ -10,10 +11,8 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Send
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
@ -29,10 +28,12 @@ import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.FormTextField
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.NavigationButton
import co.electriccoin.zcash.ui.design.component.PrimaryButton
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
@Preview("Support")
@ -75,22 +76,12 @@ fun Support(
topBar = {
SupportTopAppBar(onBack = onBack)
},
snackbarHost = { SnackbarHost(snackbarHostState) },
floatingActionButton = {
FloatingActionButton(
shape = RectangleShape,
onClick = { setShowDialog(true) }
) {
Icon(
imageVector = Icons.Filled.Send,
contentDescription = stringResource(id = R.string.support_send)
)
}
}
snackbarHost = { SnackbarHost(snackbarHostState) }
) { paddingValues ->
SupportMainContent(
message = message,
setMessage = setMessage,
setShowDialog = setShowDialog,
modifier = Modifier.padding(
top = paddingValues.calculateTopPadding() + ZcashTheme.dimens.spacingDefault,
bottom = paddingValues.calculateBottomPadding() + ZcashTheme.dimens.spacingDefault,
@ -130,6 +121,7 @@ private fun SupportTopAppBar(onBack: () -> Unit) {
private fun SupportMainContent(
message: String,
setMessage: (String) -> Unit,
setShowDialog: (Boolean) -> Unit,
modifier: Modifier = Modifier
) {
Column(
@ -155,6 +147,20 @@ private fun SupportMainContent(
Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingLarge))
Body(stringResource(id = R.string.support_disclaimer))
Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingLarge))
Spacer(
modifier = Modifier
.fillMaxHeight()
.weight(MINIMAL_WEIGHT)
)
PrimaryButton(
onClick = { setShowDialog(true) },
text = stringResource(id = R.string.support_send),
outerPaddingValues = PaddingValues(all = ZcashTheme.dimens.spacingNone)
)
}
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="splash_screen_background">#FF273458</color>
<color name="splash_screen_background">#FF000000</color>
</resources>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="splash_screen_background">#FFECF4FB</color>
<color name="splash_screen_background">#FFFFFFFF</color>
</resources>

View File

@ -8,7 +8,7 @@
<string name="support_confirmation_dialog_cancel">Cancel</string>
<string name="support_confirmation_explanation"><xliff:g id="app_name" example="Zcash">%1$s</xliff:g> is about to open your email app with a pre-filled message.\n\nBe sure to hit send within your email app.</string>
<!-- This is replaced by a resource overlay via app/build.gradle.kts -->
<string name="support_email_address"></string>
<string name="support_email_address" />
<string name="support_information">Please let us know about any problems you have had, or features you want to see in the future.</string>
<string name="support_disclaimer">Information provided is handled in accordance with our Privacy Policy.</string>
<string name="support_unable_to_open_email">Unable to launch email app.</string>