-
Notifications
You must be signed in to change notification settings - Fork 849
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PM-17388 Update existing and v3 email verification screen to match de…
…sign audit (#4645)
- Loading branch information
1 parent
6a1f37b
commit 76c7f8c
Showing
8 changed files
with
33 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.imePadding | ||
import androidx.compose.foundation.layout.navigationBarsPadding | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.wrapContentHeight | ||
import androidx.compose.foundation.rememberScrollState | ||
|
@@ -40,7 +39,7 @@ import com.x8bit.bitwarden.ui.platform.base.util.standardHorizontalMargin | |
import com.x8bit.bitwarden.ui.platform.base.util.toAnnotatedString | ||
import com.x8bit.bitwarden.ui.platform.components.appbar.BitwardenTopAppBar | ||
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledButton | ||
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTextButton | ||
import com.x8bit.bitwarden.ui.platform.components.button.BitwardenOutlinedButton | ||
import com.x8bit.bitwarden.ui.platform.components.scaffold.BitwardenScaffold | ||
import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter | ||
import com.x8bit.bitwarden.ui.platform.composition.LocalIntentManager | ||
|
@@ -55,7 +54,6 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme | |
@Composable | ||
fun CheckEmailScreen( | ||
onNavigateBack: () -> Unit, | ||
onNavigateBackToLanding: () -> Unit, | ||
intentManager: IntentManager = LocalIntentManager.current, | ||
viewModel: CheckEmailViewModel = hiltViewModel(), | ||
) { | ||
|
@@ -70,8 +68,6 @@ fun CheckEmailScreen( | |
is CheckEmailEvent.NavigateToEmailApp -> { | ||
intentManager.startDefaultEmailApplication() | ||
} | ||
|
||
CheckEmailEvent.NavigateBackToLanding -> onNavigateBackToLanding() | ||
} | ||
} | ||
|
||
|
@@ -101,16 +97,15 @@ fun CheckEmailScreen( | |
email = state.email, | ||
onOpenEmailAppClick = handler.onOpenEmailAppClick, | ||
onChangeEmailClick = handler.onChangeEmailClick, | ||
modifier = Modifier.standardHorizontalMargin(), | ||
) | ||
} else { | ||
CheckEmailLegacyContent( | ||
email = state.email, | ||
onOpenEmailAppClick = handler.onOpenEmailAppClick, | ||
onChangeEmailClick = handler.onChangeEmailClick, | ||
onLoginClick = handler.onLoginClick, | ||
) | ||
} | ||
Spacer(modifier = Modifier.height(12.dp)) | ||
Spacer(modifier = Modifier.navigationBarsPadding()) | ||
} | ||
} | ||
|
@@ -133,9 +128,11 @@ private fun CheckEmailContent( | |
Image( | ||
painter = rememberVectorPainter(id = R.drawable.open_email), | ||
contentDescription = null, | ||
contentScale = ContentScale.Fit, | ||
contentScale = ContentScale.FillHeight, | ||
modifier = Modifier | ||
.size(100.dp), | ||
.standardHorizontalMargin() | ||
.size(100.dp) | ||
.fillMaxWidth(), | ||
) | ||
Spacer(modifier = Modifier.height(32.dp)) | ||
Text( | ||
|
@@ -144,9 +141,9 @@ private fun CheckEmailContent( | |
style = BitwardenTheme.typography.titleMedium, | ||
color = BitwardenTheme.colorScheme.text.primary, | ||
modifier = Modifier | ||
.padding(horizontal = 8.dp) | ||
.wrapContentHeight() | ||
.fillMaxWidth(), | ||
.fillMaxWidth() | ||
.standardHorizontalMargin(), | ||
) | ||
Spacer(modifier = Modifier.height(8.dp)) | ||
|
||
|
@@ -163,9 +160,9 @@ private fun CheckEmailContent( | |
textAlign = TextAlign.Center, | ||
style = BitwardenTheme.typography.bodyMedium, | ||
modifier = Modifier | ||
.padding(horizontal = 8.dp) | ||
.fillMaxWidth() | ||
.wrapContentHeight(), | ||
.wrapContentHeight() | ||
.standardHorizontalMargin(), | ||
) | ||
Spacer(modifier = Modifier.height(16.dp)) | ||
@Suppress("MaxLineLength") | ||
|
@@ -175,22 +172,26 @@ private fun CheckEmailContent( | |
color = BitwardenTheme.colorScheme.text.primary, | ||
textAlign = TextAlign.Center, | ||
modifier = Modifier | ||
.padding(horizontal = 8.dp) | ||
.fillMaxWidth() | ||
.wrapContentHeight(), | ||
.wrapContentHeight() | ||
.standardHorizontalMargin(), | ||
) | ||
Spacer(modifier = Modifier.height(32.dp)) | ||
BitwardenFilledButton( | ||
label = stringResource(id = R.string.open_email_app), | ||
onClick = onOpenEmailAppClick, | ||
modifier = Modifier | ||
.testTag("OpenEmailApp") | ||
.fillMaxWidth(), | ||
.fillMaxWidth() | ||
.standardHorizontalMargin(), | ||
) | ||
Spacer(modifier = Modifier.height(12.dp)) | ||
BitwardenTextButton( | ||
BitwardenOutlinedButton( | ||
label = stringResource(R.string.change_email_address), | ||
onClick = onChangeEmailClick, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.standardHorizontalMargin(), | ||
) | ||
} | ||
} | ||
|
@@ -201,7 +202,6 @@ private fun CheckEmailLegacyContent( | |
email: String, | ||
onOpenEmailAppClick: () -> Unit, | ||
onChangeEmailClick: () -> Unit, | ||
onLoginClick: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column( | ||
|
@@ -216,7 +216,7 @@ private fun CheckEmailLegacyContent( | |
contentDescription = null, | ||
contentScale = ContentScale.FillHeight, | ||
modifier = Modifier | ||
.padding(horizontal = 16.dp) | ||
.standardHorizontalMargin() | ||
.height(112.dp) | ||
.fillMaxWidth(), | ||
) | ||
|
@@ -227,7 +227,7 @@ private fun CheckEmailLegacyContent( | |
style = BitwardenTheme.typography.headlineSmall, | ||
color = BitwardenTheme.colorScheme.text.primary, | ||
modifier = Modifier | ||
.padding(horizontal = 24.dp) | ||
.standardHorizontalMargin() | ||
.wrapContentHeight() | ||
.fillMaxWidth(), | ||
) | ||
|
@@ -236,7 +236,7 @@ private fun CheckEmailLegacyContent( | |
@Suppress("MaxLineLength") | ||
val descriptionAnnotatedString = | ||
R.string.follow_the_instructions_in_the_email_sent_to_x_to_continue_creating_your_account.toAnnotatedString( | ||
email, | ||
args = arrayOf(email), | ||
emphasisHighlightStyle = SpanStyle( | ||
color = BitwardenTheme.colorScheme.text.primary, | ||
fontSize = BitwardenTheme.typography.bodyMedium.fontSize, | ||
|
@@ -247,8 +247,8 @@ private fun CheckEmailLegacyContent( | |
text = descriptionAnnotatedString, | ||
textAlign = TextAlign.Center, | ||
modifier = Modifier | ||
.padding(horizontal = 24.dp) | ||
.fillMaxWidth() | ||
.standardHorizontalMargin() | ||
.wrapContentHeight(), | ||
) | ||
Spacer(modifier = Modifier.height(32.dp)) | ||
|
@@ -257,27 +257,18 @@ private fun CheckEmailLegacyContent( | |
onClick = onOpenEmailAppClick, | ||
modifier = Modifier | ||
.testTag("OpenEmailApp") | ||
.padding(horizontal = 16.dp) | ||
.standardHorizontalMargin() | ||
.fillMaxWidth(), | ||
) | ||
Spacer(modifier = Modifier.height(32.dp)) | ||
Column( | ||
modifier = Modifier.fillMaxSize(), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
Text( | ||
text = R.string.no_email_go_back_to_edit_your_email_address.toAnnotatedString { | ||
onChangeEmailClick() | ||
}, | ||
) | ||
Spacer(modifier = Modifier.height(32.dp)) | ||
Text( | ||
text = R.string.or_log_in_you_may_already_have_an_account | ||
.toAnnotatedString { | ||
onLoginClick() | ||
}, | ||
) | ||
} | ||
Spacer(modifier = Modifier.height(12.dp)) | ||
|
||
BitwardenOutlinedButton( | ||
label = stringResource(R.string.change_email_address), | ||
onClick = onChangeEmailClick, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.standardHorizontalMargin(), | ||
) | ||
} | ||
} | ||
|
||
|
@@ -289,7 +280,6 @@ private fun CheckEmailScreenNewUi_preview() { | |
email = "[email protected]", | ||
onOpenEmailAppClick = { }, | ||
onChangeEmailClick = { }, | ||
modifier = Modifier.standardHorizontalMargin(), | ||
) | ||
} | ||
} | ||
|
@@ -302,7 +292,6 @@ private fun CheckEmailScreenLegacy_preview() { | |
email = "[email protected]", | ||
onOpenEmailAppClick = { }, | ||
onChangeEmailClick = { }, | ||
onLoginClick = {}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters