Updated on 2026-08-14
This commit is contained in:
commit
3e5ab44b4c
35 changed files with 225 additions and 59 deletions
|
|
@ -2,9 +2,7 @@ package com.tangem.core.ui.components.bottomsheets.tokenreceive
|
|||
|
||||
import android.widget.Toast
|
||||
import androidx.compose.animation.animateColorAsState
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.*
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.LazyRow
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
|
|
@ -43,6 +41,7 @@ private fun TokenReceiveBottomSheetContent(content: TokenReceiveBottomSheetConfi
|
|||
var selectedAddress by remember { mutableStateOf(content.addresses.first()) }
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.verticalScroll(state = rememberScrollState())
|
||||
.padding(
|
||||
start = TangemTheme.dimens.spacing24,
|
||||
top = TangemTheme.dimens.spacing24,
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ private fun LazyListScope.contentItems(
|
|||
count = txHistoryItems.itemCount,
|
||||
key = txHistoryItems.itemKey { item ->
|
||||
when (item) {
|
||||
is TxHistoryState.TxHistoryItemState.GroupTitle -> item.title
|
||||
is TxHistoryState.TxHistoryItemState.GroupTitle -> item.itemKey
|
||||
is TxHistoryState.TxHistoryItemState.Title -> item.onExploreClick.hashCode()
|
||||
is TxHistoryState.TxHistoryItemState.Transaction -> item.state.txHash
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import androidx.compose.ui.text.style.TextAlign
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.tangem.core.ui.components.transactions.state.TxHistoryState.TxHistoryItemState
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* Transactions block group title
|
||||
|
|
@ -38,7 +39,9 @@ internal fun TxHistoryGroupTitle(config: TxHistoryItemState.GroupTitle, modifier
|
|||
@Composable
|
||||
private fun Preview_TransactionsBlockGroupTitle_Light() {
|
||||
TangemTheme(isDark = false) {
|
||||
TxHistoryGroupTitle(config = TxHistoryItemState.GroupTitle(title = "Today"))
|
||||
TxHistoryGroupTitle(
|
||||
config = TxHistoryItemState.GroupTitle(title = "Today", itemKey = UUID.randomUUID().toString()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -46,6 +49,8 @@ private fun Preview_TransactionsBlockGroupTitle_Light() {
|
|||
@Composable
|
||||
private fun Preview_TransactionsBlockGroupTitle_Dark() {
|
||||
TangemTheme(isDark = true) {
|
||||
TxHistoryGroupTitle(config = TxHistoryItemState.GroupTitle(title = "Today"))
|
||||
TxHistoryGroupTitle(
|
||||
config = TxHistoryItemState.GroupTitle(title = "Today", itemKey = UUID.randomUUID().toString()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -49,8 +49,12 @@ sealed interface TxHistoryState {
|
|||
* Group title item
|
||||
*
|
||||
* @property title title
|
||||
* @property itemKey key to use in compose
|
||||
*/
|
||||
data class GroupTitle(val title: String) : TxHistoryItemState
|
||||
data class GroupTitle(
|
||||
val title: String,
|
||||
val itemKey: String,
|
||||
) : TxHistoryItemState
|
||||
|
||||
/**
|
||||
* Transaction item
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ fun getActiveIconRes(blockchainId: String): Int {
|
|||
"aleph-zero", "aleph-zero/test" -> R.drawable.img_azero_22
|
||||
"octaspace", "octaspace/test" -> R.drawable.img_octaspace_22
|
||||
"chia", "chia/test" -> R.drawable.img_chia_22
|
||||
"NEAR", "NEAR/test" -> R.drawable.img_near_22
|
||||
"decimal", "decimal/testnet" -> R.drawable.img_decimal_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
|
|
@ -135,6 +136,7 @@ fun getGreyedOutIconRes(blockchainId: String): Int {
|
|||
"aleph-zero", "aleph-zero/test" -> R.drawable.ic_azero_22
|
||||
"octaspace", "octaspace/test" -> R.drawable.ic_octaspace_22
|
||||
"chia", "chia/test" -> R.drawable.ic_chia_22
|
||||
"NEAR", "NEAR/test" -> R.drawable.ic_near_22
|
||||
"decimal", "decimal/test" -> R.drawable.ic_decimal_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ private fun darkThemeColors(): TangemColors {
|
|||
attention = TangemColorPalette.Mustard,
|
||||
),
|
||||
button = TangemColors.Button(
|
||||
primary = TangemColorPalette.Light1,
|
||||
primary = TangemColorPalette.Light4,
|
||||
secondary = TangemColorPalette.Dark5,
|
||||
disabled = TangemColorPalette.Dark5,
|
||||
positiveDisabled = TangemColorPalette.DarkGreen,
|
||||
|
|
|
|||
9
core/ui/src/main/res/drawable/ic_near_22.xml
Normal file
9
core/ui/src/main/res/drawable/ic_near_22.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:pathData="M15.721,5C15.277,5 14.864,5.23 14.632,5.609L12.123,9.333C12.042,9.456 12.075,9.622 12.197,9.703C12.297,9.77 12.429,9.761 12.519,9.683L14.988,7.542C15.029,7.505 15.092,7.509 15.129,7.55C15.146,7.569 15.155,7.593 15.155,7.618V14.323C15.155,14.378 15.11,14.423 15.055,14.423C15.025,14.423 14.997,14.41 14.978,14.387L7.515,5.453C7.272,5.166 6.915,5 6.539,5H6.278C5.572,5 5,5.572 5,6.278V15.722C5,16.428 5.572,17 6.278,17C6.723,17 7.135,16.77 7.368,16.391L9.876,12.667C9.958,12.544 9.925,12.378 9.802,12.297C9.703,12.23 9.571,12.239 9.481,12.317L7.012,14.458C6.971,14.495 6.907,14.491 6.87,14.45C6.854,14.432 6.845,14.407 6.845,14.382V7.676C6.845,7.62 6.89,7.576 6.945,7.576C6.975,7.576 7.003,7.589 7.022,7.612L14.484,16.547C14.727,16.834 15.084,17 15.46,17H15.721C16.427,17 16.999,16.428 17,15.722V6.278C17,5.572 16.428,5 15.722,5H15.721Z"
|
||||
android:fillColor="#000000" />
|
||||
</vector>
|
||||
Loading…
Add table
Add a link
Reference in a new issue