Compare commits

..
Author SHA1 Message Date
atsunatsu cc684b6e3a fix(map): own-grid outline in grid-line color (bold only); passes top bar aligned to upstream; v10.1
- Bold outline now uses the same yellow as the regular grid lines
  (argb(160,255,224,130)) at 6f stroke — no color change, just thicker.
- Passes top bar matches upstream exactly: left = radios dialog
  (ic_radios -> ToggleRadiosDialog), right = passes filter dialog
  (ic_filter -> TogglePassesDialog). The calendar button stays only on the
  radar page (upstream behavior); removes the now-unreachable
  PassesAction.AddToCalendar wiring.
- Version bumped to 4.4.6-ba7opf.10.1.
2026-09-11 22:48:53 +08:00
atsunatsu 6cb5b062d3 fix(map): own-grid bold outline wiped on every recomposition — keep ownGrid set
setGridMode only received stationPosition on the grid-mode entry frame (for
centering); every later recomposition (map refreshes once per second) passed
null, so gridOverlay.ownGrid was reset to null and the bold outline vanished.
Split the concerns: ownGrid is now derived from uiState.stationPosition on
EVERY update, while centering stays gated by centerOnStation (= entry only).
2026-09-11 22:40:44 +08:00
6 changed files with 15 additions and 28 deletions

No files matched your search

@@ -67,7 +67,8 @@ class MaidenheadGridOverlay : Overlay() {
private val ownLinePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
strokeWidth = 6f
style = Paint.Style.STROKE
color = Color.argb(255, 90, 200, 255)
// 与普通网格线同色(淡黄), 仅加粗 — 用户要求当前网格框线不换色
color = Color.argb(160, 255, 224, 130)
}
private val selectedLinePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
strokeWidth = 4.5f
@@ -256,7 +256,8 @@ private fun MapScreen(uiState: MapState, onAction: (MapAction) -> Unit, mapView:
val shouldCenter = uiState.isGridMode && !prevGridMode
setGridMode(
uiState.isGridMode, uiState.workedGrids, uiState.roamedGrids, view,
if (shouldCenter) uiState.stationPosition else null
uiState.stationPosition,
centerOnStation = shouldCenter
)
if (!shouldCenter || uiState.stationPosition != null) {
prevGridMode = uiState.isGridMode
@@ -639,7 +640,8 @@ private fun setGridMode(
workedGrids: Set<String>,
roamedGrids: Set<String>,
mapView: MapView,
stationPosition: GeoPos?
stationPosition: GeoPos?,
centerOnStation: Boolean = false
) {
try {
val gridOverlay = mapView.overlays[OVERLAY_GRID]
@@ -647,6 +649,9 @@ private fun setGridMode(
gridOverlay.isEnabled = gridMode
gridOverlay.workedGrids = workedGrids
gridOverlay.roamedGrids = roamedGrids
// ownGrid must be set on EVERY update — the position is available
// regardless of whether this frame centers (centering happens only
// on entry, but passing null here would wipe the bold outline).
gridOverlay.ownGrid = ownGridOf(stationPosition)
} else {
mapView.overlays[OVERLAY_GRID] = MaidenheadGridOverlay().apply {
@@ -666,7 +671,7 @@ private fun setGridMode(
// first composition this runs before MapView's first layout, and a
// setCenter issued pre-layout is discarded when the view lays out —
// the map then keeps its default center forever.
if (gridMode) {
if (gridMode && centerOnStation) {
val pos = stationPosition ?: return
val lat = pos.latitude
val lon = pos.longitude
@@ -156,7 +156,7 @@ private fun PassesScreen(
TopBar(
isVerticalLayout = isVerticalLayout,
startAction = {
IconCard(action = { onAction(PassesAction.TogglePassesDialog) }, resId = R.drawable.ic_filter)
IconCard(action = { onAction(PassesAction.ToggleRadiosDialog) }, resId = R.drawable.ic_radios)
},
topInfo = {
TimerRow(timeString = uiState.nextTime, isTimeAos = uiState.isNextTimeAos)
@@ -165,19 +165,7 @@ private fun PassesScreen(
NextPassRow(pass = uiState.nextPass, isUtc = uiState.isUtc)
},
endAction = {
// 日程功能: 把下个过境写入系统日历 (原仓库雷达页的 addToCalendar).
IconCard(
action = {
onAction(
PassesAction.AddToCalendar(
uiState.nextPass.name,
uiState.nextPass.aosTime,
uiState.nextPass.losTime
)
)
},
resId = R.drawable.ic_calendar
)
IconCard(action = { onAction(PassesAction.TogglePassesDialog) }, resId = R.drawable.ic_filter)
}
)
}
@@ -61,6 +61,4 @@ sealed interface PassesAction {
data object ToggleRadiosDialog : PassesAction
data class FocusCatNum(val catNum: Int) : PassesAction
data object ClearFocus : PassesAction
/** 日程功能: 把下个过境写入系统日历 (ic_calendar 按钮). */
data class AddToCalendar(val name: String, val aosTime: Long, val losTime: Long) : PassesAction
}
@@ -28,7 +28,6 @@ import com.rtbishop.look4sat.core.domain.predict.OrbitalPass
import com.rtbishop.look4sat.core.domain.repository.IMainContainer
import com.rtbishop.look4sat.core.domain.repository.ISatelliteRepo
import com.rtbishop.look4sat.core.domain.repository.ISettingsRepo
import com.rtbishop.look4sat.core.domain.usecase.IAddToCalendar
import com.rtbishop.look4sat.core.domain.utility.round
import com.rtbishop.look4sat.core.domain.utility.toTimerString
import com.rtbishop.look4sat.core.presentation.getDefaultPass
@@ -47,8 +46,7 @@ import java.util.TimeZone
class PassesViewModel(
private val satelliteRepo: ISatelliteRepo,
private val settingsRepo: ISettingsRepo,
private val addToCalendar: IAddToCalendar
private val settingsRepo: ISettingsRepo
) : ViewModel() {
private val defaultPass = getDefaultPass()
@@ -153,8 +151,6 @@ class PassesViewModel(
_uiState.update { it.copy(isRadiosDialogShown = !it.isRadiosDialogShown) }
is PassesAction.FocusCatNum -> _uiState.update { it.copy(focusedCatNum = action.catNum) }
PassesAction.ClearFocus -> _uiState.update { it.copy(focusedCatNum = null) }
is PassesAction.AddToCalendar ->
addToCalendar(action.name, action.aosTime, action.losTime)
}
}
@@ -349,8 +345,7 @@ class PassesViewModel(
initializer {
PassesViewModel(
satelliteRepo = container.satelliteRepo,
settingsRepo = container.settingsRepo,
addToCalendar = container.provideAddToCalendar()
settingsRepo = container.settingsRepo
)
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
#noinspection UnusedVersionCatalogEntry
appVersionCode = "468"
#noinspection UnusedVersionCatalogEntry
appVersionName = "4.4.6-ba7opf.10"
appVersionName = "4.4.6-ba7opf.10.1"
#noinspection UnusedVersionCatalogEntry
compileSdk = "37"
#noinspection UnusedVersionCatalogEntry