MajidArabi / AndroidFilePicker

Android Image, Video and Audio Picker
Apache License 2.0
61 stars 11 forks source link
android android-library audio-picker-android bottomsheet filepicker-library image-picker-android java kotlin kotlin-android library video-picker-android

Latest release Code size in bytes Stars Downloads API ktlint License

Simple, Powerful and Beautiful Android Image/Video/Audio Picker 😎

Features 😍

Donate

BTC

     1KFvFt3ZvGbxSZpz28XUiqzgWYmdvbaHvo

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

Latest Version : Latest release

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<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();

Author

Majid Arabi

Thanks for your support !

Stargazers

Stargazers repo roster for @MajidArabi/AndroidFilePicker

Forkers

Forkers repo roster for @MajidArabi/AndroidFilePicker