Updated on 2026-08-14
This commit is contained in:
parent
86b8b16dbf
commit
3aaa150cd3
6 changed files with 23 additions and 30 deletions
|
|
@ -16,6 +16,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
|||
import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
||||
import androidx.compose.ui.res.vectorResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
|
@ -30,6 +31,7 @@ import com.tangem.core.ui.res.TangemThemePreview
|
|||
* @param shape icon button shape
|
||||
* @param background background color
|
||||
* @param iconTint icon color
|
||||
* @param innerPadding icon padding inside background area
|
||||
*
|
||||
* [Show in Figma](https://www.figma.com/design/14ISV23YB1yVW1uNVwqrKv/Android?node-id=4105-1439&t=nnYBX1qCZmUNhBDf-4)
|
||||
*/
|
||||
|
|
@ -41,6 +43,7 @@ fun TangemIconButton(
|
|||
shape: RoundedCornerShape = RoundedCornerShape(24.dp),
|
||||
background: Color = TangemTheme.colors.button.secondary,
|
||||
iconTint: Color = TangemTheme.colors.icon.secondary,
|
||||
innerPadding: Dp = 4.dp,
|
||||
) {
|
||||
Icon(
|
||||
painter = rememberVectorPainter(ImageVector.vectorResource(iconRes)),
|
||||
|
|
@ -50,7 +53,7 @@ fun TangemIconButton(
|
|||
.size(24.dp)
|
||||
.clip(shape)
|
||||
.background(background)
|
||||
.padding(4.dp)
|
||||
.padding(innerPadding)
|
||||
.clickable(
|
||||
onClick = onClick,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import androidx.compose.runtime.Stable
|
|||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.decompose.model.Model
|
||||
import com.tangem.core.decompose.model.ParamsContainer
|
||||
import com.tangem.core.ui.extensions.iconResId
|
||||
import com.tangem.features.tokenreceive.component.TokenReceiveWarningComponent
|
||||
import com.tangem.features.tokenreceive.ui.state.WarningUM
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
|
|
@ -27,7 +26,6 @@ internal class TokenReceiveWarningModel @Inject constructor(
|
|||
iconState = params.iconState,
|
||||
onWarningAcknowledged = params.callback::onWarningAcknowledged,
|
||||
network = params.network.name,
|
||||
networkIcon = params.network.iconResId,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
@ -230,6 +230,7 @@ private fun AddressItem(
|
|||
|
||||
TangemIconButton(
|
||||
modifier = Modifier.size(TangemTheme.dimens.size28),
|
||||
innerPadding = 6.dp,
|
||||
iconRes = R.drawable.ic_qrcode_new_24,
|
||||
onClick = onOpenQrCodeClick,
|
||||
)
|
||||
|
|
@ -239,6 +240,7 @@ private fun AddressItem(
|
|||
TangemIconButton(
|
||||
modifier = Modifier.size(TangemTheme.dimens.size28),
|
||||
iconRes = R.drawable.ic_copy_new_24,
|
||||
innerPadding = 6.dp,
|
||||
onClick = onCopyClick,
|
||||
)
|
||||
}
|
||||
|
|
@ -276,8 +278,9 @@ private fun EnsItem(onCopyClick: () -> Unit, address: String, modifier: Modifier
|
|||
)
|
||||
|
||||
TangemIconButton(
|
||||
modifier = Modifier.size(28.dp),
|
||||
modifier = Modifier.size(TangemTheme.dimens.size28),
|
||||
iconRes = R.drawable.ic_copy_new_24,
|
||||
innerPadding = 6.dp,
|
||||
onClick = onCopyClick,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.features.tokenreceive.ui
|
||||
|
||||
import androidx.compose.animation.animateContentSize
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
|
@ -83,7 +84,7 @@ internal fun TokenReceiveContent(
|
|||
) {
|
||||
Children(
|
||||
stack = stackState,
|
||||
animation = stackAnimation(fade()),
|
||||
animation = stackAnimation(fade(animationSpec = tween(durationMillis = 100))),
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
.animateContentSize(),
|
||||
|
|
|
|||
|
|
@ -3,15 +3,12 @@ package com.tangem.features.tokenreceive.ui
|
|||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
|
|
@ -47,15 +44,17 @@ internal fun TokenReceiveWarningContent(warningUM: WarningUM) {
|
|||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
CurrencyIcon(
|
||||
modifier = Modifier.size(size = 56.dp),
|
||||
modifier = Modifier
|
||||
.padding(8.dp)
|
||||
.size(size = 64.dp),
|
||||
state = warningUM.iconState,
|
||||
shouldDisplayNetwork = false,
|
||||
shouldDisplayNetwork = true,
|
||||
iconSize = 56.dp,
|
||||
)
|
||||
|
||||
SpacerH24()
|
||||
|
||||
WarningBlock(networkIcon = warningUM.networkIcon, networkName = warningUM.network)
|
||||
WarningBlock(networkName = warningUM.network)
|
||||
|
||||
SpacerH12()
|
||||
|
||||
|
|
@ -80,7 +79,7 @@ internal fun TokenReceiveWarningContent(warningUM: WarningUM) {
|
|||
}
|
||||
|
||||
@Composable
|
||||
fun WarningBlock(networkName: String, networkIcon: Int, modifier: Modifier = Modifier) {
|
||||
fun WarningBlock(networkName: String, modifier: Modifier = Modifier) {
|
||||
Column(
|
||||
modifier = modifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
|
|
@ -92,23 +91,14 @@ fun WarningBlock(networkName: String, networkIcon: Int, modifier: Modifier = Mod
|
|||
color = TangemTheme.colors.text.primary1,
|
||||
)
|
||||
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(
|
||||
modifier = Modifier.size(20.dp),
|
||||
painter = painterResource(id = networkIcon),
|
||||
tint = Color.Unspecified,
|
||||
contentDescription = null,
|
||||
)
|
||||
SpacerW6()
|
||||
|
||||
SpacerW6()
|
||||
|
||||
Text(
|
||||
textAlign = TextAlign.Center,
|
||||
text = stringResourceSafe(R.string.domain_receive_assets_onboarding_network_name, networkName),
|
||||
style = TangemTheme.typography.h3,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
)
|
||||
}
|
||||
Text(
|
||||
textAlign = TextAlign.Center,
|
||||
text = stringResourceSafe(R.string.domain_receive_assets_onboarding_network_name, networkName),
|
||||
style = TangemTheme.typography.h3,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +129,6 @@ private class TokenReceiveWarningContentProvider : PreviewParameterProvider<Warn
|
|||
iconState = iconState,
|
||||
onWarningAcknowledged = {},
|
||||
network = "Etherium",
|
||||
networkIcon = R.drawable.ic_eth_16,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
@ -4,7 +4,6 @@ import com.tangem.core.ui.components.currency.icon.CurrencyIconState
|
|||
|
||||
internal data class WarningUM(
|
||||
val network: String,
|
||||
val networkIcon: Int,
|
||||
val iconState: CurrencyIconState,
|
||||
val onWarningAcknowledged: () -> Unit,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue