Fix seed visibility (#1691)
* Fix seed view words visibility * Code cleanup * Add better clipping to ripple effect * Changelogs update --------- Co-authored-by: Honza <rychnovsky.honza@gmail.com>
This commit is contained in:
parent
3ea088e752
commit
224344d4e3
|
@ -10,6 +10,9 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2
|
||||||
- Flexa feature has been turned on
|
- Flexa feature has been turned on
|
||||||
- Disclaimer added to integrations screen
|
- 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
|
## [1.2.2 (789)] - 2024-11-18
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -13,6 +13,9 @@ directly impact users rather than highlighting other key architectural updates.*
|
||||||
- Flexa feature has been turned on
|
- Flexa feature has been turned on
|
||||||
- Disclaimer added to integrations screen
|
- 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
|
## [1.2.2 (789)] - 2024-11-18
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -13,6 +13,9 @@ directly impact users rather than highlighting other key architectural updates.*
|
||||||
- Flexa feature has been turned on
|
- Flexa feature has been turned on
|
||||||
- Disclaimer added to integrations screen
|
- 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
|
## [1.2.2 (789)] - 2024-11-18
|
||||||
|
|
||||||
### Agregado
|
### Agregado
|
||||||
|
|
|
@ -11,13 +11,19 @@ import kotlin.annotation.AnnotationRetention.SOURCE
|
||||||
annotation class PreviewScreens
|
annotation class PreviewScreens
|
||||||
|
|
||||||
@Preview(name = "1: Light preview", showBackground = true)
|
@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 = "3: Dark preview", showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||||
@Preview(
|
@Preview(
|
||||||
name = "4: Dark preview small",
|
name = "4: Dark preview small",
|
||||||
showBackground = true,
|
showBackground = true,
|
||||||
uiMode = Configuration.UI_MODE_NIGHT_YES,
|
uiMode = Configuration.UI_MODE_NIGHT_YES,
|
||||||
device = Devices.NEXUS_5
|
device = Devices.NEXUS_5,
|
||||||
|
fontScale = 1.5f
|
||||||
)
|
)
|
||||||
@Retention(SOURCE)
|
@Retention(SOURCE)
|
||||||
annotation class PreviewScreenSizes
|
annotation class PreviewScreenSizes
|
||||||
|
|
|
@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||||
import androidx.compose.foundation.layout.FlowColumn
|
import androidx.compose.foundation.layout.FlowColumn
|
||||||
|
import androidx.compose.foundation.layout.FlowColumnOverflow
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
@ -33,6 +34,7 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.alpha
|
import androidx.compose.ui.draw.alpha
|
||||||
import androidx.compose.ui.draw.blur
|
import androidx.compose.ui.draw.blur
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.ColorFilter
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
import androidx.compose.ui.platform.LocalConfiguration
|
import androidx.compose.ui.platform.LocalConfiguration
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
|
@ -193,17 +195,26 @@ private fun SeedSecret(
|
||||||
Row(
|
Row(
|
||||||
modifier =
|
modifier =
|
||||||
if (state.tooltip != null) {
|
if (state.tooltip != null) {
|
||||||
Modifier.clickable {
|
Modifier
|
||||||
scope.launch {
|
.clip(RoundedCornerShape(ZashiDimensions.Radius.radiusMd))
|
||||||
if (tooltipState.isVisible) {
|
.clickable {
|
||||||
tooltipState.dismiss()
|
scope.launch {
|
||||||
} else {
|
if (tooltipState.isVisible) {
|
||||||
tooltipState.show()
|
tooltipState.dismiss()
|
||||||
|
} else {
|
||||||
|
tooltipState.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
.padding(
|
||||||
|
horizontal = ZashiDimensions.Spacing.spacingXs,
|
||||||
|
vertical = ZashiDimensions.Spacing.spacingSm
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
Modifier
|
Modifier.padding(
|
||||||
|
horizontal = ZashiDimensions.Spacing.spacingXs,
|
||||||
|
vertical = ZashiDimensions.Spacing.spacingSm
|
||||||
|
)
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
|
@ -249,7 +260,6 @@ private fun SeedSecret(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Spacer(Modifier.height(ZashiDimensions.Spacing.spacingSm))
|
|
||||||
|
|
||||||
SecretContent(state = state)
|
SecretContent(state = state)
|
||||||
}
|
}
|
||||||
|
@ -279,7 +289,7 @@ private fun SecretContent(state: SeedSecretState) {
|
||||||
} then
|
} then
|
||||||
Modifier
|
Modifier
|
||||||
.blurCompat(blur.value, 14.dp)
|
.blurCompat(blur.value, 14.dp)
|
||||||
.padding(horizontal = 24.dp, vertical = 18.dp)
|
.padding(vertical = 18.dp)
|
||||||
) {
|
) {
|
||||||
if (state.mode == SeedSecretState.Mode.SEED) {
|
if (state.mode == SeedSecretState.Mode.SEED) {
|
||||||
SecretSeedContent(state)
|
SecretSeedContent(state)
|
||||||
|
@ -338,9 +348,15 @@ private fun Modifier.blurCompat(
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun SecretBirthdayContent(state: SeedSecretState) {
|
private fun SecretBirthdayContent(
|
||||||
|
state: SeedSecretState,
|
||||||
|
modifier: Modifier = Modifier
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier =
|
||||||
|
modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 24.dp),
|
||||||
textAlign = TextAlign.Start,
|
textAlign = TextAlign.Start,
|
||||||
text = state.text.getValue(),
|
text = state.text.getValue(),
|
||||||
style = ZashiTypography.textMd,
|
style = ZashiTypography.textMd,
|
||||||
|
@ -358,14 +374,13 @@ private fun SecretSeedContent(state: SeedSecretState) {
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(end = 8.dp),
|
.padding(end = 8.dp),
|
||||||
maxItemsInEachColumn = 8,
|
maxItemsInEachColumn = 8,
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceAround,
|
||||||
verticalArrangement = spacedBy(6.dp),
|
verticalArrangement = spacedBy(6.dp),
|
||||||
maxLines = 8
|
maxLines = 8,
|
||||||
|
overflow = FlowColumnOverflow.Visible,
|
||||||
) {
|
) {
|
||||||
state.text.getValue().split(" ").fastForEachIndexed { i, s ->
|
state.text.getValue().split(" ").fastForEachIndexed { i, s ->
|
||||||
Row(
|
Row {
|
||||||
modifier = Modifier
|
|
||||||
) {
|
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.width(18.dp),
|
modifier = Modifier.width(18.dp),
|
||||||
textAlign = TextAlign.End,
|
textAlign = TextAlign.End,
|
||||||
|
@ -401,7 +416,10 @@ private fun RevealedPreview() =
|
||||||
seed =
|
seed =
|
||||||
SeedSecretState(
|
SeedSecretState(
|
||||||
title = stringRes("Seed"),
|
title = stringRes("Seed"),
|
||||||
text = stringRes((1..24).joinToString(" ") { "trala" }),
|
text =
|
||||||
|
stringRes(
|
||||||
|
(1..24).joinToString(" ") { "trala" } + "longer_tralala"
|
||||||
|
),
|
||||||
tooltip = null,
|
tooltip = null,
|
||||||
isRevealed = true,
|
isRevealed = true,
|
||||||
mode = SeedSecretState.Mode.SEED,
|
mode = SeedSecretState.Mode.SEED,
|
||||||
|
|
Loading…
Reference in New Issue