feat(settings): 为关于页面添加链接
This commit is contained in:
parent
e37b2c10bb
commit
c26d41b232
2 changed files with 11 additions and 3 deletions
|
|
@ -1,6 +1,9 @@
|
|||
package cn.super12138.todo.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 PREF_DYNAMIC_COLOR = "dynamic_color"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
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.fillMaxSize
|
||||
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.res.stringResource
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.constants.Constants
|
||||
import cn.super12138.todo.ui.components.LargeTopAppBarScaffold
|
||||
import cn.super12138.todo.ui.pages.settings.components.SettingsItem
|
||||
import cn.super12138.todo.utils.getAppVersion
|
||||
|
|
@ -45,14 +48,16 @@ fun SettingsAbout(
|
|||
SettingsItem(
|
||||
leadingIcon = Icons.Outlined.Numbers,
|
||||
title = stringResource(R.string.pref_app_version),
|
||||
description = getAppVersion(context),
|
||||
enableClick = false
|
||||
description = getAppVersion(context)
|
||||
)
|
||||
SettingsItem(
|
||||
leadingIcon = Icons.Outlined.Person4,
|
||||
title = stringResource(R.string.pref_developer),
|
||||
description = stringResource(R.string.developer_name),
|
||||
enableClick = false
|
||||
onClick = {
|
||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(Constants.DEVELOPER_GITHUB))
|
||||
context.startActivity(intent)
|
||||
}
|
||||
)
|
||||
SettingsItem(
|
||||
leadingIcon = Icons.Outlined.Balance,
|
||||
|
|
|
|||
Loading…
Reference in a new issue