fix #1976, properly handle app protection at opening a default folder
This commit is contained in:
parent
74777a7cb8
commit
49c809815f
|
@ -66,6 +66,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
private var mWasProtectionHandled = false
|
private var mWasProtectionHandled = false
|
||||||
private var mShouldStopFetching = false
|
private var mShouldStopFetching = false
|
||||||
private var mIsSearchOpen = false
|
private var mIsSearchOpen = false
|
||||||
|
private var mWasDefaultFolderChecked = false
|
||||||
private var mLatestMediaId = 0L
|
private var mLatestMediaId = 0L
|
||||||
private var mLatestMediaDateId = 0L
|
private var mLatestMediaDateId = 0L
|
||||||
private var mCurrentPathPrefix = "" // used at "Group direct subfolders" for navigation
|
private var mCurrentPathPrefix = "" // used at "Group direct subfolders" for navigation
|
||||||
|
@ -92,8 +93,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
appLaunched(BuildConfig.APPLICATION_ID)
|
appLaunched(BuildConfig.APPLICATION_ID)
|
||||||
|
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
openDefaultFolder()
|
|
||||||
|
|
||||||
config.temporarilyShowHidden = false
|
config.temporarilyShowHidden = false
|
||||||
config.tempSkipDeleteConfirmation = false
|
config.tempSkipDeleteConfirmation = false
|
||||||
removeTempFolder()
|
removeTempFolder()
|
||||||
|
@ -436,6 +435,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
private fun tryLoadGallery() {
|
private fun tryLoadGallery() {
|
||||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||||
if (it) {
|
if (it) {
|
||||||
|
if (!mWasDefaultFolderChecked) {
|
||||||
|
openDefaultFolder()
|
||||||
|
mWasDefaultFolderChecked = true
|
||||||
|
}
|
||||||
|
|
||||||
if (!config.wasUpgradedFromFreeShown && isPackageInstalled("com.simplemobiletools.gallery")) {
|
if (!config.wasUpgradedFromFreeShown && isPackageInstalled("com.simplemobiletools.gallery")) {
|
||||||
ConfirmationDialog(this, "", R.string.upgraded_from_free, R.string.ok, 0) {}
|
ConfirmationDialog(this, "", R.string.upgraded_from_free, R.string.ok, 0) {}
|
||||||
config.wasUpgradedFromFreeShown = true
|
config.wasUpgradedFromFreeShown = true
|
||||||
|
|
Loading…
Reference in New Issue