Skip to content

Commit

Permalink
chore: 增加开源地址说明
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 16, 2023
1 parent 56949c2 commit 6e0a312
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
26 changes: 26 additions & 0 deletions app/src/main/java/li/songe/gkd/ui/AboutPage.kt
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
package li.songe.gkd.ui

import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import com.ramcosta.composedestinations.annotation.Destination
import com.ramcosta.composedestinations.annotation.RootNavGraph
import li.songe.gkd.BuildConfig
import li.songe.gkd.appScope
import li.songe.gkd.util.LocalNavController
import li.songe.gkd.util.ProfileTransitions
import li.songe.gkd.util.REPOSITORY_URL
import li.songe.gkd.util.launchTry

@RootNavGraph
@Destination(style = ProfileTransitions::class)
@Composable
fun AboutPage() {
val navController = LocalNavController.current
val context = LocalContext.current
Scaffold(topBar = {
TopAppBar(navigationIcon = {
IconButton(onClick = {
Expand All @@ -42,6 +52,22 @@ fun AboutPage() {
.padding(10.dp),
verticalArrangement = Arrangement.spacedBy(10.dp)
) {
Row {
Text(text = "开源地址: ")
Text(text = REPOSITORY_URL,
color = MaterialTheme.colorScheme.primary,
modifier = Modifier.clickable {
appScope.launchTry {
// ActivityNotFoundException
// https://bugly.qq.com/v2/crash-reporting/crashes/d0ce46b353/117002?pid=1
context.startActivity(
Intent(
Intent.ACTION_VIEW, Uri.parse(REPOSITORY_URL)
)
)
}
})
}
Text(text = "版本代码: " + BuildConfig.VERSION_CODE)
Text(text = "版本名称: " + BuildConfig.VERSION_NAME)
Text(text = "构建时间: " + BuildConfig.BUILD_DATE)
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/li/songe/gkd/util/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ const val DEFAULT_SUBS_UPDATE_URL =
"https://registry.npmmirror.com/@gkd-kit/subscription/latest/files"
const val UPDATE_URL = "https://registry.npmmirror.com/@gkd-kit/app/latest/files/index.json"

const val REPOSITORY_URL = "https://github.com/gkd-kit/gkd"

val safeRemoteBaseUrls = arrayOf(
"https://registry.npmmirror.com/@gkd-kit/",
"https://cdn.jsdelivr.net/npm/@gkd-kit/",
"https://fastly.jsdelivr.net/npm/@gkd-kit/",
"https://unpkg.com/@gkd-kit/",
"https://github.com/gkd-kit/",
"https://raw.githubusercontent.com/gkd-kit/"
)
)

0 comments on commit 6e0a312

Please sign in to comment.