Updated on 2026-08-14

This commit is contained in:
Tangem 2024-04-01 15:39:11 +05:00
parent db8b6484b3
commit 7d02f3e3a6
7 changed files with 32 additions and 16 deletions

View file

@ -125,6 +125,7 @@ data class TangemDimens internal constructor(
val spacing56: Dp = 56.dp,
val spacing60: Dp = 60.dp,
val spacing70: Dp = 70.dp,
val spacing72: Dp = 72.dp,
val spacing76: Dp = 76.dp,
val spacing80: Dp = 80.dp,
val spacing92: Dp = 92.dp,

View file

@ -31,13 +31,17 @@ import com.tangem.features.send.impl.presentation.state.SendUiState
import com.tangem.features.send.impl.presentation.state.SendUiStateType
@Composable
internal fun SendNavigationButtons(uiState: SendUiState, currentState: SendUiCurrentScreen) {
internal fun SendNavigationButtons(
uiState: SendUiState,
currentState: SendUiCurrentScreen,
modifier: Modifier = Modifier,
) {
val sendState = uiState.sendState ?: return
val isSuccess = sendState.isSuccess
val isSendingState = currentState.type == SendUiStateType.Send && !isSuccess
val isSentState = currentState.type == SendUiStateType.Send && isSuccess
Column(
modifier = Modifier
modifier = modifier
.padding(
start = TangemTheme.dimens.spacing16,
end = TangemTheme.dimens.spacing16,

View file

@ -74,13 +74,17 @@ internal fun SendScreen(uiState: SendUiState, currentStateFlow: StateFlow<SendUi
backgroundColor = TangemTheme.colors.background.tertiary,
modifier = Modifier.height(TangemTheme.dimens.size56),
)
SendScreenContent(
uiState = uiState,
currentState = currentState.value,
modifier = Modifier
.weight(1f),
)
SendNavigationButtons(uiState, currentState.value)
Box(modifier = Modifier.weight(1f)) {
SendScreenContent(
uiState = uiState,
currentState = currentState.value,
)
SendNavigationButtons(
uiState = uiState,
currentState = currentState.value,
modifier = Modifier.align(Alignment.BottomCenter),
)
}
}
SendEventEffect(

View file

@ -22,7 +22,7 @@ internal fun LazyListScope.notifications(
contentType = { _, item -> item::class.java },
itemContent = { i, item ->
val bottomPadding = if (i == notifications.lastIndex) {
TangemTheme.dimens.spacing12
TangemTheme.dimens.spacing72
} else {
TangemTheme.dimens.spacing0
}

View file

@ -20,6 +20,7 @@ import kotlinx.collections.immutable.ImmutableList
internal fun SendCustomFeeEthereum(
customValues: ImmutableList<SendTextField.CustomFee>,
selectedFee: FeeType,
hasNotifications: Boolean,
modifier: Modifier = Modifier,
) {
AnimatedVisibility(
@ -34,8 +35,8 @@ internal fun SendCustomFeeEthereum(
) {
repeat(customValues.size) { index ->
val value = customValues[index]
val bottomPadding = if (index == customValues.lastIndex) {
TangemTheme.dimens.spacing12
val bottomPadding = if (index == customValues.lastIndex && !hasNotifications) {
TangemTheme.dimens.spacing72
} else {
TangemTheme.dimens.spacing0
}

View file

@ -23,8 +23,9 @@ private const val FEE_CUSTOM_KEY = "FEE_CUSTOM_KEY"
internal fun SendSpeedAndFeeContent(state: SendStates.FeeState?, clickIntents: SendClickIntents) {
if (state == null) return
val feeSendState = state.feeSelectorState as? FeeSelectorState.Content
val isCustomSelected = feeSendState?.selectedFee == FeeType.Custom
val notifications = state.notifications
val isCustomSelected = feeSendState?.selectedFee == FeeType.Custom
val hasNotifications = notifications.isNotEmpty()
LazyColumn(
modifier = Modifier
.fillMaxSize()
@ -35,7 +36,7 @@ internal fun SendSpeedAndFeeContent(state: SendStates.FeeState?, clickIntents: S
) {
feeSelector(state, clickIntents)
if (feeSendState != null) {
customFee(feeSendState)
customFee(feeSendState = feeSendState, hasNotifications = hasNotifications)
}
notifications(notifications = notifications, hasPaddingAbove = isCustomSelected)
}
@ -55,13 +56,18 @@ private fun LazyListScope.feeSelector(state: SendStates.FeeState, clickIntents:
}
@OptIn(ExperimentalFoundationApi::class)
internal fun LazyListScope.customFee(feeSendState: FeeSelectorState.Content, modifier: Modifier = Modifier) {
internal fun LazyListScope.customFee(
feeSendState: FeeSelectorState.Content,
hasNotifications: Boolean,
modifier: Modifier = Modifier,
) {
item(
key = FEE_CUSTOM_KEY,
) {
SendCustomFeeEthereum(
customValues = feeSendState.customValues,
selectedFee = feeSendState.selectedFee,
hasNotifications = hasNotifications,
modifier = modifier
.fillMaxWidth()
.animateItemPlacement()

View file

@ -182,7 +182,7 @@ private fun LazyListScope.listItem(
.then(
if (isLast && index == list.lastIndex) {
Modifier
.padding(bottom = TangemTheme.dimens.spacing12)
.padding(bottom = TangemTheme.dimens.spacing72)
.clip(
shape = RoundedCornerShape(
bottomStart = TangemTheme.dimens.radius16,