Skip to content

Commit

Permalink
fix ui artifact after deleting last item in page
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrlzy committed May 23, 2024
1 parent 9b56ab2 commit 067c490
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private fun RoomPairAlert.toCondition() = PairAlert(
enabled,
priceNotPercent,
triggered,
OffsetDateTime.parse(lastDateTriggered),
lastDateTriggered?.let { OffsetDateTime.parse(lastDateTriggered) },
group
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private fun EditCondition(
if (state.priceOrPercent.isRight() && !state.oneTimeNotRecurrent) {
Text(
modifier = Modifier.align(Alignment.CenterVertically),
text = "every",
text = "every ",
fontSize = 20.sp,
fontWeight = FontWeight.Medium,
color = ArkColor.TextPrimary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material3.Button
Expand Down Expand Up @@ -139,25 +141,27 @@ private fun GroupPage(
val total = amounts.fold(0.0) { acc, amount ->
acc + amount.baseAmount.amount
}
Column(
LazyColumn(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
modifier = Modifier.padding(top = 32.dp),
text = "Total Assets",
color = ArkColor.TextTertiary,
fontWeight = FontWeight.Medium
)
Text(
modifier = Modifier.padding(top = 8.dp),
text = "${CurrUtils.prepareToDisplay(total)} $baseCode",
color = ArkColor.TextPrimary,
fontWeight = FontWeight.SemiBold,
fontSize = 36.sp
)
AppHorDiv16(Modifier.padding(top = 32.dp))
amounts.forEach {
item {
Text(
modifier = Modifier.padding(top = 32.dp),
text = "Total Assets",
color = ArkColor.TextTertiary,
fontWeight = FontWeight.Medium
)
Text(
modifier = Modifier.padding(top = 8.dp),
text = "${CurrUtils.prepareToDisplay(total)} $baseCode",
color = ArkColor.TextPrimary,
fontWeight = FontWeight.SemiBold,
fontSize = 36.sp
)
AppHorDiv16(Modifier.padding(top = 32.dp))
}
items(amounts) {
AppSwipeToDismiss(
content = { CurrencyItem(it) },
onDelete = { onDelete(it.amount) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,16 @@ private fun GroupPage(
quickPairs: List<DisplayQuickPair>,
onDelete: (QuickPair) -> Unit
) {
Column(modifier = Modifier.fillMaxSize()) {
Text(
modifier = Modifier.padding(start = 16.dp, top = 24.dp),
text = "Pairs",
color = ArkColor.TextTertiary,
fontWeight = FontWeight.Medium
)
quickPairs.forEach {
LazyColumn(modifier = Modifier.fillMaxSize()) {
item {
Text(
modifier = Modifier.padding(start = 16.dp, top = 24.dp),
text = "Pairs",
color = ArkColor.TextTertiary,
fontWeight = FontWeight.Medium
)
}
items(quickPairs) {
AppHorDiv16()
AppSwipeToDismiss(
content = { QuickItem(it) },
Expand Down

0 comments on commit 067c490

Please sign in to comment.