fix(radar,settings): realtime doppler freq in Log tab, trash overlay fix, sub-menu swap (4.5.2 overwrite 5)

User-test fixes:
1. Log tab frequency now refreshes every second with the transponder
   panel (multi-Doppler): selectedRadio derived by uuid from the
   per-second transceivers list instead of a remembered stale
   reference; display and upload use radio.uplinkLow/downlinkLow
   (the same doppler-corrected values the transceiver panel shows).
2. SwipeDeleteRow: content layer now has an opaque background so the
   trash icon only appears while swiping (was bleeding through into
   the "Sent" column).
3. Settings page order: More-menu items can now move back into the
   main menu - button always visible; when the main menu is full (5),
   the last non-Settings item is automatically swapped into More.

Verified: check_strings OK (8 files); :app:compileDebugKotlin
BUILD SUCCESSFUL.
This commit is contained in:
mckero committed 2026-08-04 13:39:22 +00:00
1 parent 0bcf73e1f9
commit c09e87fa4e
2 files changed
+22 -12

No files matched your search

@@ -110,8 +110,9 @@ fun LogTab(
}
// 转发器选择(下拉选择框): 选中后底下出现输入区
// 选中项按 uuid 从 transceivers 实时派生(多普勒频率每秒更新, 频率显示随之刷新)
var menuExpanded by remember { mutableStateOf(false) }
var selectedRadio by remember { mutableStateOf<SatRadio?>(null) }
val selectedRadio = transceivers.firstOrNull { it.uuid == selectedUuid }
ExposedDropdownMenuBox(
expanded = menuExpanded,
onExpandedChange = { menuExpanded = it }
@@ -141,7 +142,7 @@ fun LogTab(
)
},
onClick = {
selectedRadio = radio
selectedUuid = radio.uuid
menuExpanded = false
}
)
@@ -234,8 +235,8 @@ private fun ExpandedLogInput(
fun submit() {
val call = callsign.trim().uppercase()
if (call.length < 3) return
// 频率直接取转发器栏的数字(不再多普勒再计算): TX = 当前调谐, RX = 下行基准
val tx = txBaseFrequencyHz ?: (radio.uplinkLow ?: radio.downlinkLow ?: 0L)
// 频率直接取转发器栏的数字(radio 每秒多普勒修正, 回车那一秒的值)
val tx = radio.uplinkLow ?: radio.downlinkLow ?: 0L
val rx = radio.downlinkLow ?: radio.uplinkLow ?: 0L
queue.add(
WavelogQso(
@@ -253,8 +254,8 @@ private fun ExpandedLogInput(
showToast(savedMsg)
}
// 频率显示与转发器栏完全一致: TX 行 + RX 行(线性附加频段范围)
val txForDisplay = txBaseFrequencyHz ?: (radio.uplinkLow ?: radio.downlinkLow ?: 0L)
// 频率显示与转发器栏完全一致: TX 行 + RX 行(radio 来自每秒多普勒重算, 实时刷新)
val txForDisplay = radio.uplinkLow ?: radio.downlinkLow ?: 0L
val rxForDisplay = radio.downlinkLow ?: radio.uplinkLow ?: 0L
val upLow = radio.uplinkLow
val upHigh = radio.uplinkHigh
@@ -412,9 +413,10 @@ internal fun SwipeDeleteRow(
)
}
}
// 内容层(跟手滑动)
// 内容层(跟手滑动): 不透明背景确保平时完全盖住垃圾桶, 仅左滑露出
Box(
modifier = Modifier
.background(MaterialTheme.colorScheme.surfaceContainer)
.offset { IntOffset(animatedOffset.roundToInt(), 0) }
.pointerInput(Unit) {
detectHorizontalDragGestures(
@@ -780,12 +780,20 @@ private fun UiSettingsCard(
items = subItems,
labels = screens,
moveLabel = stringResource(id = R.string.prefs_ui_move_back),
moveEnabled = { mainItems.size < 5 },
// 按钮常显; 主菜单满 5 时自动让位(最后一个非"设置"项移入更多, 交换)
moveEnabled = { true },
onMove = { name ->
onUpdateMenu(
(screenOrder.ifEmpty { defaultScreenOrder } + name).distinct(),
subItems.filter { it != name }
)
val mainWithoutSettings = mainItems.filter { it != "Settings" }
val needSwap = mainWithoutSettings.size >= 5
val evicted = if (needSwap) mainWithoutSettings.last() else null
val newMain = if (needSwap) {
(mainWithoutSettings.dropLast(1) + name).distinct()
} else {
(mainWithoutSettings + name).distinct()
}
val newSub = (subItems.filter { it != name } +
if (evicted != null) listOf(evicted) else emptyList()).distinct()
onUpdateMenu(newMain, newSub)
},
onReorder = { sub -> onUpdateMenu(screenOrder, sub) }
)