Skip to content

Commit 64d233d

Browse files
committed
android: use issue template
1 parent ea2c2b8 commit 64d233d

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

android/app/src/main/java/me/kavishdevar/librepods/presentation/screens/AppSettingsScreen.kt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package me.kavishdevar.librepods.presentation.screens
2020

2121
import android.content.Intent
2222
import android.content.pm.PackageManager
23+
import android.net.Uri
2324
import android.os.Build
2425
import android.widget.Toast
2526
import androidx.compose.foundation.background
@@ -542,10 +543,23 @@ fun AppSettingsScreen(
542543
name = stringResource(R.string.github_issues),
543544
navController = navController,
544545
onClick = {
545-
val intent = Intent(
546-
Intent.ACTION_VIEW,
547-
"https://github.com/kavishdevar/librepods/issues".toUri()
546+
val appVersion = Uri.encode("v${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})")
547+
val device = Uri.encode("${Build.MANUFACTURER} ${Build.MODEL}")
548+
val androidVersion = Uri.encode("${Build.ID} (${Build.DISPLAY})")
549+
val appSource = Uri.encode(
550+
when {
551+
BuildConfig.PLAY_BUILD -> "Play"
552+
else -> "GitHub"
553+
}
548554
)
555+
val url = "https://github.com/kavishdevar/librepods/issues/new" +
556+
"?template=01-bug-report-android.yml" +
557+
"&app-source=$appSource" +
558+
"&app-version=$appVersion" +
559+
"&device=$device" +
560+
"&android-version=$androidVersion"
561+
562+
val intent = Intent(Intent.ACTION_VIEW, url.toUri())
549563
context.startActivity(intent)
550564
},
551565
independent = false

0 commit comments

Comments
 (0)