Updated on 2026-08-14
This commit is contained in:
parent
a163569c86
commit
a253674fe6
13 changed files with 639 additions and 8 deletions
|
|
@ -13,11 +13,13 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.rotate
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.test.DeviceSettingsScreenTestTags
|
||||
import com.tangem.tap.features.details.ui.common.DetailsMainButton
|
||||
import com.tangem.tap.features.details.ui.common.SettingsScreensScaffold
|
||||
import com.tangem.wallet.R
|
||||
|
|
@ -49,7 +51,8 @@ private fun CardSettingsReadCard(onScanCardClick: () -> Unit) {
|
|||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(bottom = TangemTheme.dimens.spacing40),
|
||||
.padding(bottom = TangemTheme.dimens.spacing40)
|
||||
.testTag(DeviceSettingsScreenTestTags.IMAGE_BLOCK),
|
||||
) {
|
||||
Image(
|
||||
modifier = Modifier
|
||||
|
|
@ -116,7 +119,9 @@ private fun CardSettings(state: CardSettingsScreenState) {
|
|||
if (state.cardDetails == null) return
|
||||
|
||||
LazyColumn(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag(DeviceSettingsScreenTestTags.LAZY_LIST),
|
||||
) {
|
||||
items(state.cardDetails) {
|
||||
val paddingBottom = when (it) {
|
||||
|
|
@ -164,12 +169,14 @@ private fun CardSettings(state: CardSettingsScreenState) {
|
|||
text = it.titleRes.resolveReference(),
|
||||
color = titleColor,
|
||||
style = TangemTheme.typography.subtitle1,
|
||||
modifier = Modifier.testTag(DeviceSettingsScreenTestTags.ITEM_TITLE),
|
||||
)
|
||||
Spacer(modifier = Modifier.size(TangemTheme.dimens.size4))
|
||||
Text(
|
||||
text = it.subtitle.resolveReference(),
|
||||
color = subtitleColor,
|
||||
style = TangemTheme.typography.body2,
|
||||
modifier = Modifier.testTag(DeviceSettingsScreenTestTags.ITEM_SUBTITLE),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,12 +9,14 @@ import androidx.compose.material3.IconToggleButton
|
|||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.tangem.core.ui.components.*
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.test.ResetCardScreenTestTags
|
||||
import com.tangem.tap.features.details.ui.cardsettings.TextReference
|
||||
import com.tangem.tap.features.details.ui.cardsettings.resolveReference
|
||||
import com.tangem.tap.features.details.ui.common.DetailsMainButton
|
||||
|
|
@ -74,6 +76,7 @@ private fun Title() {
|
|||
text = stringResourceSafe(id = R.string.card_settings_reset_card_to_factory),
|
||||
style = TangemTheme.typography.h1,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
modifier = Modifier.testTag(ResetCardScreenTestTags.TITLE),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +85,9 @@ private fun AlertImage() {
|
|||
Image(
|
||||
painter = painterResource(id = R.drawable.img_alert_80),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(TangemTheme.dimens.size80),
|
||||
modifier = Modifier
|
||||
.size(TangemTheme.dimens.size80)
|
||||
.testTag(ResetCardScreenTestTags.ATTENTION_IMAGE),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -92,6 +97,7 @@ private fun Subtitle() {
|
|||
text = stringResourceSafe(id = R.string.common_attention),
|
||||
style = TangemTheme.typography.h3,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
modifier = Modifier.testTag(ResetCardScreenTestTags.SUBTITLE),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -101,6 +107,7 @@ private fun Description(text: TextReference) {
|
|||
text = text.resolveReference(),
|
||||
style = TangemTheme.typography.body1,
|
||||
color = TangemTheme.colors.text.secondary,
|
||||
modifier = Modifier.testTag(ResetCardScreenTestTags.DESCRIPTION),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +142,11 @@ private fun ConditionCheckBox(checkedState: Boolean, onCheckedChange: (Boolean)
|
|||
.padding(vertical = TangemTheme.dimens.size16),
|
||||
horizontalArrangement = Arrangement.spacedBy(space = TangemTheme.dimens.spacing16),
|
||||
) {
|
||||
IconToggleButton(checked = checkedState, onCheckedChange = onCheckedChange) {
|
||||
IconToggleButton(
|
||||
checked = checkedState,
|
||||
onCheckedChange = onCheckedChange,
|
||||
modifier = Modifier.testTag(ResetCardScreenTestTags.CHECKBOX),
|
||||
) {
|
||||
AnimatedContent(targetState = checkedState, label = "Update checked state") { checked ->
|
||||
Icon(
|
||||
painter = painterResource(
|
||||
|
|
@ -159,6 +170,7 @@ private fun ConditionCheckBox(checkedState: Boolean, onCheckedChange: (Boolean)
|
|||
text = description.resolveReference(),
|
||||
style = TangemTheme.typography.body2,
|
||||
color = TangemTheme.colors.text.secondary,
|
||||
modifier = Modifier.testTag(ResetCardScreenTestTags.CHECKBOX_TEXT),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue