• Stars
    star
    1,039
  • Rank 42,548 (Top 0.9 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created over 7 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Image Picker for Android πŸ€–

Android Image Picker

No config yet highly configurable image picker for Android

Android Arsenal - ImagePicker jitpack - android image picker

Screenshot

Click to see how image picker looks…

Download

Add this to your project's build.gradle

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

And add this to your module's build.gradle

dependencies {
    implementation 'com.github.esafirm:android-image-picker:x.y.z'
}

change x.y.z to version in the release page

Usage

For full example, please refer to the sample app.

Also you can browse the issue labeled as question here

Start image picker activity

The simplest way to start

val launcher = registerImagePicker {
    // handle result here
}

launcher.launch()

Complete features of what you can do with ImagePicker

val config = ImagePickerConfig {
    mode = ImagePickerMode.SINGLE // default is multi image mode
    language = "in" // Set image picker language
    theme = R.style.ImagePickerTheme

    // set whether pick action or camera action should return immediate result or not. Only works in single mode for image picker
    returnMode = if (returnAfterCapture) ReturnMode.ALL else ReturnMode.NONE

    isFolderMode = folderMode // set folder mode (false by default)
    isIncludeVideo = includeVideo // include video (false by default)
    isOnlyVideo = onlyVideo // include video (false by default)
    arrowColor = Color.RED // set toolbar arrow up color
    folderTitle = "Folder" // folder selection title
    imageTitle = "Tap to select" // image selection title
    doneButtonText = "DONE" // done button text
    limit = 10 // max images can be selected (99 by default)
    isShowCamera = true // show camera or not (true by default)
    savePath = ImagePickerSavePath("Camera") // captured image directory name ("Camera" folder by default)
    savePath =
        ImagePickerSavePath(Environment.getExternalStorageDirectory().path, isRelative = false) // can be a full path

    excludedImages = images.toFiles() // don't show anything on this selected images
    selectedImages = images  // original selected images, used in multi mode
}

If you want to call it outside Activity or Fragment, you can get the Intent with createImagePickerIntent

Please note: handling in onActivityResult is not recommended since it's already deprecated in favor of the new result API

val intent = createImagePickerIntent(context, ImagePickerConfig())
startActivityForResult(intent, RC_IMAGE_PICKER)

Receive result

when you're done picking images, result will be returned on launcher callback with type List<Image>. This list cannot be null but can be empty

val launcher = registerImagePicker { result: List<Image> ->
    result.forEach { image ->
        println(image)
    }
}    

Camera Only

Use CameraOnlyConfig instead of ImagePickerConfig

val launcher = registerImagePicker { }
launcher.launch(CameraOnlyConfig())

You also still can use the DefaultCameraModule but discouraged to do it.

Wiki

Version 2.x.x

If you still use the previous version, you can check 2.x branch in here

Support Me!

I would make myself more commited to this repo and OSS works in general.

Would you help me achieving this goals?

Buy Me a Coffee at ko-fi.com

Credits

License

MIT @ Esa Firman

More Repositories

1

RxDownloader

An Rx wrapper for Download Manager in Android
Java
108
star
2

universal-router

↩️ Router for every occasions
Kotlin
71
star
3

compose-ui-book

UI Component Explorer for Android
Kotlin
67
star
4

gadb

ADB replacement with enhanced and more features
Go
37
star
5

android-rxgeofence

Rx wrapped GeoFence library πŸ‘Š
Java
32
star
6

skrape

Kotlin DSL to scrape HTML and convert it to JSON
Kotlin
29
star
7

generator-android-conductor

πŸ€– I generate some code .... beep beep
Kotlin
17
star
8

AdapterDelegates-ListView

Based on https://github.com/sockeqwe/AdapterDelegates." Favor composition over inheritance" for ListView
Java
15
star
9

okmock

🀑 HTTP Interceptor for mocking Android (OkHttp) and Flutter (Dio) request.
Kotlin
15
star
10

bangkit-image-classifier-example

Image classifier example using TFlite for Bangkit
Kotlin
15
star
11

android-conductor-boilerplate

Boilerplate code for ➑️ https://github.com/esafirm/generator-android-conductor
Kotlin
13
star
12

sopi

Shopee image downloader
JavaScript
11
star
13

android-playground

Playground for Android related code 🐸
Kotlin
10
star
14

Open-SmartCity-Jakarta

API for data like http://smartcity.jakarta.go.id
JavaScript
10
star
15

karma

∞ An opinionated MVI pattern enabler for Android
Kotlin
9
star
16

compose-ai-chat

AI Chat Bot application like ChatGPT that (supposedly) can change its model
Kotlin
8
star
17

vscode-kotlin-formatter

Kotlin Formatter for VSCode
TypeScript
6
star
18

android-stubutton

Simple Slide to Unlock Button
Java
5
star
19

dotfiles

.* 😎
Shell
4
star
20

Android-ReactiveGPlus

Chain that shit (Read: Google Plus from Google Play Service API) up!
Java
4
star
21

react-kalkulatornilai

PWA sample using Create React App and React Native Web
JavaScript
4
star
22

react-universal-firebase-sample

Using CRA and React Native Web to create multi platform application
JavaScript
4
star
23

android-cleaning-service

Automate cleaning resources in your Android project
Kotlin
3
star
24

firebase-fireup

CLI app to upload and manage your Firebase Storage objects
Python
3
star
25

androidcommon

Personal set of Android utility class
Java
3
star
26

TonTon

Swipe right to Ta'aruf
Kotlin
3
star
27

React-Native-Intro

Demo app for "Introduction to React Native" talk
JavaScript
3
star
28

talks-codes

A collection of companion code for my talks and blog posts
Kotlin
3
star
29

adonis-simple-rest-api

Simpel REST API with Adonis.Js
JavaScript
3
star
30

stiker

Image Editor Library for Android
Kotlin
3
star
31

jacoco-essence

Tool to extract Jacoco data for CI usage or anything else
Kotlin
3
star
32

OkHttp-Cache-Sample

Sample for how you can rewrite cache control for your profit
Kotlin
2
star
33

jsoup-example

Code example for http://nolambda.stream/html-parsing-with-jsoup/
Kotlin
2
star
34

kotlin-playground

πŸ”¬ Collections of my Kotlin experiment
Kotlin
2
star
35

vivovera-cli

Absen with πŸ‘“ written in TypeScript
TypeScript
1
star
36

guard-report

Proguard and Dexguard Shrinking Reporter
JavaScript
1
star
37

python-twitter-data-mining

Python
1
star
38

dockerimages

My docker image collections
Dockerfile
1
star
39

Repo

Repo - React Portofolio
JavaScript
1
star
40

conductor-extra

Extra niceties for Conductor
Kotlin
1
star
41

Lie-Detector

For fun only app
Java
1
star
42

android-firebase-draw

Firebase powered collaborative drawing app
Java
1
star
43

Chucker

Kotlin
1
star
44

realtime-kt

Supabase realtime client
Kotlin
1
star
45

js-firebase-terminal-chat

My attempt to make a CLI based chat client using Firebase and Typescript.
JavaScript
1
star
46

StateSubject

BehaviourSubject wrapper to behave like LiveData
Java
1
star
47

flutter_commitstrip

Dart
1
star
48

heroku-ytdl

Youtube Downloader written in Typescript, hosted on Heroku
HTML
1
star
49

pestisida

Crash and Bug Reporter for Android
Kotlin
1
star
50

flutter-sample-heroes

Learning flutter by make an app out of it πŸ’ͺ
Dart
1
star
51

skydu-bootcamp-samples

Contain samples from Skydu bootcamp
Kotlin
1
star
52

android-artifactory-sample

Sample code to get thing started with Artifactory
Java
1
star