Step 1: Create your own FileProvider

Step 2: Implement the callback handler

The caller Activity or Fragment has to implement BottomSheetImagePicker.OnImagesSelectedListener to receive the selection callbacks. It will automatically be used by the image picker. No need to register a listener.

You can set a requestTag in the builder. This is useful when you need to show more than one picker on the same page. You will receive this tag as tag parameter in the callback.

Step 3: Create the image picker using the Builder

The setters are all optional and the builder will fallback to default values.

single select

Kotlin

BottomSheetImagePicker.Builder(getString(R.string.file_provider))
.cameraButton(ButtonType.Button) //style of the camera link (Button in header, Image tile, None)
.galleryButton(ButtonType.Button) //style of the gallery link
.singleSelectTitle(R.string.pick_single) //header text
.peekHeight(R.dimen.peekHeight) //peek height of the bottom sheet
.columnSize(R.dimen.columnSize) //size of the columns (will be changed a little to fit)
.requestTag("single") //tag can be used if multiple pickers are used
.show(supportFragmentManager)

multi select

Kotlin

BottomSheetImagePicker.Builder(getString(R.string.file_provider))
.multiSelect(3, 6) //user has to select 3 to 6 images
.multiSelectTitles(
R.plurals.pick_multi, //"you have selected <count> images
R.plurals.pick_multi_more, //"You have to select <min-count> more images"
R.string.pick_multi_limit //"You cannot select more than <max> images"
)
.peekHeight(R.dimen.peekHeight) //peek height of the bottom sheet
.columnSize(R.dimen.columnSize) //size of the columns (will be changed a little to fit)
.requestTag("multi") //tag can be used if multiple pickers are used
.show(supportFragmentManager)