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 custom overlay alpha (default=0.5F)
- Supported dynamic span count (default=2)
- Limit max item selection (default=1)
- Set Cancellable (default=true)
- Show file directory
- Show file size
BTC
1KFvFt3ZvGbxSZpz28XUiqzgWYmdvbaHvo
Image | Video | Audio |
---|---|---|
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")
}
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<Media>) {
// Do something here with selected files
}
},
onItemClickListener = object : OnItemClickListener {
override fun onClick(media: Media, position: Int, adapter: FilePickerAdapter) {
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();
Majid Arabi
Stargazers
Forkers