Updated on 2026-08-14
This commit is contained in:
parent
11eb1bbbdc
commit
be5786260a
34 changed files with 873 additions and 48 deletions
|
|
@ -20,6 +20,7 @@ import androidx.compose.ui.draw.clip
|
|||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
|
|
@ -42,6 +43,7 @@ import com.tangem.core.ui.format.bigdecimal.percent
|
|||
import com.tangem.core.ui.res.TangemColorPalette
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.test.StakingDetailsScreenTestTags
|
||||
import com.tangem.domain.models.staking.BalanceType
|
||||
import com.tangem.domain.models.staking.RewardBlockType
|
||||
import com.tangem.features.staking.impl.R
|
||||
|
|
@ -171,7 +173,8 @@ private fun LazyListScope.activeStakingBlock(
|
|||
currentIndex = index + 1,
|
||||
lastIndex = state.yieldBalance.balances.lastIndex + 1,
|
||||
addDefaultPadding = false,
|
||||
),
|
||||
)
|
||||
.testTag(StakingDetailsScreenTestTags.ACTIVE_STAKING_BLOCK),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -189,7 +192,9 @@ private fun BannerBlock(onClick: () -> Unit) {
|
|||
),
|
||||
) {
|
||||
Image(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.testTag(StakingDetailsScreenTestTags.BANNER_IMAGE),
|
||||
contentScale = ContentScale.FillWidth,
|
||||
painter = painterResource(R.drawable.img_staking_banner),
|
||||
contentDescription = null,
|
||||
|
|
@ -197,7 +202,8 @@ private fun BannerBlock(onClick: () -> Unit) {
|
|||
Text(
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterStart)
|
||||
.padding(TangemTheme.dimens.spacing16),
|
||||
.padding(TangemTheme.dimens.spacing16)
|
||||
.testTag(StakingDetailsScreenTestTags.BANNER_TEXT),
|
||||
text = buildAnnotatedString {
|
||||
withStyle(SpanStyle(Brush.linearGradient(textGradientColors))) {
|
||||
append(stringResourceSafe(R.string.staking_details_banner_text))
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import androidx.compose.material3.SnackbarHostState
|
|||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import com.tangem.common.ui.amountScreen.AmountScreenContent
|
||||
import com.tangem.common.ui.bottomsheet.permission.GiveTxPermissionBottomSheet
|
||||
import com.tangem.common.ui.bottomsheet.permission.state.GiveTxPermissionBottomSheetConfig
|
||||
|
|
@ -20,6 +21,7 @@ import com.tangem.core.ui.components.appbar.AppBarWithBackButtonAndIcon
|
|||
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.test.StakingSendScreenTestTags
|
||||
import com.tangem.features.staking.impl.R
|
||||
import com.tangem.features.staking.impl.presentation.state.StakingStates
|
||||
import com.tangem.features.staking.impl.presentation.state.StakingStep
|
||||
|
|
@ -44,7 +46,8 @@ internal fun StakingScreen(uiState: StakingUiState) {
|
|||
.background(color = TangemTheme.colors.background.secondary)
|
||||
.fillMaxSize()
|
||||
.imePadding()
|
||||
.systemBarsPadding(),
|
||||
.systemBarsPadding()
|
||||
.testTag(StakingSendScreenTestTags.SCREEN_CONTAINER),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
StakingAppBar(
|
||||
|
|
|
|||
|
|
@ -2,11 +2,14 @@ package com.tangem.features.staking.impl.presentation.ui
|
|||
|
||||
import androidx.compose.foundation.text.ClickableText
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import com.tangem.core.ui.extensions.appendColored
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.test.StakingDetailsScreenTestTags
|
||||
import com.tangem.features.staking.impl.R
|
||||
|
||||
private const val TERMS_OF_USE_KEY = "termsOfUse"
|
||||
|
|
@ -58,5 +61,6 @@ internal fun StakingTosText(onTextClick: (String) -> Unit) {
|
|||
onTextClick(PRIVACY_POLICY_URL)
|
||||
}
|
||||
},
|
||||
modifier = Modifier.testTag(StakingDetailsScreenTestTags.TOS_TEXT),
|
||||
)
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
||||
|
|
@ -27,6 +28,7 @@ import com.tangem.core.ui.format.bigdecimal.fee
|
|||
import com.tangem.core.ui.format.bigdecimal.format
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.test.StakingSendDetailsScreenTestTags
|
||||
import com.tangem.domain.appcurrency.model.AppCurrency
|
||||
import com.tangem.features.staking.impl.presentation.state.FeeState
|
||||
import com.tangem.utils.StringsSigns.DASH_SIGN
|
||||
|
|
@ -39,7 +41,8 @@ internal fun StakingFeeBlock(feeState: FeeState) {
|
|||
.fillMaxWidth()
|
||||
.clip(TangemTheme.shapes.roundedCornersXMedium)
|
||||
.background(TangemTheme.colors.background.action)
|
||||
.padding(TangemTheme.dimens.spacing12),
|
||||
.padding(TangemTheme.dimens.spacing12)
|
||||
.testTag(StakingSendDetailsScreenTestTags.NETWORK_FEE_BLOCK),
|
||||
) {
|
||||
Text(
|
||||
text = stringResourceSafe(R.string.common_network_fee_title),
|
||||
|
|
|
|||
|
|
@ -10,11 +10,13 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import com.tangem.core.ui.components.inputrow.InputRowImageInfo
|
||||
import com.tangem.core.ui.extensions.*
|
||||
import com.tangem.core.ui.format.bigdecimal.format
|
||||
import com.tangem.core.ui.format.bigdecimal.percent
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.test.StakingSendDetailsScreenTestTags
|
||||
import com.tangem.features.staking.impl.R
|
||||
import com.tangem.features.staking.impl.presentation.state.StakingStates
|
||||
import com.tangem.features.staking.impl.presentation.ui.ValidatorImagePlaceholder
|
||||
|
|
@ -35,7 +37,8 @@ internal fun ValidatorBlock(validatorState: StakingStates.ValidatorState, isClic
|
|||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = ripple(),
|
||||
onClick = onClick,
|
||||
),
|
||||
)
|
||||
.testTag(StakingSendDetailsScreenTestTags.VALIDATOR_BLOCK),
|
||||
) {
|
||||
InputRowImageInfo(
|
||||
title = resourceReference(R.string.staking_validator),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue