Updated on 2026-08-14
This commit is contained in:
parent
42e2ed6309
commit
e817699522
17 changed files with 103 additions and 97 deletions
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#007AFF" android:pathData="M4.915,7.735C8.827,4.088 15.173,4.088 19.085,7.735L19.555,8.171C19.753,8.353 19.753,8.648 19.555,8.831L17.946,10.333C17.847,10.421 17.692,10.421 17.593,10.333L16.943,9.726C14.213,7.181 9.787,7.181 7.057,9.726L6.364,10.374C6.265,10.462 6.11,10.462 6.011,10.374L4.395,8.878C4.197,8.695 4.197,8.401 4.395,8.218L4.915,7.735ZM22.415,10.84L23.851,12.177C24.049,12.359 24.049,12.654 23.851,12.837L17.382,18.863C17.184,19.046 16.869,19.046 16.677,18.863L12.09,14.586C12.04,14.539 11.96,14.539 11.91,14.586L7.323,18.863C7.125,19.046 6.809,19.046 6.617,18.863L0.149,12.837C-0.05,12.654 -0.05,12.359 0.149,12.177L1.585,10.84C1.783,10.657 2.099,10.657 2.29,10.84L6.877,15.116C6.927,15.163 7.007,15.163 7.057,15.116L11.644,10.84C11.842,10.657 12.158,10.657 12.35,10.84L16.937,15.116C16.986,15.163 17.067,15.163 17.116,15.116L21.703,10.84C21.902,10.657 22.217,10.657 22.415,10.84Z"/>
|
||||
<path
|
||||
android:fillColor="@color/accent"
|
||||
android:pathData="M4.915,7.735C8.827,4.088 15.173,4.088 19.085,7.735L19.555,8.171C19.753,8.353 19.753,8.648 19.555,8.831L17.946,10.333C17.847,10.421 17.692,10.421 17.593,10.333L16.943,9.726C14.213,7.181 9.787,7.181 7.057,9.726L6.364,10.374C6.265,10.462 6.11,10.462 6.011,10.374L4.395,8.878C4.197,8.695 4.197,8.401 4.395,8.218L4.915,7.735ZM22.415,10.84L23.851,12.177C24.049,12.359 24.049,12.654 23.851,12.837L17.382,18.863C17.184,19.046 16.869,19.046 16.677,18.863L12.09,14.586C12.04,14.539 11.96,14.539 11.91,14.586L7.323,18.863C7.125,19.046 6.809,19.046 6.617,18.863L0.149,12.837C-0.05,12.654 -0.05,12.359 0.149,12.177L1.585,10.84C1.783,10.657 2.099,10.657 2.29,10.84L6.877,15.116C6.927,15.163 7.007,15.163 7.057,15.116L11.644,10.84C11.842,10.657 12.158,10.657 12.35,10.84L16.937,15.116C16.986,15.163 17.067,15.163 17.116,15.116L21.703,10.84C21.902,10.657 22.217,10.657 22.415,10.84Z" />
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
<vector android:autoMirrored="true" android:height="344dp"
|
||||
android:viewportHeight="344" android:viewportWidth="233"
|
||||
android:width="233dp" xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillAlpha="0.3" android:pathData="M49,-262L49,-262A184,184 0,0 1,233 -78L233,160A184,184 0,0 1,49 344L49,344A184,184 0,0 1,-135 160L-135,-78A184,184 0,0 1,49 -262z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient android:centerX="149.32" android:centerY="383.08"
|
||||
android:gradientRadius="337.25" android:type="radial">
|
||||
<item android:color="#FFFF9900" android:offset="0"/>
|
||||
<item android:color="#00FF9900" android:offset="1"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path android:fillAlpha="0.5" android:pathData="M49,-182L49,-182A150,150 0,0 1,199 -32L199,160A150,150 0,0 1,49 310L49,310A150,150 0,0 1,-101 160L-101,-32A150,150 0,0 1,49 -182z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient android:centerX="73" android:centerY="498"
|
||||
android:gradientRadius="371.06" android:type="radial">
|
||||
<item android:color="#FFDA1717" android:offset="0"/>
|
||||
<item android:color="#03DA1717" android:offset="1"/>
|
||||
<item android:color="#00FF0000" android:offset="1"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path android:fillColor="#DE1010" android:fillType="evenOdd" android:pathData="M72.88,249.79C72.88,253.27 70.53,255.96 66.66,255.96H31.34C27.47,255.96 25.12,253.27 25.12,249.79C25.12,248.71 25.39,247.62 26.01,246.6L43.69,215.79C44.85,213.71 46.9,212.67 49,212.67C51.1,212.67 53.12,213.71 54.31,215.79L71.99,246.6C72.56,247.6 72.88,248.71 72.88,249.79ZM49.02,240.74C47.84,240.74 47.18,240.06 47.15,238.85L46.86,226.45C46.84,225.24 47.72,224.38 49,224.38C50.23,224.38 51.19,225.27 51.16,226.48L50.82,238.85C50.8,240.08 50.14,240.74 49.02,240.74ZM49.02,248.37C47.66,248.37 46.47,247.28 46.47,245.93C46.47,244.57 47.63,243.47 49.02,243.47C50.39,243.47 51.55,244.54 51.55,245.93C51.55,247.3 50.37,248.37 49.02,248.37Z"/>
|
||||
</vector>
|
||||
19
app/src/main/res/drawable/img_alert.xml
Normal file
19
app/src/main/res/drawable/img_alert.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="80dp"
|
||||
android:height="80dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportWidth="80"
|
||||
android:viewportHeight="80">
|
||||
<group>
|
||||
<clip-path android:pathData="M0,0h80v80h-80z" />
|
||||
<path
|
||||
android:fillAlpha="0.12"
|
||||
android:fillColor="@color/icon_warning"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M40,80C62.091,80 80,62.091 80,40C80,17.909 62.091,0 40,0C17.909,0 0,17.909 0,40C0,62.091 17.909,80 40,80ZM40,70C56.569,70 70,56.569 70,40C70,23.431 56.569,10 40,10C23.431,10 10,23.431 10,40C10,56.569 23.431,70 40,70Z"
|
||||
android:strokeAlpha="0.12" />
|
||||
<path
|
||||
android:fillColor="@color/icon_warning"
|
||||
android:pathData="M36.667,50H43.333V56.667H36.667V50ZM36.667,23.333H43.333V43.333H36.667V23.333ZM40,6.667C21.567,6.667 6.667,21.667 6.667,40C6.667,48.84 10.179,57.319 16.43,63.57C19.525,66.665 23.2,69.121 27.244,70.796C31.288,72.471 35.623,73.333 40,73.333C48.841,73.333 57.319,69.821 63.57,63.57C69.822,57.319 73.333,48.84 73.333,40C73.333,35.623 72.471,31.288 70.796,27.244C69.121,23.2 66.666,19.525 63.57,16.43C60.475,13.334 56.8,10.879 52.756,9.204C48.712,7.529 44.377,6.667 40,6.667ZM40,66.667C32.928,66.667 26.145,63.857 21.144,58.856C16.143,53.855 13.333,47.072 13.333,40C13.333,32.928 16.143,26.145 21.144,21.144C26.145,16.143 32.928,13.333 40,13.333C47.072,13.333 53.855,16.143 58.856,21.144C63.857,26.145 66.667,32.928 66.667,40C66.667,47.072 63.857,53.855 58.856,58.856C53.855,63.857 47.072,66.667 40,66.667Z" />
|
||||
</group>
|
||||
</vector>
|
||||
|
|
@ -21,6 +21,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:navigationIcon="@drawable/ic_baseline_arrow_back_24"
|
||||
app:navigationIconTint="@color/icon_primary_1"
|
||||
app:titleTextColor="@color/text_primary_1"
|
||||
app:title="@string/disclaimer_title" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
|
@ -29,7 +31,7 @@
|
|||
android:id="@+id/cl_details_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_secondary"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<WebView
|
||||
|
|
|
|||
|
|
@ -79,6 +79,5 @@
|
|||
<color name="text_tertiary">#919191</color>
|
||||
|
||||
<color name="background_splash">#000000</color>
|
||||
|
||||
|
||||
<color name="transparent">#00000000</color>
|
||||
</resources>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<resources>
|
||||
|
||||
<style name="BaseAppTheme" parent="Theme.MaterialComponents.Light.NoActionBar" />
|
||||
<style name="BaseAppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar" />
|
||||
|
||||
<style name="AppTheme" parent="BaseAppTheme">
|
||||
<item name="colorPrimary">@color/menu_accent_color</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue