From 2110bf0cd648999c1d7f1b283d6734ceecb6aff1 Mon Sep 17 00:00:00 2001 From: atsunatsu Date: Tue, 29 Sep 2026 01:11:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(settings):=20=E8=AE=BE=E7=BD=AE=E9=A1=B5?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20Project=20Wiki=20=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=88fork=20=E5=A2=9E=E9=87=8F=E5=8A=9F=E8=83=BD=E4=B8=8E?= =?UTF-8?q?=E7=94=A8=E6=B3=95=E8=AF=B4=E6=98=8E=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/values-zh/strings.xml | 13 ++ .../src/main/res/values/strings.xml | 13 ++ .../look4sat/feature/settings/ProjectWiki.kt | 113 ++++++++++++++++++ .../feature/settings/SettingsScreen.kt | 25 ++++ 4 files changed, 164 insertions(+) create mode 100644 feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/ProjectWiki.kt diff --git a/core/presentation/src/main/res/values-zh/strings.xml b/core/presentation/src/main/res/values-zh/strings.xml index ae1d2fdf..3b90991c 100644 --- a/core/presentation/src/main/res/values-zh/strings.xml +++ b/core/presentation/src/main/res/values-zh/strings.xml @@ -313,6 +313,19 @@ 高 > %1$d° 致谢与声明 + Project Wiki + Look4Sat-BA7OPF 是基于 Look4Sat 的定制版,保留上游全部功能,并新增: + 卫星日志本与 LoTW + 卫星通联日志本——通联时一键记录呼号、时间、频率、模式、信号报告和网格。 + LoTW 直传——导入 ARRL 证书后,直接在 App 内把日志上传到 LoTW,无需电脑。 + 确认同步——一键同步 LoTW 官方确认,日志自动标记“已上传 / 已确认”;修改已上传的记录会自动新建一条,原记录不受影响。 + 用法:通联后点“记录”→ 日志页点“上传”→ 设置里“同步”查看确认。 + 双站过境匹配 + 友台共视匹配——输入你和友台的位置,找出双方同时可见的卫星过境,点一下直接进雷达图。 + 用法:Match 页 → 设置两站位置 → 查询。 + 通联网格地图 + 已通联网格——LoTW/Wavelog 同步的网格在地图上标绿,支持奖状边界和首通呼号标签;点格子看该网格的通联记录,还能一键去匹配友台。 + 用法:地图页开启网格模式 → 设置里同步 LoTW/Wavelog。 • Look4Sat 所有用户及贡献者! \n• David A. B. Johnson (predict4java) diff --git a/core/presentation/src/main/res/values/strings.xml b/core/presentation/src/main/res/values/strings.xml index a6176ff8..b2544414 100644 --- a/core/presentation/src/main/res/values/strings.xml +++ b/core/presentation/src/main/res/values/strings.xml @@ -342,6 +342,19 @@ High > %1$d° Credits & Notices + Project Wiki + Look4Sat-BA7OPF is a customized fork of Look4Sat. All upstream features, plus: + Satellite Logbook & LoTW + Satellite logbook — one-tap logging of callsign, time, frequency, mode, report and grid. + Direct LoTW upload — import your ARRL certificate and upload logs to LoTW right from the app, no PC needed. + Confirmation sync — one-tap sync of LoTW confirmations, marked as uploaded/confirmed. Editing an uploaded entry creates a new one, leaving the original untouched. + How: tap Record after a QSO → Upload on the log page → Sync in Settings. + Mutual Pass Matching + Enter your QTH and a friend\'s to find passes visible to both; tap a pass to open the radar. + How: Match tab → set both stations → Query. + Worked-Grid Map + Grids synced from LoTW/Wavelog shown in green, with award boundaries and first-QSO callsign labels; tap a grid to see its QSOs and match a friend. + How: enable Grid mode on the map → sync LoTW/Wavelog in Settings. * Look4Sat users and contributors! \n* David A. B. Johnson (predict4java) diff --git a/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/ProjectWiki.kt b/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/ProjectWiki.kt new file mode 100644 index 00000000..923876bb --- /dev/null +++ b/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/ProjectWiki.kt @@ -0,0 +1,113 @@ +/* + * Look4Sat. Amateur radio satellite tracker and pass predictor. + * Copyright (C) 2019-2026 Arty Bishop and contributors. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.rtbishop.look4sat.feature.settings + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.rtbishop.look4sat.core.presentation.R +import com.rtbishop.look4sat.core.presentation.sheetDialogContainerColor +import com.rtbishop.look4sat.core.presentation.sheetDialogShape +import com.rtbishop.look4sat.core.presentation.SheetDialogTitle + +/** + * The fork's Project Wiki: a short overview of what Look4Sat-BA7OPF adds over upstream + * and how to use those features. Shown in the update-checker screen and behind the + * Settings → Project Wiki entry. Text lives in string resources (no release-body parsing), + * so it always renders even when the GitHub page is unreachable. + */ +@Composable +fun ProjectWikiBody(modifier: Modifier = Modifier) { + Column(modifier = modifier, verticalArrangement = Arrangement.spacedBy(8.dp)) { + Text( + text = stringResource(R.string.project_wiki_intro), + fontSize = 13.sp + ) + WikiSection(stringResource(R.string.project_wiki_section_logbook)) + WikiEntry(stringResource(R.string.project_wiki_logbook_1)) + WikiEntry(stringResource(R.string.project_wiki_logbook_2)) + WikiEntry(stringResource(R.string.project_wiki_logbook_3)) + WikiHow(stringResource(R.string.project_wiki_logbook_how)) + WikiSection(stringResource(R.string.project_wiki_section_mutual)) + WikiEntry(stringResource(R.string.project_wiki_mutual_1)) + WikiHow(stringResource(R.string.project_wiki_mutual_how)) + WikiSection(stringResource(R.string.project_wiki_section_grids)) + WikiEntry(stringResource(R.string.project_wiki_grids_1)) + WikiHow(stringResource(R.string.project_wiki_grids_how)) + } +} + +@Composable +fun ProjectWikiDialog(onDismiss: () -> Unit) { + AlertDialog( + onDismissRequest = onDismiss, + shape = sheetDialogShape(), + containerColor = sheetDialogContainerColor(), + title = { SheetDialogTitle(stringResource(R.string.prefs_project_wiki)) }, + text = { + ProjectWikiBody( + modifier = Modifier + .fillMaxWidth() + .verticalScroll(rememberScrollState()) + ) + }, + confirmButton = { + TextButton(onClick = onDismiss) { + Text(stringResource(android.R.string.ok)) + } + } + ) +} + +@Composable +private fun WikiSection(text: String) { + Text( + text = text, + color = MaterialTheme.colorScheme.primary, + fontWeight = FontWeight.Medium, + fontSize = 13.sp + ) +} + +@Composable +private fun WikiEntry(text: String) { + Text(text = text, fontSize = 12.sp) +} + +@Composable +private fun WikiHow(text: String) { + Text( + text = text, + fontSize = 12.sp, + color = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.padding(start = 8.dp) + ) +} diff --git a/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.kt b/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.kt index 70c58b0d..2a2509a3 100644 --- a/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.kt +++ b/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.kt @@ -101,6 +101,10 @@ fun SettingsDestination() { private fun SettingsScreen(uiState: SettingsState, onAction: (SettingsAction) -> Unit) { var showUpdateChecker by rememberSaveable { mutableStateOf(false) } var showMapSettings by rememberSaveable { mutableStateOf(false) } + var showProjectWiki by rememberSaveable { mutableStateOf(false) } + if (showProjectWiki) { + ProjectWikiDialog(onDismiss = { showProjectWiki = false }) + } if (showUpdateChecker) { UpdateCheckerScreen( currentVersion = uiState.appVersionName, @@ -421,6 +425,7 @@ private fun SettingsScreen(uiState: SettingsState, onAction: (SettingsAction) -> ) } item { MapSettingsCard(onClick = { showMapSettings = true }) } + item { ProjectWikiCard(onClick = { showProjectWiki = true }) } item { CardCredits() } item(span = { GridItemSpan(maxLineSpan) }) { CardButton( @@ -852,6 +857,26 @@ private fun UpdateIndicator(isUpdating: Boolean, modifier: Modifier = Modifier) ) } +@Composable +private fun ProjectWikiCard(onClick: () -> Unit, modifier: Modifier = Modifier) { + ElevatedCard(modifier = modifier) { + Row( + horizontalArrangement = Arrangement.spacedBy(12.dp), + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier + .height(48.dp) + .clickable { onClick() }) { + Spacer(Modifier) + Icon(painter = painterResource(id = R.drawable.ic_policy), contentDescription = null) + Text( + text = stringResource(R.string.prefs_project_wiki), + fontSize = 16.sp, + fontWeight = FontWeight.Medium + ) + } + } +} + @Preview(showBackground = true) @Composable private fun CardCreditsPreview() = MainTheme { CardCredits() }