Features 😍
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
Latest Version :
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