All Projects → kroegerama → Bottomsheet Imagepicker

kroegerama / Bottomsheet Imagepicker

Licence: apache-2.0
Modern image picker for Android

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Bottomsheet Imagepicker

Opalimagepicker
A multiple image picker for iOS, written in Swift
Stars: ✭ 165 (-38.2%)
Mutual labels:  image, picker, imagepicker
Picker
Picker - A CameraX based WhatsApp Style Image-Video Picker
Stars: ✭ 69 (-74.16%)
Mutual labels:  image, picker, imagepicker
Louvre
A small customizable library useful to handle an gallery image pick action built-in your app. 🌄🌠
Stars: ✭ 629 (+135.58%)
Mutual labels:  library, image, picker
Ypimagepicker
📸 Instagram-like image picker & filters for iOS
Stars: ✭ 3,661 (+1271.16%)
Mutual labels:  library, picker, imagepicker
Ambient
Lightweight ambient light javascript library for HTML image and video elements
Stars: ✭ 20 (-92.51%)
Mutual labels:  library, image
Handright
A lightweight Python library for simulating Chinese handwriting
Stars: ✭ 634 (+137.45%)
Mutual labels:  library, image
Silicompressor
A powerful, flexible and easy to use Video and Image compression library for Android.
Stars: ✭ 1,081 (+304.87%)
Mutual labels:  library, image
Isobmff
C++ Library for ISO/IEC 14496-12 - ISO Base Media File Format (QuickTime, MPEG-4, HEIF, etc)
Stars: ✭ 157 (-41.2%)
Mutual labels:  library, image
React Native Blurhash
🖼️ A library to show colorful blurry placeholders while your content loads.
Stars: ✭ 430 (+61.05%)
Mutual labels:  library, image
Datepicker
A Date Picker with Calendar for iPhone and iPad Apps.
Stars: ✭ 103 (-61.42%)
Mutual labels:  library, picker
Landscapist
🍂 Jetpack Compose image loading library which can fetch and display network images using Glide, Coil, and Fresco.
Stars: ✭ 264 (-1.12%)
Mutual labels:  library, image
Fabulousfilter
Android library to animate Floating Action Button to Bottom Sheet Dialog and vice-versa
Stars: ✭ 2,477 (+827.72%)
Mutual labels:  library, bottomsheet
Linear Time Picker
Gorgeous Android Time and Date picker library inspired by the Timely app
Stars: ✭ 613 (+129.59%)
Mutual labels:  library, picker
Imageviewer.swift
An easy to use Image Viewer that is inspired by Facebook
Stars: ✭ 1,071 (+301.12%)
Mutual labels:  library, image
Jvedio
Windows desktop application to manage local video;Support baidu AI, youdao translation;Support FFMPEG video processing;Support multi-database management and statistics;Support skin switching
Stars: ✭ 545 (+104.12%)
Mutual labels:  library, image
Belvedere
An image picker library for Android
Stars: ✭ 122 (-54.31%)
Mutual labels:  library, picker
Ptimagealbumviewcontroller
"Image Album" — or "Photo Album" if you like that better — View( Controller) for all crazy iOS developers out there...
Stars: ✭ 199 (-25.47%)
Mutual labels:  library, image
Slideimageview
Simple and convenient library that allows you to slide images through a view.
Stars: ✭ 227 (-14.98%)
Mutual labels:  library, image
XGImagePickerController
iOS相册图片/视频选择器
Stars: ✭ 32 (-88.01%)
Mutual labels:  picker, imagepicker
Ptshowcaseviewcontroller
An initial implementation of a "showcase" view( controller) for iOS apps... Visualizes images, videos and PDF files beautifully! (by @pittleorg) [meta: image, photo, video, document, pdf, album, gallery, showcase, gallery, iOS, iPhone, iPad, component, library, viewer]
Stars: ✭ 395 (+47.94%)
Mutual labels:  library, image

Release Build Status

BottomSheet Image Picker for Android

A modern image picker implemented as BottomSheet.

Single Selection Demo 1Single Selection Demo 2Multi Selection Demo 1

Features

  1. select single/multiple images right in the bottom sheet
  2. use camera to take a picture
  3. choose image from gallery app
  4. handles all permission requests

This library is based on BSImagePicker. I reimplemented everything in Kotlin and added some features. Also, I used the new androidX artifacts.

How to Use

