mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-04 03:37:21 +00:00
feat(settings): drag-to-reorder page order in UI Settings card
Users can now change the bottom navigation order (previously fixed): - New "Page order" section under the Settings toggle in the UI Settings card: vertical list of all 7 pages, each with a drag handle (new ic_drag drawable, Material drag_indicator glyph) on the right. - Drag a handle up/down: the item follows the finger with live swap + animateItem() placement animation; on release the order is persisted (OtherSettings.screenOrder, comma-separated in prefs so order survives; StringSet would not). - "Reset order" button restores the default order (Satellites/Passes/Radar/Mutual/Roaming/Map/Settings). - MainScreen now sorts navItems by screenOrder (empty = default, stable sort keeps the canonical order); hiddenScreens filtering unchanged; Settings entry always visible. - New strings prefs_ui_order_title / prefs_ui_order_reset in en/zh/tr; What's-new updated in all three locales. Version stays 4.4.9 (覆盖 per user). Verified: core:data tests pass, settings + app compile.
This commit is contained in:
1 parent
c496d90d5a
commit
0ea9c0ede1
11 files changed
+150
-4
No files matched your search
@@ -135,8 +135,12 @@ fun MainScreen(navigateToRadar: () -> Unit = {}) {
|
||||
val container = (context.applicationContext as IContainerProvider).getMainContainer()
|
||||
val trackingState by container.radioTrackingService.state.collectAsStateWithLifecycle()
|
||||
val otherSettings by container.settingsRepo.otherSettings.collectAsStateWithLifecycle()
|
||||
// UI 设置: 按 hiddenScreens 过滤导航项(顺序固定, 关闭项自动靠拢; 设置页固定保留)
|
||||
// UI 设置: 按 screenOrder 排序(空 = 默认顺序), 再按 hiddenScreens 过滤(设置页固定保留)
|
||||
val navItems = listOf(Screen.Satellites, Screen.Passes, Screen.Radar, Screen.Mutual, Screen.Roaming, Screen.Map, Screen.Settings)
|
||||
.sortedBy { screen ->
|
||||
val idx = otherSettings.screenOrder.indexOf(screen.screenId)
|
||||
if (idx == -1) Int.MAX_VALUE else idx
|
||||
}
|
||||
.filter { it.screenId !in otherSettings.hiddenScreens || it is Screen.Settings }
|
||||
// Activity-scoped so the mutual query results survive navigation to Radar and back
|
||||
val mutualViewModel: MutualViewModel = viewModel(
|
||||
|
||||
Reference in new issue
Block a user