Skip to content

Commit

Permalink
PM-12322: Complete app-wide color scheme update
Browse files Browse the repository at this point in the history
  • Loading branch information
david-livefront committed Oct 3, 2024
1 parent fd6b276 commit a229d85
Show file tree
Hide file tree
Showing 149 changed files with 1,132 additions and 1,160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -221,14 +220,14 @@ private fun OrderedHeaderContent() {
Text(
text = stringResource(R.string.turn_on_autofill),
style = BitwardenTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
)
Spacer(modifier = Modifier.height(8.dp))
Text(
text = stringResource(R.string.use_autofill_to_log_into_your_accounts),
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
// Apply similar line breaks to design
modifier = Modifier.sizeIn(maxWidth = 300.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
Expand Down Expand Up @@ -92,7 +91,7 @@ private fun SetupCompleteContent(
Text(
text = stringResource(R.string.youre_all_set),
style = BitwardenTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier
.align(CenterHorizontally)
Expand All @@ -102,7 +101,7 @@ private fun SetupCompleteContent(
Text(
text = stringResource(R.string.what_bitwarden_has_to_offer),
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier
.align(CenterHorizontally)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberTopAppBarState
Expand Down Expand Up @@ -229,7 +228,7 @@ private fun ColumnScope.SetupUnlockHeaderPortrait() {
Text(
text = stringResource(id = R.string.set_up_unlock),
style = BitwardenTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
Expand All @@ -243,7 +242,7 @@ private fun ColumnScope.SetupUnlockHeaderPortrait() {
id = R.string.set_up_biometrics_or_choose_a_pin_code_to_quickly_access_your_vault_and_autofill_your_logins,
),
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
Expand Down Expand Up @@ -275,7 +274,7 @@ private fun SetupUnlockHeaderLandscape(
Text(
text = stringResource(id = R.string.set_up_unlock),
style = BitwardenTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth(),
)
Expand All @@ -287,7 +286,7 @@ private fun SetupUnlockHeaderLandscape(
id = R.string.set_up_biometrics_or_choose_a_pin_code_to_quickly_access_your_vault_and_autofill_your_logins,
),
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.ClickableText
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberTopAppBarState
Expand Down Expand Up @@ -151,7 +150,7 @@ private fun CheckEmailContent(
text = stringResource(id = R.string.check_your_email),
textAlign = TextAlign.Center,
style = BitwardenTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
modifier = Modifier
.padding(horizontal = 8.dp)
.wrapContentHeight()
Expand All @@ -166,7 +165,7 @@ private fun CheckEmailContent(
),
highlights = listOf(email),
highlightStyle = SpanStyle(
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
fontSize = BitwardenTheme.typography.bodyMedium.fontSize,
fontWeight = FontWeight.Bold,
),
Expand All @@ -186,7 +185,7 @@ private fun CheckEmailContent(
Text(
text = stringResource(R.string.select_the_link_in_the_email_to_verify_your_email_address_and_continue_creating_your_account),
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier
.padding(horizontal = 8.dp)
Expand Down Expand Up @@ -226,7 +225,7 @@ private fun CheckEmailLegacyContent(
Spacer(modifier = Modifier.height(32.dp))
Image(
painter = rememberVectorPainter(id = R.drawable.email_check),
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.primary),
colorFilter = ColorFilter.tint(BitwardenTheme.colorScheme.icon.secondary),
contentDescription = null,
contentScale = ContentScale.FillHeight,
modifier = Modifier
Expand All @@ -239,7 +238,7 @@ private fun CheckEmailLegacyContent(
text = stringResource(id = R.string.check_your_email),
textAlign = TextAlign.Center,
style = BitwardenTheme.typography.headlineSmall,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
modifier = Modifier
.padding(horizontal = 24.dp)
.wrapContentHeight()
Expand All @@ -255,7 +254,7 @@ private fun CheckEmailLegacyContent(
),
highlights = listOf(email),
highlightStyle = SpanStyle(
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
fontSize = BitwardenTheme.typography.bodyMedium.fontSize,
fontWeight = FontWeight.Bold,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberTopAppBarState
Expand Down Expand Up @@ -142,8 +141,8 @@ fun CompleteRegistrationScreen(
BitwardenTopAppBar(
title = stringResource(
id = R.string.create_account
.takeIf { state.onboardingEnabled }
?: R.string.set_password),
.takeIf { state.onboardingEnabled }
?: R.string.set_password),
scrollBehavior = scrollBehavior,
navigationIcon = rememberVectorPainter(id = R.drawable.ic_back),
navigationIconContentDescription = stringResource(id = R.string.back),
Expand Down Expand Up @@ -362,7 +361,7 @@ private fun LegacyHeaderContent(
userEmail,
),
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
color = BitwardenTheme.colorScheme.text.primary,
modifier = modifier
.fillMaxWidth(),
)
Expand All @@ -386,7 +385,7 @@ private fun OrderedHeaderContent() {
Text(
text = stringResource(R.string.choose_your_master_password),
style = BitwardenTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
)
Spacer(modifier = Modifier.height(8.dp))
Expand All @@ -395,7 +394,7 @@ private fun OrderedHeaderContent() {
R.string.choose_a_unique_and_strong_password_to_keep_your_information_safe,
),
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand All @@ -31,7 +30,6 @@ import com.x8bit.bitwarden.R
import com.x8bit.bitwarden.ui.platform.base.util.asText
import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter
import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
import com.x8bit.bitwarden.ui.platform.theme.LocalNonMaterialColors

/**
* Draws a password indicator that displays password strength based on the given [state].
Expand All @@ -56,12 +54,12 @@ fun PasswordStrengthIndicator(
label = "Width Percent State",
)
val indicatorColor = when (state) {
PasswordStrengthState.NONE -> MaterialTheme.colorScheme.error
PasswordStrengthState.WEAK_1 -> MaterialTheme.colorScheme.error
PasswordStrengthState.WEAK_2 -> MaterialTheme.colorScheme.error
PasswordStrengthState.WEAK_3 -> LocalNonMaterialColors.current.passwordWeak
PasswordStrengthState.GOOD -> MaterialTheme.colorScheme.primary
PasswordStrengthState.STRONG -> LocalNonMaterialColors.current.passwordStrong
PasswordStrengthState.NONE -> BitwardenTheme.colorScheme.status.error
PasswordStrengthState.WEAK_1 -> BitwardenTheme.colorScheme.status.error
PasswordStrengthState.WEAK_2 -> BitwardenTheme.colorScheme.status.weak2
PasswordStrengthState.WEAK_3 -> BitwardenTheme.colorScheme.status.weak2
PasswordStrengthState.GOOD -> BitwardenTheme.colorScheme.status.good
PasswordStrengthState.STRONG -> BitwardenTheme.colorScheme.status.strong
}
val animatedIndicatorColor by animateColorAsState(
targetValue = indicatorColor,
Expand All @@ -82,7 +80,7 @@ fun PasswordStrengthIndicator(
Modifier
.fillMaxWidth()
.height(4.dp)
.background(MaterialTheme.colorScheme.surfaceContainerHigh),
.background(BitwardenTheme.colorScheme.sliderButton.unfilled),
) {
Box(
modifier = Modifier
Expand Down Expand Up @@ -124,12 +122,11 @@ private fun MinimumCharacterCount(
minimumRequirementMet: Boolean,
minimumCharacterCount: Int,
) {
val nonMaterialColors = LocalNonMaterialColors.current
val characterCountColor by animateColorAsState(
targetValue = if (minimumRequirementMet) {
nonMaterialColors.passwordStrong
BitwardenTheme.colorScheme.status.strong
} else {
MaterialTheme.colorScheme.surfaceDim
BitwardenTheme.colorScheme.text.secondary
},
label = "minmumCharacterCountColor",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Switch
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
Expand Down Expand Up @@ -77,6 +76,7 @@ import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextField
import com.x8bit.bitwarden.ui.platform.components.scaffold.BitwardenScaffold
import com.x8bit.bitwarden.ui.platform.components.text.BitwardenClickableText
import com.x8bit.bitwarden.ui.platform.components.toggle.BitwardenSwitch
import com.x8bit.bitwarden.ui.platform.components.toggle.color.bitwardenSwitchColors
import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter
import com.x8bit.bitwarden.ui.platform.composition.LocalIntentManager
import com.x8bit.bitwarden.ui.platform.manager.intent.IntentManager
Expand Down Expand Up @@ -309,7 +309,9 @@ private fun TermsAndPrivacySwitch(
}
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = ripple(color = MaterialTheme.colorScheme.primary),
indication = ripple(
color = BitwardenTheme.colorScheme.background.pressed,
),
onClick = { onCheckedChange.invoke(!isChecked) },
)
.padding(start = 16.dp)
Expand All @@ -321,12 +323,13 @@ private fun TermsAndPrivacySwitch(
.width(52.dp),
checked = isChecked,
onCheckedChange = null,
colors = bitwardenSwitchColors(),
)
Column(Modifier.padding(start = 16.dp, top = 4.dp, bottom = 4.dp)) {
Text(
text = stringResource(id = R.string.accept_policies),
style = BitwardenTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
)
FlowRow(
horizontalArrangement = Arrangement.Start,
Expand All @@ -340,12 +343,11 @@ private fun TermsAndPrivacySwitch(
onClick = onTermsClick,
style = BitwardenTheme.typography.bodyMedium,
innerPadding = PaddingValues(vertical = 4.dp, horizontal = 0.dp),
color = MaterialTheme.colorScheme.primary,
)
Text(
text = ",",
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.primary,
color = BitwardenTheme.colorScheme.text.primary,
modifier = Modifier.padding(vertical = 4.dp),
)
Spacer(modifier = Modifier.width(4.dp))
Expand All @@ -354,7 +356,6 @@ private fun TermsAndPrivacySwitch(
onClick = onPrivacyPolicyClick,
style = BitwardenTheme.typography.bodyMedium,
innerPadding = PaddingValues(vertical = 4.dp, horizontal = 0.dp),
color = MaterialTheme.colorScheme.primary,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberTopAppBarState
Expand Down Expand Up @@ -157,7 +156,7 @@ private fun EnterpriseSignOnScreenContent(
text = stringResource(id = R.string.log_in_sso_summary),
textAlign = TextAlign.Start,
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
color = BitwardenTheme.colorScheme.text.primary,
modifier = Modifier
.padding(horizontal = 16.dp)
.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -108,7 +107,7 @@ private fun ExpiredRegistrationLinkContent(
Text(
text = stringResource(R.string.expired_link),
style = BitwardenTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
Expand All @@ -118,7 +117,7 @@ private fun ExpiredRegistrationLinkContent(
Text(
text = stringResource(R.string.please_restart_registration_or_try_logging_in),
style = BitwardenTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
color = BitwardenTheme.colorScheme.text.primary,
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
Expand Down
Loading

0 comments on commit a229d85

Please sign in to comment.