Closed NavjotSinghSeraphic closed 1 month ago
Hi @NavjotSinghSeraphic
Thank you for bringing this up. I understand that you want to select more than 15 images. In our demo, the maximum selection count is set to 15 by default. However, you can easily customize this limit when implementing the image picker in your application.
You can adjust the maxCount parameter as shown in the following code snippet to set the selection limit to any value you need:
imagePicker
.title("My Picker")
.multipleSelection(enable = true, maxCount = 5) // Customize maxCount here
.showCountInToolBar(false)
.showFolder(true)
.cameraIcon(true)
.doneIcon(true)
.allowCropping(true)
.compressImage(false)
.maxImageSize(2)
.extension(PickExtension.JPEG)
imagePicker.open(PickerType.GALLERY)
Feel free to adjust the maxCount to suit your needs.
If you have any further questions or need additional assistance, don't hesitate to reach out!
@Aayush-Sarikhada Thanks for replying i am getting crash if i am changed the count value up- to 15
companion object {
fun default(): PickerOptions {
return PickerOptions(
pickerType = PickerType.GALLERY,
showCountInToolBar = true,
showFolders = true,
allowMultipleSelection = false,
maxPickCount = 20,
maxPickSizeMB = 2.5f,
pickExtension = PickExtension.ALL,
showCameraIconInGallery = true,
isDoneIcon = true,
openCropOptions = false,
openSystemPicker = false,
compressImage = false
)
}
}
}
@NavjotSinghSeraphic,
Thank you for the update. The error you're encountering is likely due to the fact that the value you're providing is outside the defined range of the slider, which is set between 1.0 and 15.0 by default.
To resolve this, please navigate to the PickerOptionsBottomSheet.kt file in the demo project. Then, search for pickCountSlider.valueTo and change its value to match the maximum value you want to set for image selection.
NOTE: Please understand that you're making these changes in the demo, which is intended to showcase what the library can do. When you integrate our library into your actual application, you can customize parameters like maxCount according to your specific needs. You can check our readme.md file to further understand the functioning of our library.
Let me know if you need any further assistance, and please update me on whether your issue has been resolved so I can close the issue.
@Aayush-Sarikhada Thank you for replying. I can't change the max value in the library, it's the only readable file in my app so how can I change this value If I change this value I am facing a crash, I have already sent a screen shot above
@NavjotSinghSeraphic
Actually you are not supposed to change the constant MAX_PICK_LIMIT
. Are you trying to use the function multipleSelection(enable: Boolean)? If yes then please use the overloaded function which has one more parameter called maxCount
. This function is also visible in your ScreenShot as well
@Aayush-Sarikhada
private fun openGalley() {
imagePicker
.title("Gallery")
.multipleSelection(enable = true, maxCount = 20)
.showCountInToolBar(true)
.showFolder(true)
.cameraIcon(false)
.doneIcon(true)
.allowCropping(false)
.compressImage(false)
.maxImageSize(2.5f)
.extension(PickExtension.ALL)
if (HelperUtils.isAtLeast11()) {
imagePicker.systemPicker(true)
}
imagePicker.open(PickerType.GALLERY)
}
i have already done this but i am getting crash because `library` not allowed to apply range up to 15
@Aayush-Sarikhada kindly you need to change your slider range and maxCount limit in library, thanks
Hello @NavjotSinghSeraphic
I have checked from my side and found no issue with the library. here I am attaching a code snippet where I am passing maxCount as 25 and also attaching a video demo for the same. please check.
private fun openImagePicker() {
imagePicker
.title("My Picker")
.multipleSelection(pickerOptions.allowMultipleSelection, 25) // maxCount = 25
.showCountInToolBar(pickerOptions.showCountInToolBar)
.showFolder(pickerOptions.showFolders)
.cameraIcon(pickerOptions.showCameraIconInGallery)
.doneIcon(pickerOptions.isDoneIcon)
.allowCropping(pickerOptions.openCropOptions)
.compressImage(pickerOptions.compressImage)
.maxImageSize(pickerOptions.maxPickSizeMB)
.extension(pickerOptions.pickExtension)
if (isAtLeast11()) {
imagePicker.systemPicker(pickerOptions.openSystemPicker)
}
imagePicker.open(pickerOptions.pickerType)
}
https://github.com/user-attachments/assets/d6ea1c0e-4f34-4a80-9a10-a4de8385697b
@Aayush-Sarikhada thanks its working thanks a lot
Hi @NavjotSinghSeraphic,
You're welcome! I'm glad the issue is resolved. Thank you for trying out our library. If you found it helpful, please consider giving it a star on GitHub—we'd really appreciate it!
Is your feature request related to a problem? Please describe. we want to select more than 15 image
Describe the solution you'd like can you change select image range up-to 20 to 30
Describe alternatives you've considered no alternative now we need to choose 20 image
Additional context