mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
improve storage permission handling to fix an Android 11 issue
This commit is contained in:
@ -436,22 +436,27 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun tryLoadGallery() {
|
private fun tryLoadGallery() {
|
||||||
if (hasPermission(PERMISSION_WRITE_STORAGE)) {
|
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||||
if (!config.wasUpgradedFromFreeShown && isPackageInstalled("com.simplemobiletools.gallery")) {
|
if (it) {
|
||||||
ConfirmationDialog(this, "", R.string.upgraded_from_free, R.string.ok, 0) {}
|
if (!config.wasUpgradedFromFreeShown && isPackageInstalled("com.simplemobiletools.gallery")) {
|
||||||
config.wasUpgradedFromFreeShown = true
|
ConfirmationDialog(this, "", R.string.upgraded_from_free, R.string.ok, 0) {}
|
||||||
}
|
config.wasUpgradedFromFreeShown = true
|
||||||
|
}
|
||||||
|
|
||||||
checkOTGPath()
|
checkOTGPath()
|
||||||
checkDefaultSpamFolders()
|
checkDefaultSpamFolders()
|
||||||
|
|
||||||
if (config.showAll) {
|
if (config.showAll) {
|
||||||
showAllMedia()
|
showAllMedia()
|
||||||
|
} else {
|
||||||
|
getDirectories()
|
||||||
|
}
|
||||||
|
|
||||||
|
setupLayoutManager()
|
||||||
} else {
|
} else {
|
||||||
getDirectories()
|
toast(R.string.no_storage_permissions)
|
||||||
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
setupLayoutManager()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user