/AndroidFilePicker

Android Image, Video and Audio Picker

Primary LanguageKotlinApache License 2.0Apache-2.0

Latest release Code size in bytes Stars Downloads API ktlint License

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 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

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