this statement is false

This commit is contained in:
X1nto 2020-05-08 23:44:59 +04:00
parent cb6bbfa4e5
commit a4b426555e
1 changed files with 20 additions and 1 deletions

View File

@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import android.os.Build
import android.os.Bundle
import androidx.appcompat.app.AlertDialog
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.vanced.manager.R
import com.vanced.manager.ui.core.ThemeActivity
@ -19,6 +18,8 @@ open class Main: ThemeActivity() {
val prefs = getSharedPreferences("prefs", MODE_PRIVATE)
val firstStart = prefs.getBoolean("firstStart", true)
val falseStatement = prefs.getBoolean("statement", true)
if (firstStart) {
//A little surprise for those who
//love lowering minSdkVersions
@ -26,6 +27,10 @@ open class Main: ThemeActivity() {
showUnsupportedSdkDialog()
} else showSecurityDialog()
}
if (!falseStatement) {
statementFalse()
}
}
private fun showSecurityDialog() {
@ -42,6 +47,20 @@ open class Main: ThemeActivity() {
editor.apply()
}
private fun statementFalse() {
AlertDialog.Builder(this)
.setTitle("Wait what?")
.setMessage("So this statement is false huh? I'll go with True!")
.setPositiveButton("wut?") { dialog, _ -> dialog.dismiss() }
.create()
.show()
val prefs = getSharedPreferences("prefs", MODE_PRIVATE)
val editor = prefs.edit()
editor.putBoolean("statement", true)
editor.apply()
}
private fun showUnsupportedSdkDialog() {
AlertDialog.Builder(this)
.setTitle(resources.getString(R.string.whoops))