Minimum SDK: 17

Add to Project

First make sure jitpack is included as a repository in your project's build.gradle:

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

And then add the below to your app's build.gradle:

    implementation 'com.kroegerama:bottomsheet-imagepicker:<version>'

Step 1: Create your own FileProvider

Just follow the guide from Official Android Document. See the demo application file_paths.xml and AndroidManifest.xml.

Step 2: Implement the callback handler

The caller Activity or Fragment has to implement BottomSheetImagePicker.OnImagesSelectedListener to receive the selection callbacks. It will automatically be used by the image picker. No need to register a listener.

Kotlin
class AcMain: BaseActivity(), BottomSheetImagePicker.OnImagesSelectedListener {
    //...

    override fun onImagesSelected(uris: List<Uri>, tag: String?) {
        toast("Result from tag: $tag")

        imageContainer.removeAllViews()
        uris.forEach { uri ->
            val iv = LayoutInflater.from(this).inflate(R.layout.scrollitem_image, imageContainer, false) as ImageView
            imageContainer.addView(iv)
            Glide.with(this).load(uri).into(iv)
        }
    }
}
Java
public class AcMainJava extends BaseActivity implements BottomSheetImagePicker.OnImagesSelectedListener {
    //...
    
    @Override
    public void onImagesSelected(@NotNull List<? extends Uri> uris, @Nullable String tag) {
        imageContainer.removeAllViews();
        for (Uri uri : uris) {
            ImageView iv = (ImageView) LayoutInflater.from(this).inflate(R.layout.scrollitem_image, imageContainer, false);
            imageContainer.addView(iv);
            Glide.with(this).load(uri).into(iv);
        }
    }
}

You can set a requestTag in the builder. This is useful when you need to show more than one picker on the same page. You will receive this tag as tag parameter in the callback.

Step 3: Create the image picker using the Builder

The setters are all optional and the builder will fallback to default values.

single select

Kotlin
    BottomSheetImagePicker.Builder(getString(R.string.file_provider))
        .cameraButton(ButtonType.Button)            //style of the camera link (Button in header, Image tile, None)
        .galleryButton(ButtonType.Button)           //style of the gallery link
        .singleSelectTitle(R.string.pick_single)    //header text
        .peekHeight(R.dimen.peekHeight)             //peek height of the bottom sheet
        .columnSize(R.dimen.columnSize)             //size of the columns (will be changed a little to fit)
        .requestTag("single")                       //tag can be used if multiple pickers are used
        .show(supportFragmentManager)
Java
    new BottomSheetImagePicker.Builder(getString(R.string.file_provider))
       .cameraButton(ButtonType.Button)
       .galleryButton(ButtonType.Button)
       .singleSelectTitle(R.string.pick_single)
       .peekHeight(R.dimen.peekHeight)
       .columnSize(R.dimen.columnSize)
       .requestTag("single")
       .show(getSupportFragmentManager(), null);

multi select

Kotlin
    BottomSheetImagePicker.Builder(getString(R.string.file_provider))
        .multiSelect(3, 6)                  //user has to select 3 to 6 images
        .multiSelectTitles(
            R.plurals.pick_multi,           //"you have selected <count> images
            R.plurals.pick_multi_more,      //"You have to select <min-count> more images"
            R.string.pick_multi_limit       //"You cannot select more than <max> images"
        )
        .peekHeight(R.dimen.peekHeight)     //peek height of the bottom sheet
        .columnSize(R.dimen.columnSize)     //size of the columns (will be changed a little to fit)
        .requestTag("multi")                //tag can be used if multiple pickers are used
        .show(supportFragmentManager)
Java
    new BottomSheetImagePicker.Builder(getString(R.string.file_provider))
        .multiSelect(3, 6)
        .multiSelectTitles(
                R.plurals.pick_multi,
                R.plurals.pick_multi_more,
                R.string.pick_multi_limit
        )
        .peekHeight(R.dimen.peekHeight)
        .columnSize(R.dimen.columnSize)
        .requestTag("multi")
        .show(getSupportFragmentManager(), null);

The image picker works in activities and fragments

Kotlin
    //inside activity
        .show(supportFragmentManager)
    //inside fragment
        .show(childFragmentManager)
Java
    //inside activity
        .show(getSupportFragmentManager(), null);
    //inside fragment
        .show(getChildFragmentManager(), null);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].