Skip to content

Commit

Permalink
Enforce viewing the guide for setup issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Oct 5, 2023
1 parent 7441e03 commit 894fdab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
compileSdk 34
minSdk 16
targetSdk 34
versionName "4.1.0"
versionName "4.1.1"
versionCode = versionName.replace(".","").toInteger() * 10

vectorDrawables {
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/java/com/hiddenramblings/tagmo/eightbit/io/Debug.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import java.util.*

@Suppress("unused")
object Debug {
private val guideUri = Uri.parse("https://tagmo.gitlab.io")
private val context: Context
get() = TagMo.appContext
private val mPrefs = Preferences(context)
Expand Down Expand Up @@ -278,20 +279,25 @@ object Debug {
}

private fun showGuideBanner(context: Context) {
if (context is BrowserActivity) {
if (context is Activity) {
IconifiedSnackbar(context).buildSnackbar(
R.string.menu_guides,
R.drawable.ic_support_required_menu,
Snackbar.LENGTH_LONG
).also { guides ->
guides.setAction(R.string.view) {
context.showWebsite(null)
if (context is BrowserActivity) {
context.showWebsite(null)
} else {
context.startActivity(Intent(Intent.ACTION_VIEW, guideUri))
}
guides.dismiss()
}
guides.show()
}
} else {
Toasty(context).Long(R.string.guide_suggested)
context.startActivity(Intent(Intent.ACTION_VIEW, guideUri))
}
}

Expand Down

0 comments on commit 894fdab

Please sign in to comment.