show the Upgrading from Free dialog only after granding write permissions

This commit is contained in:
tibbi 2019-04-01 18:50:24 +02:00
parent 614c3def6a
commit c7f57842c8

View file

@ -151,11 +151,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
updateWidgets() updateWidgets()
registerFileUpdateListener() registerFileUpdateListener()
if (!config.wasUpgradedFromFreeShown && isPackageInstalled("com.simplemobiletools.gallery")) {
ConfirmationDialog(this, "", R.string.upgraded_from_free, R.string.ok, 0) {}
config.wasUpgradedFromFreeShown = true
}
} }
override fun onStart() { override fun onStart() {
@ -435,6 +430,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private fun tryLoadGallery() { private fun tryLoadGallery() {
handlePermission(PERMISSION_WRITE_STORAGE) { handlePermission(PERMISSION_WRITE_STORAGE) {
if (it) { if (it) {
if (!config.wasUpgradedFromFreeShown && isPackageInstalled("com.simplemobiletools.gallery")) {
ConfirmationDialog(this, "", R.string.upgraded_from_free, R.string.ok, 0) {}
config.wasUpgradedFromFreeShown = true
}
checkOTGPath() checkOTGPath()
checkDefaultSpamFolders() checkDefaultSpamFolders()