Handle access_more_media options menu

This commit is contained in:
Ensar Sarajčić 2023-08-09 11:02:46 +02:00
parent 3303a6d638
commit 763e0eacc6
5 changed files with 6 additions and 4 deletions

View file

@ -101,7 +101,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
} }
setupOptionsMenu() setupOptionsMenu()
handlePermission(getPermissionToRequest()) { handlePartialMediaPermissions(getPermissionsToRequest()) {
if (!it) { if (!it) {
toast(com.simplemobiletools.commons.R.string.no_storage_permissions) toast(com.simplemobiletools.commons.R.string.no_storage_permissions)
finish() finish()

View file

@ -361,6 +361,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
findItem(R.id.temporarily_show_excluded).isVisible = !config.temporarilyShowExcluded findItem(R.id.temporarily_show_excluded).isVisible = !config.temporarilyShowExcluded
findItem(R.id.stop_showing_excluded).isVisible = config.temporarilyShowExcluded findItem(R.id.stop_showing_excluded).isVisible = config.temporarilyShowExcluded
findItem(R.id.access_more_media).isVisible = isUpsideDownCakePlus()
} }
} }

View file

@ -382,7 +382,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
} }
private fun tryLoadGallery() { private fun tryLoadGallery() {
handlePermission(getPermissionToRequest()) { handlePartialMediaPermissions(getPermissionsToRequest()) {
if (it) { if (it) {
val dirName = when { val dirName = when {
mPath == FAVORITES -> getString(com.simplemobiletools.commons.R.string.favorites) mPath == FAVORITES -> getString(com.simplemobiletools.commons.R.string.favorites)

View file

@ -48,7 +48,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
setupOptionsMenu() setupOptionsMenu()
refreshMenuItems() refreshMenuItems()
handlePermission(getPermissionToRequest()) { handlePartialMediaPermissions(getPermissionsToRequest()) {
if (it) { if (it) {
checkIntent(savedInstanceState) checkIntent(savedInstanceState)
} else { } else {

View file

@ -97,7 +97,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
checkNotchSupport() checkNotchSupport()
(MediaActivity.mMedia.clone() as ArrayList<ThumbnailItem>).filterIsInstanceTo(mMediaFiles, Medium::class.java) (MediaActivity.mMedia.clone() as ArrayList<ThumbnailItem>).filterIsInstanceTo(mMediaFiles, Medium::class.java)
handlePermission(getPermissionToRequest()) { handlePartialMediaPermissions(getPermissionsToRequest()) {
if (it) { if (it) {
initViewPager() initViewPager()
} else { } else {