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:
@@ -23,6 +23,8 @@ import androidx.compose.material.icons.filled.Check
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.KeyboardArrowDown
|
||||
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.Refresh
|
||||
import androidx.compose.material3.Card
|
||||
@@ -358,6 +360,16 @@ fun PriceScreen(
|
||||
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) },
|
||||
)
|
||||
}
|
||||
@@ -380,6 +392,8 @@ private fun CurrencyRowMenu(
|
||||
canRemove: Boolean,
|
||||
onMoveUp: () -> Unit,
|
||||
onMoveDown: () -> Unit,
|
||||
onMoveToTop: () -> Unit,
|
||||
onMoveToBottom: () -> Unit,
|
||||
onRemove: () -> Unit,
|
||||
) {
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
@@ -392,7 +406,16 @@ private fun CurrencyRowMenu(
|
||||
}
|
||||
DropdownMenu(expanded = expanded, onDismissRequest = { expanded = false }) {
|
||||
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) },
|
||||
enabled = canMoveUp,
|
||||
onClick = {
|
||||
@@ -401,7 +424,7 @@ private fun CurrencyRowMenu(
|
||||
},
|
||||
)
|
||||
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) },
|
||||
enabled = canMoveDown,
|
||||
onClick = {
|
||||
@@ -409,9 +432,18 @@ private fun CurrencyRowMenu(
|
||||
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) {
|
||||
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) },
|
||||
onClick = {
|
||||
expanded = false
|
||||
|
||||
@@ -12,12 +12,14 @@
|
||||
<string name="currency_options_content_description">Options for %1$s</string>
|
||||
<string name="done">Done</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_up_content_description">Move %1$s up</string>
|
||||
<string name="move_currency_down_content_description">Move down</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="rate_label">Rate</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="sats_label">Sats</string>
|
||||
<string name="selected_currencies_section_title">Selected Currencies</string>
|
||||
|
||||
Reference in New Issue
Block a user