Simplify currency row menu labels, add move to top/bottom

Move up/down/Remove no longer repeat the currency code in the menu item
text — the row's own field already shows it right next to the button.
Also adds Move to top / Move to bottom, enabled under the same conditions
as the existing up/down actions.

Switches from material-icons-core to material-icons-extended: the core set
is a bare ~50-icon subset with nothing suited to "move to top/bottom" (no
double-chevron or vertical-align icons), so KeyboardDoubleArrowUp/Down
needed the fuller set.

Compose-only: the native SwiftUI screen has no three-dot menu, it uses
native list reordering instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp
This commit is contained in:
2026-09-09 08:09:21 +03:00
co-authored by Claude Sonnet 5
parent 5587428ca7
commit 1a16f96739
4 changed files with 42 additions and 8 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle
compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "composeMultiplatform" } compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "composeMultiplatform" }
compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "composeMultiplatform" } compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "composeMultiplatform" }
compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "material3" } compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "material3" }
compose-materialIconsCore = { module = "org.jetbrains.compose.material:material-icons-core", version.ref = "composeMaterialIcons" } compose-materialIconsExtended = { module = "org.jetbrains.compose.material:material-icons-extended", version.ref = "composeMaterialIcons" }
compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "composeMultiplatform" } compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "composeMultiplatform" }
compose-uiToolingPreview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "composeMultiplatform" } compose-uiToolingPreview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "composeMultiplatform" }
moko-resources = { module = "dev.icerock.moko:resources", version.ref = "mokoResources" } moko-resources = { module = "dev.icerock.moko:resources", version.ref = "mokoResources" }
+1 -1
View File
@@ -71,7 +71,7 @@ kotlin {
implementation(libs.compose.runtime) implementation(libs.compose.runtime)
implementation(libs.compose.foundation) implementation(libs.compose.foundation)
implementation(libs.compose.material3) implementation(libs.compose.material3)
implementation(libs.compose.materialIconsCore) implementation(libs.compose.materialIconsExtended)
implementation(libs.compose.ui) implementation(libs.compose.ui)
implementation(libs.compose.uiToolingPreview) implementation(libs.compose.uiToolingPreview)
api(libs.moko.resources) api(libs.moko.resources)
@@ -23,6 +23,8 @@ import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.KeyboardArrowDown import androidx.compose.material.icons.filled.KeyboardArrowDown
import androidx.compose.material.icons.filled.KeyboardArrowUp import androidx.compose.material.icons.filled.KeyboardArrowUp
import androidx.compose.material.icons.filled.KeyboardDoubleArrowDown
import androidx.compose.material.icons.filled.KeyboardDoubleArrowUp
import androidx.compose.material.icons.filled.MoreVert import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.filled.Refresh import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material3.Card import androidx.compose.material3.Card
@@ -358,6 +360,16 @@ fun PriceScreen(
state.selectedFiatCurrencies.moved(index, index + 1), state.selectedFiatCurrencies.moved(index, index + 1),
) )
}, },
onMoveToTop = {
viewModel.onFiatCurrenciesReordered(
state.selectedFiatCurrencies.moved(index, 0),
)
},
onMoveToBottom = {
viewModel.onFiatCurrenciesReordered(
state.selectedFiatCurrencies.moved(index, state.selectedFiatCurrencies.lastIndex),
)
},
onRemove = { viewModel.onFiatCurrencyToggled(code) }, onRemove = { viewModel.onFiatCurrencyToggled(code) },
) )
} }
@@ -380,6 +392,8 @@ private fun CurrencyRowMenu(
canRemove: Boolean, canRemove: Boolean,
onMoveUp: () -> Unit, onMoveUp: () -> Unit,
onMoveDown: () -> Unit, onMoveDown: () -> Unit,
onMoveToTop: () -> Unit,
onMoveToBottom: () -> Unit,
onRemove: () -> Unit, onRemove: () -> Unit,
) { ) {
var expanded by remember { mutableStateOf(false) } var expanded by remember { mutableStateOf(false) }
@@ -392,7 +406,16 @@ private fun CurrencyRowMenu(
} }
DropdownMenu(expanded = expanded, onDismissRequest = { expanded = false }) { DropdownMenu(expanded = expanded, onDismissRequest = { expanded = false }) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(MR.strings.move_currency_up_content_description, code)) }, text = { Text(stringResource(MR.strings.move_currency_to_top_content_description)) },
leadingIcon = { Icon(Icons.Default.KeyboardDoubleArrowUp, contentDescription = null) },
enabled = canMoveUp,
onClick = {
expanded = false
onMoveToTop()
},
)
DropdownMenuItem(
text = { Text(stringResource(MR.strings.move_currency_up_content_description)) },
leadingIcon = { Icon(Icons.Default.KeyboardArrowUp, contentDescription = null) }, leadingIcon = { Icon(Icons.Default.KeyboardArrowUp, contentDescription = null) },
enabled = canMoveUp, enabled = canMoveUp,
onClick = { onClick = {
@@ -401,7 +424,7 @@ private fun CurrencyRowMenu(
}, },
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(MR.strings.move_currency_down_content_description, code)) }, text = { Text(stringResource(MR.strings.move_currency_down_content_description)) },
leadingIcon = { Icon(Icons.Default.KeyboardArrowDown, contentDescription = null) }, leadingIcon = { Icon(Icons.Default.KeyboardArrowDown, contentDescription = null) },
enabled = canMoveDown, enabled = canMoveDown,
onClick = { onClick = {
@@ -409,9 +432,18 @@ private fun CurrencyRowMenu(
onMoveDown() onMoveDown()
}, },
) )
DropdownMenuItem(
text = { Text(stringResource(MR.strings.move_currency_to_bottom_content_description)) },
leadingIcon = { Icon(Icons.Default.KeyboardDoubleArrowDown, contentDescription = null) },
enabled = canMoveDown,
onClick = {
expanded = false
onMoveToBottom()
},
)
if (canRemove) { if (canRemove) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(MR.strings.remove_currency_content_description, code)) }, text = { Text(stringResource(MR.strings.remove_currency_content_description)) },
leadingIcon = { Icon(Icons.Default.Close, contentDescription = null) }, leadingIcon = { Icon(Icons.Default.Close, contentDescription = null) },
onClick = { onClick = {
expanded = false expanded = false
@@ -12,12 +12,14 @@
<string name="currency_options_content_description">Options for %1$s</string> <string name="currency_options_content_description">Options for %1$s</string>
<string name="done">Done</string> <string name="done">Done</string>
<string name="exceeds_max_supply">Exceeds the %1$s maximum supply</string> <string name="exceeds_max_supply">Exceeds the %1$s maximum supply</string>
<string name="move_currency_down_content_description">Move %1$s down</string> <string name="move_currency_down_content_description">Move down</string>
<string name="move_currency_up_content_description">Move %1$s up</string> <string name="move_currency_to_bottom_content_description">Move to bottom</string>
<string name="move_currency_to_top_content_description">Move to top</string>
<string name="move_currency_up_content_description">Move up</string>
<string name="price_source">Price Source</string> <string name="price_source">Price Source</string>
<string name="rate_label">Rate</string> <string name="rate_label">Rate</string>
<string name="refresh_content_description">Refresh</string> <string name="refresh_content_description">Refresh</string>
<string name="remove_currency_content_description">Remove %1$s</string> <string name="remove_currency_content_description">Remove</string>
<string name="retry">Retry</string> <string name="retry">Retry</string>
<string name="sats_label">Sats</string> <string name="sats_label">Sats</string>
<string name="selected_currencies_section_title">Selected Currencies</string> <string name="selected_currencies_section_title">Selected Currencies</string>