mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-11 00:12:24 +01:00
settings: What's new opens this version's release notes on GitHub
This commit is contained in:
1 parent
ef006dc695
commit
fed652f9d3
3 files changed
+6
-4
No files matched your search
@@ -45,6 +45,9 @@ internal object GearslipLinks {
|
|||||||
const val SOURCE = "https://github.com/twinksoftware/gearslip"
|
const val SOURCE = "https://github.com/twinksoftware/gearslip"
|
||||||
const val CARS = "$SOURCE/blob/main/CARS.md"
|
const val CARS = "$SOURCE/blob/main/CARS.md"
|
||||||
|
|
||||||
|
/** This version's release notes on GitHub; every release is tagged v plus its version name. */
|
||||||
|
val RELEASE_NOTES = "$SOURCE/releases/tag/v${app.seb3thehacker.gearslip.BuildConfig.VERSION_NAME}"
|
||||||
|
|
||||||
fun open(context: Context, url: String) {
|
fun open(context: Context, url: String) {
|
||||||
runCatching {
|
runCatching {
|
||||||
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ fun GearslipApp(onDisconnect: () -> Unit, onRequestCallScreening: () -> Unit) {
|
|||||||
Screen.SETTINGS -> SettingsScreen(
|
Screen.SETTINGS -> SettingsScreen(
|
||||||
onBack = { screen = Screen.HOME },
|
onBack = { screen = Screen.HOME },
|
||||||
onOpenRecommendedApps = { settingsAtUsageNotes = false; screen = Screen.RECOMMENDED_APPS },
|
onOpenRecommendedApps = { settingsAtUsageNotes = false; screen = Screen.RECOMMENDED_APPS },
|
||||||
onOpenWhatsNew = { settingsAtUsageNotes = false; backTo = Screen.SETTINGS; screen = Screen.WHATS_NEW },
|
|
||||||
onReplayTutorial = { screen = Screen.SETUP_GUIDE },
|
onReplayTutorial = { screen = Screen.SETUP_GUIDE },
|
||||||
atUsageNotes = settingsAtUsageNotes,
|
atUsageNotes = settingsAtUsageNotes,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ import kotlinx.coroutines.withContext
|
|||||||
fun SettingsScreen(
|
fun SettingsScreen(
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onOpenRecommendedApps: () -> Unit,
|
onOpenRecommendedApps: () -> Unit,
|
||||||
onOpenWhatsNew: () -> Unit,
|
|
||||||
onReplayTutorial: () -> Unit,
|
onReplayTutorial: () -> Unit,
|
||||||
atUsageNotes: Boolean = false,
|
atUsageNotes: Boolean = false,
|
||||||
) {
|
) {
|
||||||
@@ -116,10 +115,11 @@ fun SettingsScreen(
|
|||||||
) {
|
) {
|
||||||
Spacer(Modifier.height(0.dp))
|
Spacer(Modifier.height(0.dp))
|
||||||
SettingsSection {
|
SettingsSection {
|
||||||
|
val context = LocalContext.current
|
||||||
SettingsRow(
|
SettingsRow(
|
||||||
"What's new",
|
"What's new",
|
||||||
Modifier.clickable(onClick = onOpenWhatsNew),
|
Modifier.clickable { GearslipLinks.open(context, GearslipLinks.RELEASE_NOTES) },
|
||||||
subtitle = "Version ${BuildConfig.VERSION_NAME}",
|
subtitle = "Read the ${BuildConfig.VERSION_NAME} release notes on GitHub",
|
||||||
icon = Icons.Filled.Star,
|
icon = Icons.Filled.Star,
|
||||||
trailing = { Arrow() },
|
trailing = { Arrow() },
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user