fix: 主页底部版本号改为实时读取 BuildConfig.VERSION_NAME

This commit is contained in:
WaterRain 2026-08-04 06:48:52 +00:00
parent 8340ded070
commit 488f08d083
No known key found for this signature in database
3 changed files with 4 additions and 2 deletions

View File

@ -75,6 +75,7 @@ android {
} }
buildFeatures { buildFeatures {
compose = true compose = true
buildConfig = true
} }
androidResources { androidResources {
// Android 13+ 应用级语言设置:根据 values-* 目录自动生成 locales_config // Android 13+ 应用级语言设置:根据 values-* 目录自动生成 locales_config

View File

@ -78,6 +78,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
import androidx.lifecycle.compose.LifecycleEventEffect import androidx.lifecycle.compose.LifecycleEventEffect
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.rainy.token.BuildConfig
import com.rainy.token.R import com.rainy.token.R
import com.rainy.token.domain.model.CredentialStatus import com.rainy.token.domain.model.CredentialStatus
import com.rainy.token.domain.model.ServiceBalance import com.rainy.token.domain.model.ServiceBalance
@ -697,7 +698,7 @@ private fun DashboardFooter() {
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally
) { ) {
Text( Text(
text = stringResource(R.string.dashboard_footer_version), text = stringResource(R.string.dashboard_footer_version, BuildConfig.VERSION_NAME),
style = MaterialTheme.typography.bodySmall, style = MaterialTheme.typography.bodySmall,
color = inkMuted() color = inkMuted()
) )

View File

@ -2,7 +2,7 @@
<resources> <resources>
<!-- ══════════ 品牌资源(translatable=false,所有语言共用,不参与翻译) ══════════ --> <!-- ══════════ 品牌资源(translatable=false,所有语言共用,不参与翻译) ══════════ -->
<string name="brand_token" translatable="false">RainyToken</string> <string name="brand_token" translatable="false">RainyToken</string>
<string name="dashboard_footer_version" translatable="false">RainyToken · v1.0</string> <string name="dashboard_footer_version" translatable="false">RainyToken · v%1$s</string>
<!-- ══════════ 应用名称(跟随语言:中文系统显示中文名,其他显示英文名) ══════════ --> <!-- ══════════ 应用名称(跟随语言:中文系统显示中文名,其他显示英文名) ══════════ -->
<string name="app_name">RainyToken</string> <string name="app_name">RainyToken</string>