Updated on 2026-08-14

This commit is contained in:
Tangem 2024-07-24 18:01:00 +03:00
parent 96c6123d8c
commit 258af22842
18 changed files with 180 additions and 99 deletions

View file

@ -4,6 +4,7 @@ import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@ -20,19 +21,23 @@ import kotlinx.collections.immutable.persistentListOf
@Composable
fun RoundedListWithDividers(rows: List<RoundedListWithDividersItemData>, modifier: Modifier = Modifier) {
LazyColumn(modifier = modifier) {
itemsIndexed(
items = rows,
key = { _, item -> item.id },
) { index, row ->
InitialInfoContentRow(
startText = row.startText.resolveReference(),
endText = row.endText.resolveReference(),
cornersToRound = getCornersToRound(index, rows.size),
iconClick = row.iconClick,
)
if (index < rows.lastIndex) {
RoundedListDivider()
}
this.roundedListItems(rows)
}
}
fun LazyListScope.roundedListItems(rows: List<RoundedListWithDividersItemData>) {
itemsIndexed(
items = rows,
key = { _, item -> item.id },
) { index, row ->
InitialInfoContentRow(
startText = row.startText.resolveReference(),
endText = row.endText.resolveReference(),
cornersToRound = getCornersToRound(index, rows.size),
iconClick = row.iconClick,
)
if (index < rows.lastIndex) {
RoundedListDivider()
}
}
}