😎
Simple, Powerful and Beautiful Android Image/Video/Audio Picker Features
- No need check storage permission
😉 - Single and multiple selection
- Supported RTL and LTR list direction (default=LTR)
- Supported image, video or audio (default=image)
- Supported custom title
- Supported custom colors
- Supported dynamic span count (default=2)
- Limit max item selection (default=1)
- Show file directory
- Show file size
Screenshots
Image | Video | Audio |
---|---|---|
Download
Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.majidarabi:AndroidFilePicker:$LATEST_VERSION'
}
Usage
Kotlin
showFilePicker(
limitItemSelection = 5,
listDirection = ListDirection.RTL,
accentColor = ContextCompat.getColor(this@MainActivity, R.color.purple_700),
titleTextColor = ContextCompat.getColor(this@MainActivity, R.color.purple_700),
onSubmitClickListener = object : OnSubmitClickListener {
override fun onClick(files: List) {
// Do something here with selected files
}
},
onItemClickListener = object : OnItemClickListener {
override fun onClick(media: Media, position: Int, adapter: ItemAdapter) {
if (!media.file.isDirectory) {
adapter.setSelected(position)
}
}
}
)
Java
new FilePicker.Builder(this)
.setLimitItemSelection(3)
.setAccentColor(Color.CYAN)
.setCancellable(false)
.setOnSubmitClickListener(files -> {
// Do something here with selected files
})
.setOnItemClickListener((media, pos, adapter) -> {
if (!media.getFile().isDirectory()) {
adapter.setSelected(pos);
}
})
.buildAndShow();
Author
Majid Arabi