Updated on 2026-08-14
This commit is contained in:
parent
b0f23e3660
commit
938d7baee1
14 changed files with 569 additions and 24 deletions
|
|
@ -0,0 +1,80 @@
|
|||
package com.tangem.core.ui.components
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.valentinilk.shimmer.shimmer
|
||||
|
||||
/**
|
||||
* Rectangle shimmer item with rounded shape from DS
|
||||
*/
|
||||
@Composable
|
||||
fun ShimmerRectangle(modifier: Modifier = Modifier) {
|
||||
Box(
|
||||
modifier = modifier
|
||||
.shimmer()
|
||||
.background(
|
||||
color = TangemTheme.colors.button.secondary,
|
||||
shape = RoundedCornerShape(TangemTheme.dimens.radius6),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Circle shimmer item
|
||||
* Size should be set in modifier
|
||||
*/
|
||||
@Composable
|
||||
fun CircleShimmer(modifier: Modifier = Modifier) {
|
||||
Box(modifier = modifier.shimmer()) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.matchParentSize()
|
||||
.background(
|
||||
color = TangemTheme.colors.button.secondary,
|
||||
shape = CircleShape,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// region preview
|
||||
|
||||
@Composable
|
||||
private fun ShimmersPreview() {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing18),
|
||||
) {
|
||||
ShimmerRectangle(
|
||||
modifier = Modifier.size(
|
||||
width = TangemTheme.dimens.size72,
|
||||
height = TangemTheme.dimens.size12,
|
||||
),
|
||||
)
|
||||
CircleShimmer(modifier = Modifier.size(size = TangemTheme.dimens.size42))
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun Shimmers_InLightTheme() {
|
||||
TangemTheme(isDark = false) {
|
||||
ShimmersPreview()
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun Shimmers_InDarkTheme() {
|
||||
TangemTheme(isDark = true) {
|
||||
ShimmersPreview()
|
||||
}
|
||||
}
|
||||
|
||||
// endregion preview
|
||||
|
|
@ -58,6 +58,7 @@ data class TangemDimens internal constructor(
|
|||
val size50: Dp = 50.dp,
|
||||
val size56: Dp = 56.dp,
|
||||
val size62: Dp = 62.dp,
|
||||
val size68: Dp = 68.dp,
|
||||
val size72: Dp = 72.dp,
|
||||
val size80: Dp = 80.dp,
|
||||
val size84: Dp = 84.dp,
|
||||
|
|
|
|||
10
core/ui/src/main/res/drawable/ic_drag_24.xml
Normal file
10
core/ui/src/main/res/drawable/ic_drag_24.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M19,8H5V10H19V8ZM19,14H5V16H19V14Z"
|
||||
android:fillColor="#B0B0B0"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
9
core/ui/src/main/res/drawable/img_arrow_down_8.xml
Normal file
9
core/ui/src/main/res/drawable/img_arrow_down_8.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="8dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="8">
|
||||
<path
|
||||
android:pathData="M4.6114,6.8903C4.8128,7.1793 5.2419,7.175 5.4375,6.8821L8.9151,1.6731C9.1369,1.3409 8.8988,0.8955 8.4993,0.8955L1.3921,0.8955C0.9881,0.8955 0.7509,1.3499 0.9819,1.6814L4.6114,6.8903Z"
|
||||
android:fillColor="#FF3333"/>
|
||||
</vector>
|
||||
9
core/ui/src/main/res/drawable/img_arrow_up_8.xml
Normal file
9
core/ui/src/main/res/drawable/img_arrow_up_8.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="8dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="8">
|
||||
<path
|
||||
android:pathData="M4.6114,1.1097C4.8128,0.8207 5.2419,0.825 5.4375,1.1179L8.9151,6.3269C9.1369,6.6591 8.8988,7.1045 8.4993,7.1045L1.3921,7.1045C0.9881,7.1045 0.7509,6.6501 0.9819,6.3186L4.6114,1.1097Z"
|
||||
android:fillColor="#1ACE80"/>
|
||||
</vector>
|
||||
19
core/ui/src/main/res/drawable/img_loader_15.xml
Normal file
19
core/ui/src/main/res/drawable/img_loader_15.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="15dp"
|
||||
android:height="4dp"
|
||||
android:viewportWidth="15"
|
||||
android:viewportHeight="4">
|
||||
<path
|
||||
android:pathData="M13.5,3.5C12.672,3.5 12,2.828 12,2C12,1.172 12.672,0.5 13.5,0.5C14.328,0.5 15,1.172 15,2C15,2.828 14.328,3.5 13.5,3.5Z"
|
||||
android:fillColor="#FFB71B"/>
|
||||
<path
|
||||
android:pathData="M7.5,3.5C6.672,3.5 6,2.828 6,2C6,1.172 6.672,0.5 7.5,0.5C8.328,0.5 9,1.172 9,2C9,2.828 8.328,3.5 7.5,3.5Z"
|
||||
android:strokeAlpha="0.55"
|
||||
android:fillColor="#FFB71B"
|
||||
android:fillAlpha="0.55"/>
|
||||
<path
|
||||
android:pathData="M1.5,3.5C0.672,3.5 0,2.828 0,2C0,1.172 0.672,0.5 1.5,0.5C2.328,0.5 3,1.172 3,2C3,2.828 2.328,3.5 1.5,3.5Z"
|
||||
android:strokeAlpha="0.25"
|
||||
android:fillColor="#FFB71B"
|
||||
android:fillAlpha="0.25"/>
|
||||
</vector>
|
||||
Loading…
Add table
Add a link
Reference in a new issue