mirror of
https://github.com/videolan/vlc-android
synced 2024-12-04 15:23:51 +08:00
Fix a permission state in the dialog for Android 12
This commit is contained in:
parent
24d19ea0f9
commit
a3c8b604b2
@ -40,6 +40,7 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_EXPANDE
|
||||
import kotlinx.coroutines.launch
|
||||
import org.videolan.resources.AndroidDevices
|
||||
import org.videolan.resources.SCHEME_PACKAGE
|
||||
import org.videolan.resources.util.isExternalStorageManager
|
||||
import org.videolan.tools.dp
|
||||
import org.videolan.tools.setGone
|
||||
import org.videolan.tools.setInvisible
|
||||
@ -193,7 +194,7 @@ class PermissionListDialog : VLCBottomSheetDialogFragment() {
|
||||
}
|
||||
|
||||
binding.manageAllPermsCheck.setOnClickListener {
|
||||
if (Permissions.hasAnyFileFineAccess(requireActivity())) {
|
||||
if (!Permissions.hasAllAccess(requireActivity()) && Permissions.hasAnyFileFineAccess(requireActivity())) {
|
||||
(it as RadioButton).isChecked = false
|
||||
binding.manageMediaPermsCheck.background = ContextCompat.getDrawable(requireActivity(), R.drawable.rounded_corners_permissions_warning)
|
||||
showWarning()
|
||||
@ -221,10 +222,10 @@ class PermissionListDialog : VLCBottomSheetDialogFragment() {
|
||||
}
|
||||
|
||||
binding.manageMediaPermsCheck.setOnClickListener {
|
||||
if (Permissions.hasAnyFileFineAccess(requireActivity())) {
|
||||
if (!isExternalStorageManager() && Permissions.hasAnyFileFineAccess(requireActivity())) {
|
||||
Permissions.showAppSettingsPage(requireActivity())
|
||||
(it as RadioButton).isChecked = false
|
||||
} else if (Permissions.canReadStorage(requireActivity())) {
|
||||
} else if (!isExternalStorageManager() && Permissions.canReadStorage(requireActivity())) {
|
||||
Permissions.showAppSettingsPage(requireActivity())
|
||||
(it as RadioButton).isChecked = false
|
||||
} else if (Permissions.hasAllAccess(requireActivity())) {
|
||||
|
Loading…
Reference in New Issue
Block a user