Updated on 2026-08-14

This commit is contained in:
Tangem 2023-09-11 16:57:06 +04:00
parent 42e2ed6309
commit e817699522
17 changed files with 103 additions and 97 deletions

View file

@ -9,7 +9,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
@ -134,8 +133,8 @@ internal fun DetailsRadioButtonElement(title: String, subtitle: String, selected
onClick = null,
modifier = Modifier.padding(end = 20.dp),
colors = RadioButtonDefaults.colors(
unselectedColor = colorResource(id = R.color.icon_secondary),
selectedColor = colorResource(id = R.color.icon_accent),
unselectedColor = TangemTheme.colors.icon.secondary,
selectedColor = TangemTheme.colors.icon.accent,
),
)
@ -143,13 +142,13 @@ internal fun DetailsRadioButtonElement(title: String, subtitle: String, selected
Text(
text = title,
style = TangemTheme.typography.subtitle1,
color = colorResource(id = R.color.text_primary_1),
color = TangemTheme.colors.text.primary1,
)
Spacer(modifier = Modifier.size(4.dp))
Text(
text = subtitle,
style = TangemTheme.typography.body2,
color = colorResource(id = R.color.text_secondary),
color = TangemTheme.colors.text.secondary,
)
}
}

View file

@ -1,22 +1,12 @@
package com.tangem.tap.features.details.ui.common
import androidx.compose.animation.animateColor
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.animateDp
import androidx.compose.animation.core.tween
import androidx.compose.animation.core.updateTransition
import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.indication
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.runtime.Composable
@ -25,17 +15,16 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.tangem.wallet.R
import com.tangem.core.ui.res.TangemTheme
@Suppress("MagicNumber")
@Composable
fun TangemSwitch(
onCheckedChange: (Boolean) -> Unit,
checkedColor: Color = colorResource(id = R.color.control_checked),
uncheckedColor: Color = colorResource(id = R.color.icon_informative),
checkedColor: Color = TangemTheme.colors.icon.accent,
uncheckedColor: Color = TangemTheme.colors.icon.informative,
size: Dp = 48.dp,
checked: Boolean = false,
enabled: Boolean = true,

View file

@ -1,12 +1,17 @@
package com.tangem.tap.features.details.ui.resetcard
import androidx.compose.foundation.*
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Icon
import androidx.compose.material.IconToggleButton
import androidx.compose.material.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.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
@ -37,15 +42,19 @@ private fun ResetCardView(state: ResetCardScreenState) {
.verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.SpaceBetween,
) {
Box {
Image(
painter = painterResource(id = R.drawable.ill_reset_background),
contentDescription = null,
modifier = Modifier.offset(y = (-82).dp),
ScreenTitle(titleRes = R.string.card_settings_reset_card_to_factory)
Box(
modifier = Modifier
.weight(1f)
.padding(horizontal = 21.dp),
contentAlignment = Alignment.CenterStart,
) {
Icon(
painter = painterResource(id = R.drawable.img_alert),
contentDescription = "",
tint = Color.Unspecified,
)
ScreenTitle(titleRes = R.string.card_settings_reset_card_to_factory)
}
Spacer(modifier = Modifier.weight(1f))
Column(
modifier = Modifier.offset(y = (-32).dp),
verticalArrangement = Arrangement.Bottom,

View file

@ -12,7 +12,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
@ -61,8 +60,8 @@ internal fun WalletConnectScreen(
private fun AddSessionFab(onAddSession: () -> Unit, modifier: Modifier = Modifier) {
FloatingActionButton(
onClick = onAddSession,
backgroundColor = colorResource(id = R.color.button_primary),
contentColor = colorResource(id = R.color.icon_primary_2),
backgroundColor = TangemTheme.colors.button.primary,
contentColor = TangemTheme.colors.icon.primary2,
shape = RoundedCornerShape(16.dp),
modifier = modifier,
) {
@ -78,7 +77,7 @@ private fun EmptyScreen(state: WalletConnectScreenState) {
if (state.isLoading) {
LinearProgressIndicator(
modifier = Modifier.fillMaxWidth(),
color = colorResource(id = R.color.icon_accent),
color = TangemTheme.colors.icon.accent,
)
}
Column(
@ -91,7 +90,7 @@ private fun EmptyScreen(state: WalletConnectScreenState) {
Image(
painter = painterResource(id = R.drawable.ic_walletconnect),
contentDescription = "",
colorFilter = ColorFilter.tint(colorResource(id = R.color.icon_inactive)),
colorFilter = ColorFilter.tint(TangemTheme.colors.icon.inactive),
contentScale = ContentScale.FillWidth,
modifier = Modifier.width(width = 100.dp),
)
@ -99,7 +98,7 @@ private fun EmptyScreen(state: WalletConnectScreenState) {
Text(
text = stringResource(id = R.string.wallet_connect_subtitle),
style = TangemTheme.typography.body2,
color = colorResource(id = R.color.text_tertiary),
color = TangemTheme.colors.text.tertiary,
)
}
}
@ -111,7 +110,7 @@ private fun WalletConnectSessions(state: WalletConnectScreenState) {
modifier = Modifier
.fillMaxWidth()
.height(2.dp),
color = colorResource(id = R.color.icon_accent),
color = TangemTheme.colors.icon.accent,
)
} else {
Spacer(modifier = Modifier.height(2.dp))
@ -132,7 +131,7 @@ private fun WalletConnectSessions(state: WalletConnectScreenState) {
Text(
text = session.description,
style = TangemTheme.typography.subtitle1,
color = colorResource(id = R.color.text_primary_1),
color = TangemTheme.colors.text.primary1,
modifier = Modifier.weight(1f),
)
IconButton(
@ -144,7 +143,7 @@ private fun WalletConnectSessions(state: WalletConnectScreenState) {
Icon(
painter = painterResource(id = R.drawable.ic_cross_rounded_24),
contentDescription = "",
tint = colorResource(id = R.color.icon_warning),
tint = TangemTheme.colors.icon.warning,
)
}
}

View file

@ -122,6 +122,7 @@ class DisclaimerFragment : BaseFragment(R.layout.fragment_disclaimer), StoreSubs
webView.loadLocalTermsOfServices()
}
else -> {
webView.setBackgroundColor(resources.getColor(R.color.transparent, null))
webView.loadUrl(disclaimer.getUri().toString())
}
}