Home

Awesome

TedImagePicker Android Arsenal

TedImagePicker is simple/beautiful/smart image picker

Image SelectSelect AlbumScroller

</br></br>

Demo

Image SelectSelect AlbumScroller

</br></br>

Setup

Gradle

Maven Central


repositories {
  google()
  mavenCentral()
}

dependencies {
    implementation 'io.github.ParkSangGwon:tedimagepicker:x.y.z'
    //implementation 'io.github.ParkSangGwon:tedimagepicker:1.6.1'
}

If you think this library is useful, please press star button at upside. </br> <img src="https://phaser.io/content/news/2015/09/10000-stars.png" width="200">

</br></br>

How to use

1.Enable databinding

dataBinding {
    enabled = true
}

or

buildFeatures {
    dataBinding = true
}

2.Start TedImagePicker/TedRxImagePicker

Listener

Single image
TedImagePicker.with(this)
    .start { uri -> showSingleImage(uri) }
TedImagePicker.with(this)
        .start(new OnSelectedListener() {
            @Override
            public void onSelected(@NotNull Uri uri) {
                showSingleImage(uri);
            }
        });
TedImagePicker.with(this)
        .start(uri -> {
            showSingleImage(uri);
        });
Multi image
TedImagePicker.with(this)
    .startMultiImage { uriList -> showMultiImage(uriList) }
TedImagePicker.with(this)
        .startMultiImage(new OnMultiSelectedListener() {
            @Override
            public void onSelected(@NotNull List<? extends Uri> uriList) {
                showMultiImage(uriList);
            }
        });
TedImagePicker.with(this)
        .startMultiImage(uriList -> {
            showMultiImage(uriList);
        });
<br/>

RxJava

Single image
TedRxImagePicker.with(this)
    .start()
    .subscribe({ uri ->
    }, Throwable::printStackTrace)
Multi image
TedRxImagePicker.with(this)
    .startMultiImage()
    .subscribe({ uriList ->
    }, Throwable::printStackTrace)

</br></br>

Customize

Function

Common

FunctionDescription
mediaType(MediaType)MediaType.IMAGE / MediaType.VIDEO / MediaType.IMAGE_AND_VIDEO
cameraTileBackground(R.color.xxx)camera Tile Background Color
cameraTileImage(R.drawable.xxx)camera tile image
showCameraTile(Boolean) default trueshow camera tile
scrollIndicatorDateFormat(String) (default: YYYY.MM)Format of date on scroll indicator
showTitle(Boolean)(default: true)Show title
title(String or R.string.xxx) (default: 'Select Image','사진 선택')title
backButton(R.drawable.xxx)back button
zoomIndicator(Boolean) (default: true)zoom indicator
image()image
video()video
imageAndVideo()image and video
imageCountTextFormat(String) (default: %s): %s장, Count: %simage count text format
savedDirectoryName(String)saved directory name from take picture using camera
startAnimation(Int, Int)start animation
finishAnimation(Int, Int)finish animation
errorListener()error listener for error
cancelListener()cancel listener

Multi Select

MethodDescription
selectedUri(List<Uri>)selected uri
buttonGravity(ButtonGravity)You can change done button location top or bottom
buttonText(String or R.string.xxx) (default: 'Done','완료')you can change done button text
buttonBackground(R.drawable.xxx) (default: Blue Background)you can change done button background color
buttonTextColor(R.color.xxx) (default: white)done button text color
buttonDrawableOnly(R.drawable.xxx) (default: false)If you want show drawable button without text, use this method
max(Int, String or R.string.xxx)max content should picked from user device
min(Int, String or R.string.xxx)min content should picked from user device
drawerAlbum() / dropDownAlbum() (default: Drawer)You can choice Drawer or DropDown album style

</br></br>

UI

<color name="ted_image_picker_primary">#your_color_code</color>
<color name="ted_image_picker_primary_pressed">#your_color_code</color>

style list

<style name="TextAppearance.MyApp.Body1" parent="@style/TextAppearance.AppCompat.Body1">
    <item name="android:textSize">...</item>
    <item name="android:fontFamily">...</item>
</style>
<style name="TextAppearance.TedImagePicker.Body1" parent="@style/TextAppearance.MyApp.Body1" />

FAQ

- Do not need to check permissions?

- java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/databinding/DataBinderMapperImpl;

- Duplicate class android.support.v4.xxx: Execution failed for task ':app:checkDebugDuplicateClasses'

- I'm using targetSdkVersion less than 33 and it doesn't work

- I'm using targetSdkVersion less than 34 and it doesn't work

<uses-permission
    android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"
    tools:node="remove" />

</br></br>

License

Copyright 2019 Ted Park

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.```