Added keys for holdings and transaction groups
This commit is contained in:
parent
c6f4b6d250
commit
4531380bac
|
@ -13,8 +13,8 @@ import androidx.compose.ui.text.font.FontWeight
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import net.codinux.banking.client.model.Amount
|
||||
import net.codinux.banking.client.model.securitiesaccount.Holding
|
||||
import net.codinux.banking.persistence.entities.BankAccessEntity
|
||||
import net.codinux.banking.persistence.entities.HoldingEntity
|
||||
import net.codinux.banking.ui.config.Colors
|
||||
import net.codinux.banking.ui.config.DI
|
||||
import net.codinux.banking.ui.config.Style
|
||||
|
@ -31,7 +31,7 @@ private val formatUtil = DI.formatUtil
|
|||
fun GroupedTransactionsListItems(
|
||||
modifier: Modifier,
|
||||
transactionsToDisplay: List<AccountTransactionViewModel>,
|
||||
holdingsToDisplay: List<Holding>,
|
||||
holdingsToDisplay: List<HoldingEntity>,
|
||||
banksById: Map<Long, BankAccessEntity>,
|
||||
transactionsGrouping: TransactionsGrouping
|
||||
) {
|
||||
|
@ -65,9 +65,9 @@ fun GroupedTransactionsListItems(
|
|||
RoundedCornersCard {
|
||||
Column(Modifier.background(Color.White)) {
|
||||
holdingsToDisplay.forEachIndexed { index, holding ->
|
||||
// key(statementOfHoldings.id) {
|
||||
key(holding.id) {
|
||||
HoldingListItem(holding, index % 2 == 1, index < holdingsToDisplay.size - 1)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ fun GroupedTransactionsListItems(
|
|||
}
|
||||
|
||||
items(groupedByDate.keys.sortedDescending()) { groupingDate ->
|
||||
key(groupingDate.toEpochDays()) {
|
||||
Column(Modifier.fillMaxWidth()) {
|
||||
Text(
|
||||
text = DI.formatUtil.formatGroupingDate(groupingDate, transactionsGrouping),
|
||||
|
@ -124,3 +125,4 @@ fun GroupedTransactionsListItems(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -69,9 +69,9 @@ fun TransactionsList(uiState: UiState, uiSettings: UiSettings, isMobile: Boolean
|
|||
} else {
|
||||
LazyColumn(transactionsListModifier, contentPadding = PaddingValues(top = 8.dp, bottom = 16.dp)) {
|
||||
itemsIndexed(holdingsToDisplay) { index, holding ->
|
||||
// key(holding.isin) {
|
||||
key(holding.id) {
|
||||
HoldingListItem(holding, index % 2 == 1, index < holdingsToDisplay.size - 1)
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
itemsIndexed(transactionsToDisplay) { index, transaction ->
|
||||
|
|
Loading…
Reference in New Issue