bottomsheet-imagepicker
bottomsheet-imagepicker copied to clipboard
Android 13 Permissions Issue
Since Android 13 removed the storage permission, the BottomSheetImagePicker.Builder is no longer working because when it goes to BottomSeetImagePicker's onCreate, it goest into the else of the ReadStoragePermission has if it had no permission and get's stuck on a loop on PermissionUtils, because android 13 does not ask for that permission
Any update on this issue?
well we manage to find a workaround this issue, before calling the BottomSheetImagePicker.Builder we added the pickMultipleMedia native method.
if(Build.VERSION.SDK_INT >= 33) { pickMultipleMedia.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly)) }
final product for this was the following :
if(ContextCompat.checkSelfPermission(requireContext(), permission.READ_MEDIA_IMAGES) == PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(requireContext(), permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { if(Build.VERSION.SDK_INT >= 33) { pickMultipleMedia.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly)) } else { try { BottomSheetImagePicker.Builder(BuildConfig.APPLICATION_ID + ".provider") .cameraButton(ButtonType.Button) .galleryButton(ButtonType.Button) .multiSelect(1, maxAllowed) .peekHeight(R.dimen.peekHeight)
.columnSize(R.dimen.columnSize)
.requestTag("multi")
.show(childFragmentManager, null)
} catch (e: Exception) {
Log.e("ERROR", e.toString())
}
}
} else {
requestStoragePermission()
}
pls upgrade this library for android api 33 and more!!!
this is not work for me
Please migrate your apps to registerForActivityResult with PickVisualMedia:
https://developer.android.com/training/data-storage/shared/photopicker
I'm gonna archive this repo, because it does not make sense anymore to maintain nowadays.