• Stars
    star
    1,113
  • Rank 41,718 (Top 0.9 %)
  • Language
    Java
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

TedBottomPicker is simple image picker using bottom sheet

What is TedBottomPicker?

In Google's Material Design, Google introduce Bottom sheets.(Components – Bottom sheets)
Bottom sheets slide up from the bottom of the screen to reveal more content.

If you want pick image from gallery or take picture, this library can help easily.
TedBottomPicker provide 3 options:

  1. Take a picture by camera(using MediaStore.ACTION_IMAGE_CAPTURE intent)
  2. Get image from gallery(using Intent.ACTION_PICK intent)
  3. Get image from recent image(using MediaStore.Images.Media.EXTERNAL_CONTENT_URI cursor)

TedBottomPicker is simple image picker using bottom sheet.



TedImagePicker

  • If you want full screen image picker, use TedImagePicker
  • TedImagePicker is simple/beautiful/smart image picker

.



Demo

  1. Show Bottom Sheet.
  2. Pick Image

Single/Multi Select

Screenshot Screenshot
Screenshot

Setup

Gradle

Maven Central

dependencies {
    implementation 'gun0912.ted:tedbottompicker:x.y.z'
    //implementation 'gun0912.ted:tedbottompicker:2.0.1'
}

If you think this library is useful, please press star button at upside.


How to use

1. Check Permission

You have to grant WRITE_EXTERNAL_STORAGE permission from user.
If your targetSDK version is 23+, you have to check permission and request permission to user.
Because after Marshmallow(6.0), you have to not only declare permissions in AndroidManifest.xml but also request permissions at runtime.
There are so many permission check library in Android-Arsenal
I recommend TedPermission
TedPermission is super simple and smart permission check library.

2. Start TedBottomPicker

  • TedBottomPicker support RxJava and Listener style

RxJava

You have to use TedRxBottomPicker

  • Single image
        TedRxBottomPicker.with(MainActivity.this)
                 .show()
                 .subscribe(uri ->
                    // here is selected image uri
                 }, Throwable::printStackTrace);
  • Multi image
        
        TedRxBottomPicker.with(MainActivity.this)
                //.setPeekHeight(getResources().getDisplayMetrics().heightPixels/2)
                .setPeekHeight(1600)
                .showTitle(false)
                .setCompleteButtonText("Done")
                .setEmptySelectionText("No Select")
                .setSelectedUriList(selectedUriList)
                .showMultiImage()
                .subscribe(uris -> {
                   // here is selected image uri list
                }, Throwable::printStackTrace);



Listener

You have to use TedBottomPicker

  • Single image
        TedBottomPicker.with(MainActivity.this)
               .show(new TedBottomSheetDialogFragment.OnImageSelectedListener() {
                   @Override
                   public void onImageSelected(Uri uri) {
                     // here is selected image uri
                   }
               });
  • Multi image
        TedBottomPicker.with(MainActivity.this)
               .setPeekHeight(1600)
               .showTitle(false)
               .setCompleteButtonText("Done")
               .setEmptySelectionText("No Select")
               .setSelectedUriList(selectedUriList)
               .showMultiImage(new TedBottomSheetDialogFragment.OnMultiImageSelectedListener() {
                    @Override
                    public void onImagesSelected(List<Uri> uriList) {
                         // here is selected image uri list
                    }
              });

Customize

You can customize something ...

Function

Common

  • showVideoMedia() : Not only load image, but also load video
  • setPreviewMaxCount(Int) (default: 25)
  • setPeekHeight(Int)
  • setPeekHeightResId(R.dimen.xxx)
  • showCameraTile(Boolean) (default: true)
  • setCameraTile(R.drawable.xxx or Drawable)
  • setCameraTileBackgroundResId(R.color.xxx)
  • setGalleryTile(R.drawable.xxx or Drawable)
  • showGalleryTile(Boolean) (default: true)
  • setGalleryTileBackgroundResId(R.color.xxx)
  • setSpacing(Int)
  • setSpacingResId(R.dimen.xxx)
  • setOnErrorListener(OnErrorListener)
  • setTitle(String or R.string.xxx) (default: 'Select Image','사진 선택')
  • showTitle(Boolean) (default: true)
  • setTitleBackgroundResId(R.color.xxx)
  • setImageProvider(ImageProvider) : If you want load grid image yourself, you can use your ImageProvider

Single Select

  • setSelectedUri(Uri)

Multi Select

  • setDeSelectIcon(R.drawable.xxx or Drawable)
  • setSelectedForeground(R.drawable.xxx or Drawable)
  • setSelectMaxCount(Int)
  • setSelectMinCount(Int)
  • setCompleteButtonText(String or R.string.xxx) (default: 'Done','완료')
  • setEmptySelectionText(String or R.string.xxx) (default: 'No Image','이미지가 선택되지 않았습니다')
  • setSelectMaxCountErrorText(String or R.string.xxx)
  • setSelectMinCountErrorText(String or R.string.xxx)
  • setSelectedUriList(ArrayList<Uri>)



Thanks

  • Flipboard-bottomsheet - Android component which presents a dismissible view from the bottom of the screen



License

Copyright 2017 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.```

More Repositories

1

TedPermission

Easy check permission library for Android Marshmallow
Java
1,740
star
2

TedImagePicker

TedImagePicker is simple/beautiful/smart image picker
Kotlin
538
star
3

TedPicker

Multiple image select library for Android. Take a picture or Select from gallary
Java
278
star
4

TedNaverMapClustering

네이버지도용 클러스터 유틸리티 라이브러리
Kotlin
165
star
5

TedKeyboardObserver

TedKeyboardObserver is keyboard's visibility observer
Kotlin
99
star
6

TedDataBindingSample

Java
90
star
7

TedAdHelper

[Android]Mediation advertise helper for ADMOB,FACEBOOK - Support Native, Banner, Backpress Dialog, Front AD
Java
83
star
8

GifProgressSample

Java
69
star
9

ClearEditText

Java
58
star
10

ProductFlavorSample

Java
55
star
11

IncomingCallMarketBroadcastReceiver

Java
52
star
12

DLog

Java
48
star
13

Introduce

박상권 소개
43
star
14

GoogleMapCustomMarker

Java
41
star
15

UpdateCheck

Java
40
star
16

TedAdmobDialog

[Android]BackPress Ad Dialog for Admob
Java
37
star
17

TedOnActivityResult

StartActivityForResult() / OnActivityResult() using Coroutine/RxJava
Java
34
star
18

TedPaletteSample

Java
22
star
19

BuildTimeSpeedUpSample

Java
21
star
20

KakaoLogin

Java
19
star
21

TedUtil

Useful util class for android
Java
17
star
22

TedDynamicLinkSample

Java
17
star
23

ObjectUtils

Java
15
star
24

NoMoreApplicationForLibraryModule

Kotlin
14
star
25

TedDeepLinkSample

Kotlin
13
star
26

RangeBarChart

A powerful 🚀 Android range bar chart library as well as scaling, panning and animations.
Kotlin
12
star
27

EnumRetrofitSample

Kotlin
7
star
28

StartActivitySample

Kotlin
3
star
29

IntervalTimePicker

IntervalTimePicker can control interval of minutes using TimePicker.
Kotlin
3
star
30

OSSRH-69704

1
star