Skip to content

Commit

Permalink
Fix seed visibility (#1691)
Browse files Browse the repository at this point in the history
* Fix seed view words visibility

* Code cleanup

* Add better clipping to ripple effect

* Changelogs update

---------

Co-authored-by: Honza <[email protected]>
  • Loading branch information
Milan-Cerovsky and HonzaR authored Nov 20, 2024
1 parent 3ea088e commit 224344d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 20 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2
- Flexa feature has been turned on
- Disclaimer added to integrations screen

### Fixed
- The Seed screen recovery phrase has been improved to properly display on small screens

## [1.2.2 (789)] - 2024-11-18

### Added
Expand Down
3 changes: 3 additions & 0 deletions docs/whatsNew/WHATS_NEW_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ directly impact users rather than highlighting other key architectural updates.*
- Flexa feature has been turned on
- Disclaimer added to integrations screen

### Fixed
- The Seed screen recovery phrase has been improved to properly display on small screens

## [1.2.2 (789)] - 2024-11-18

### Added
Expand Down
3 changes: 3 additions & 0 deletions docs/whatsNew/WHATS_NEW_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ directly impact users rather than highlighting other key architectural updates.*
- Flexa feature has been turned on
- Disclaimer added to integrations screen

### Fixed
- The Seed screen recovery phrase has been improved to properly display on small screens

## [1.2.2 (789)] - 2024-11-18

### Agregado
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ import kotlin.annotation.AnnotationRetention.SOURCE
annotation class PreviewScreens

@Preview(name = "1: Light preview", showBackground = true)
@Preview(name = "2: Light preview small", showBackground = true, device = Devices.NEXUS_5)
@Preview(
name = "2: Light preview small",
showBackground = true,
device = Devices.NEXUS_5,
fontScale = 1.5f
)
@Preview(name = "3: Dark preview", showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Preview(
name = "4: Dark preview small",
showBackground = true,
uiMode = Configuration.UI_MODE_NIGHT_YES,
device = Devices.NEXUS_5
device = Devices.NEXUS_5,
fontScale = 1.5f
)
@Retention(SOURCE)
annotation class PreviewScreenSizes
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowColumn
import androidx.compose.foundation.layout.FlowColumnOverflow
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -33,6 +34,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.blur
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalDensity
Expand Down Expand Up @@ -193,17 +195,26 @@ private fun SeedSecret(
Row(
modifier =
if (state.tooltip != null) {
Modifier.clickable {
scope.launch {
if (tooltipState.isVisible) {
tooltipState.dismiss()
} else {
tooltipState.show()
Modifier
.clip(RoundedCornerShape(ZashiDimensions.Radius.radiusMd))
.clickable {
scope.launch {
if (tooltipState.isVisible) {
tooltipState.dismiss()
} else {
tooltipState.show()
}
}
}
}
.padding(
horizontal = ZashiDimensions.Spacing.spacingXs,
vertical = ZashiDimensions.Spacing.spacingSm
)
} else {
Modifier
Modifier.padding(
horizontal = ZashiDimensions.Spacing.spacingXs,
vertical = ZashiDimensions.Spacing.spacingSm
)
}
) {
Text(
Expand Down Expand Up @@ -249,7 +260,6 @@ private fun SeedSecret(
}
}
}
Spacer(Modifier.height(ZashiDimensions.Spacing.spacingSm))

SecretContent(state = state)
}
Expand Down Expand Up @@ -279,7 +289,7 @@ private fun SecretContent(state: SeedSecretState) {
} then
Modifier
.blurCompat(blur.value, 14.dp)
.padding(horizontal = 24.dp, vertical = 18.dp)
.padding(vertical = 18.dp)
) {
if (state.mode == SeedSecretState.Mode.SEED) {
SecretSeedContent(state)
Expand Down Expand Up @@ -338,9 +348,15 @@ private fun Modifier.blurCompat(
}

@Composable
private fun SecretBirthdayContent(state: SeedSecretState) {
private fun SecretBirthdayContent(
state: SeedSecretState,
modifier: Modifier = Modifier
) {
Text(
modifier = Modifier.fillMaxWidth(),
modifier =
modifier
.fillMaxWidth()
.padding(horizontal = 24.dp),
textAlign = TextAlign.Start,
text = state.text.getValue(),
style = ZashiTypography.textMd,
Expand All @@ -358,14 +374,13 @@ private fun SecretSeedContent(state: SeedSecretState) {
.fillMaxWidth()
.padding(end = 8.dp),
maxItemsInEachColumn = 8,
horizontalArrangement = Arrangement.SpaceBetween,
horizontalArrangement = Arrangement.SpaceAround,
verticalArrangement = spacedBy(6.dp),
maxLines = 8
maxLines = 8,
overflow = FlowColumnOverflow.Visible,
) {
state.text.getValue().split(" ").fastForEachIndexed { i, s ->
Row(
modifier = Modifier
) {
Row {
Text(
modifier = Modifier.width(18.dp),
textAlign = TextAlign.End,
Expand Down Expand Up @@ -401,7 +416,10 @@ private fun RevealedPreview() =
seed =
SeedSecretState(
title = stringRes("Seed"),
text = stringRes((1..24).joinToString(" ") { "trala" }),
text =
stringRes(
(1..24).joinToString(" ") { "trala" } + "longer_tralala"
),
tooltip = null,
isRevealed = true,
mode = SeedSecretState.Mode.SEED,
Expand Down

0 comments on commit 224344d

Please sign in to comment.