feat(settings): 为关于页面添加链接

This commit is contained in:
Super12138 2025-02-05 17:40:34 +08:00
parent e37b2c10bb
commit c26d41b232
2 changed files with 11 additions and 3 deletions

View file

@ -1,6 +1,9 @@
package cn.super12138.todo.constants package cn.super12138.todo.constants
object Constants { object Constants {
const val DEVELOPER_GITHUB = "https://github.com/Super12138/"
const val GITHUB_REPO = "https://github.com/Super12138/ToDo/"
const val SP_NAME = "cn.super12138.todo_preferences" const val SP_NAME = "cn.super12138.todo_preferences"
const val PREF_DYNAMIC_COLOR = "dynamic_color" const val PREF_DYNAMIC_COLOR = "dynamic_color"

View file

@ -1,5 +1,7 @@
package cn.super12138.todo.ui.pages.settings package cn.super12138.todo.ui.pages.settings
import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
@ -17,6 +19,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import cn.super12138.todo.R import cn.super12138.todo.R
import cn.super12138.todo.constants.Constants
import cn.super12138.todo.ui.components.LargeTopAppBarScaffold import cn.super12138.todo.ui.components.LargeTopAppBarScaffold
import cn.super12138.todo.ui.pages.settings.components.SettingsItem import cn.super12138.todo.ui.pages.settings.components.SettingsItem
import cn.super12138.todo.utils.getAppVersion import cn.super12138.todo.utils.getAppVersion
@ -45,14 +48,16 @@ fun SettingsAbout(
SettingsItem( SettingsItem(
leadingIcon = Icons.Outlined.Numbers, leadingIcon = Icons.Outlined.Numbers,
title = stringResource(R.string.pref_app_version), title = stringResource(R.string.pref_app_version),
description = getAppVersion(context), description = getAppVersion(context)
enableClick = false
) )
SettingsItem( SettingsItem(
leadingIcon = Icons.Outlined.Person4, leadingIcon = Icons.Outlined.Person4,
title = stringResource(R.string.pref_developer), title = stringResource(R.string.pref_developer),
description = stringResource(R.string.developer_name), description = stringResource(R.string.developer_name),
enableClick = false onClick = {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(Constants.DEVELOPER_GITHUB))
context.startActivity(intent)
}
) )
SettingsItem( SettingsItem(
leadingIcon = Icons.Outlined.Balance, leadingIcon = Icons.Outlined.Balance,