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