Updated on 2026-08-14
This commit is contained in:
parent
c55274f40f
commit
efcb0dea79
20 changed files with 477 additions and 17 deletions
|
|
@ -0,0 +1,77 @@
|
|||
package com.tangem.core.ui.components.items
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.CircleShimmer
|
||||
import com.tangem.core.ui.components.TextShimmer
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
|
||||
@Composable
|
||||
fun NetworkNameAndSymbolItem(icon: Int, name: String, symbol: String, modifier: Modifier = Modifier) {
|
||||
Row(
|
||||
modifier = modifier.padding(14.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Image(
|
||||
modifier = Modifier
|
||||
.padding(end = 8.dp)
|
||||
.size(24.dp),
|
||||
painter = painterResource(icon),
|
||||
contentDescription = null,
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.weight(1f, fill = false),
|
||||
text = name,
|
||||
style = TangemTheme.typography.subtitle2,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
Text(text = symbol, style = TangemTheme.typography.caption1, color = TangemTheme.colors.text.tertiary)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun NetworkNameAndSymbolItemShimmer(modifier: Modifier = Modifier) {
|
||||
Row(
|
||||
modifier = modifier.padding(12.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
CircleShimmer(
|
||||
modifier = Modifier
|
||||
.padding(end = 8.dp)
|
||||
.size(24.dp),
|
||||
)
|
||||
TextShimmer(
|
||||
style = TangemTheme.typography.subtitle2,
|
||||
modifier = Modifier.width(70.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun ContentPreview() {
|
||||
TangemThemePreview {
|
||||
Column {
|
||||
NetworkNameAndSymbolItemShimmer()
|
||||
NetworkNameAndSymbolItem(
|
||||
icon = R.drawable.ic_solana_16,
|
||||
name = "Solana",
|
||||
symbol = "SOL",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
31
core/ui/src/main/res/drawable/ic_notification_48.xml
Normal file
31
core/ui/src/main/res/drawable/ic_notification_48.xml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
<path
|
||||
android:pathData="M25,6H23C14.043,6 9.565,6 6.782,8.782C4,11.565 4,16.043 4,25C4,33.957 4,38.435 6.782,41.217C9.565,44 14.043,44 23,44C31.957,44 36.435,44 39.217,41.217C42,38.435 42,33.957 42,25V23"
|
||||
android:strokeWidth="3"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#0099FF"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M44,11C44,14.866 40.866,18 37,18C33.134,18 30,14.866 30,11C30,7.134 33.134,4 37,4C40.866,4 44,7.134 44,11Z"
|
||||
android:strokeWidth="3"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#0099FF"/>
|
||||
<path
|
||||
android:pathData="M14,22H22"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="3"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#0099FF"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M14,32H30"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="3"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#0099FF"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
Loading…
Add table
Add a link
Reference in a new issue