feat(设置): 「版本」行可点进「关于」页
设置页的「关于」分组里,「版本」此行此前点了没反应——它是全页唯一 没有 onClick 的行。现在它带 ChevronForward(与管理员入口行同一种「可 进子页」提示)并可点,进入新的「关于」页。 「关于」页只有四项:应用名(Cyrene)、版本、一句话简介、作者 (AskaEth),自己带 Scaffold + 返回按钮,观感与设置页一致。版本号复用 BuildConfig,不写死;页面里不放任何链接 / 邮箱 / 版权年份——这些信息 没有人提供过。 返回层级照项目既有的手写布尔状态 + 分层 BackHandler 模式(本项目无导航 库),新增 showAbout: - 关于 → 设置 → 聊天; - 设置页的处理器条件是 showSettings && !showAbout(与关于页互斥), 所以在关于页按返回只退一层,不会一步跳回聊天; - 抽屉 / 设置 / 管理页既有层级未动。 版本文本抽成纯函数 versionText(versionName, versionCode),设置页与关于页 共用一份格式,并由 VersionTextTest 钉住输出。 测试:485 → 487(新增 VersionTextTest 2 条),0 失败 / 0 错误; assembleDebug 通过。
This commit is contained in:
1 parent
a6b4bae2a0
commit
3ed2377b3c
4 files changed
+138
-2
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package top.yeij.cyrene.ui.settings
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* 版本文本的格式(纯函数):设置页的「版本」行与关于页共用同一份输出。
|
||||
*
|
||||
* 这里钉的是**格式**,不是某个具体版本号——值来自 `BuildConfig`,发版只改构建文件。
|
||||
*/
|
||||
class VersionTextTest {
|
||||
|
||||
@Test
|
||||
fun `version name is followed by the code in parentheses`() {
|
||||
assertEquals("0.1.0 (1)", versionText("0.1.0", 1))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `both inputs are rendered verbatim, so the label tracks the build config`() {
|
||||
assertEquals("2.3.4 (567)", versionText("2.3.4", 567))
|
||||
assertEquals("1.0.0-beta (42)", versionText("1.0.0-beta", 42))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user