All Projects β†’ ChiliLabs β†’ Chiliphotopicker

ChiliLabs / Chiliphotopicker

Licence: apache-2.0
Photo picker library for android. Let's you pick photos directly from files, or navigate to camera or gallery.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Chiliphotopicker

Ypimagepicker
πŸ“Έ Instagram-like image picker & filters for iOS
Stars: ✭ 3,661 (+999.4%)
Mutual labels:  library, image-picker
Flutter circular chart
Animated radial and pie charts for Flutter
Stars: ✭ 330 (-0.9%)
Mutual labels:  library
File
The Hoa\File library.
Stars: ✭ 322 (-3.3%)
Mutual labels:  library
Ccxt
A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
Stars: ✭ 22,501 (+6657.06%)
Mutual labels:  library
Kiimagepager
The KIImagePager is inspired by foursquare's ImageSlideshow, the user may scroll through images loaded from the Web
Stars: ✭ 324 (-2.7%)
Mutual labels:  library
Easyvalidation
βœ”οΈ A text and input validation library in Kotlin for Android
Stars: ✭ 328 (-1.5%)
Mutual labels:  library
Tintlayout
This library help you to achieve popular drop shadow effect from view.
Stars: ✭ 322 (-3.3%)
Mutual labels:  library
Shortcode
Advanced shortcode (BBCode) parser and engine for PHP
Stars: ✭ 331 (-0.6%)
Mutual labels:  library
Metrics Clojure
A thin façade around Coda Hale's metrics library.
Stars: ✭ 330 (-0.9%)
Mutual labels:  library
Unstated Next
200 bytes to never think about React state management libraries ever again
Stars: ✭ 3,784 (+1036.34%)
Mutual labels:  library
Clojure.java Time
Java 8 Date-Time API for Clojure
Stars: ✭ 323 (-3%)
Mutual labels:  library
Structopt
Parse command line arguments by defining a struct
Stars: ✭ 323 (-3%)
Mutual labels:  library
Crashreporter
CrashReporter is a handy tool to capture app crashes and save them in a file.
Stars: ✭ 327 (-1.8%)
Mutual labels:  library
Mirror
Easy reflection for Java and Android
Stars: ✭ 324 (-2.7%)
Mutual labels:  library
Secure Storage Android
Store strings & credentials securely encrypted on your device
Stars: ✭ 333 (+0%)
Mutual labels:  library
Tensorflow Windows Wheel
Tensorflow prebuilt binary for Windows
Stars: ✭ 3,428 (+929.43%)
Mutual labels:  library
Reproc
A cross-platform (C99/C++11) process library
Stars: ✭ 325 (-2.4%)
Mutual labels:  library
Cordova Plugin Device
Apache Cordova Plugin device
Stars: ✭ 327 (-1.8%)
Mutual labels:  library
Iterator
The Hoa\Iterator library.
Stars: ✭ 333 (+0%)
Mutual labels:  library
Swift Ui Animation Components And Libraries
Swift UI libraries, iOS components and animations by @Ramotion
Stars: ✭ 3,455 (+937.54%)
Mutual labels:  library

ChiliPhotoPicker

Made with ❀️ by Chili Labs.

Library made without DataBinding, RxJava and image loading libraries, to give you opportunity to use it without additional dependencies.

  • Picker styled as bottom sheet dialog
  • Could be used for single or multiple photos pick
  • Allows to choose how images are loaded into ImageView
  • Takes responsibility for all needed permissions
  • Takes responsibility for fetching gallery/camera result
  • Have two built-in themes - Light and Dark
  • Easy custamizable
No permission Single choice Multiple choice

Setup

Gradle:

Add Jitpack to your root build.gradle file:

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

Add dependency to application build.gradle file, where x.y.z is the latest release version:

implementation "com.github.ChiliLabs:ChiliPhotoPicker:x.y.z"

Usage

Initialize ChiliPhotoPicker in your Application's class onCreate

  • loader - your preferred ImageLoader implementation (ready examples for Glide and Picasso are here)
  • authority - your file provider authority. Is needed if you set allowCamera to true, so picker could store temporary photo from camera
ChiliPhotoPicker.init(
        loader = GlideImageLoader(),
        authority = "lv.chi.sample.fileprovider"
    )

Create new instance of PhotoPickerFragment

  • multiple - true for multiple image pick, false for single
  • allowCamera - true to show Camera button, false to hide
  • maxSelection - limit images count to pick
  • theme - built-in or custom theme (by default ChiliPhotoPicker.Light is used)
  • Show as dialog
PhotoPickerFragment.newInstance(
        multiple = true, 
        allowCamera = true,
        maxSelection = 5,
        theme = R.style.ChiliPhotoPicker_Dark
).show(supportFragmentManager, YOUR_TAG)

Notes: Picker will throw exception if:

  • loader was not initialized
  • authority was null while accessing camera

ImageLoader

We don't want to depend on many image loading libraries, so we have simple ImageLoader interface, which you can implement using your preferred library (Glide, Picasso, Coil, etc.) We have two working examples of ImageLoader implementations - using Glide and Picasso. You can just copy one of them or write your own implementation

Callback

Picked photos URIs are returned via callbacks onImagesPicked function, so you just need to implement PhotoPickerFragment.Callback interface in your activity or fragment

Themes

To customize picker you can use one of built-in themes or inherit it rewriting attributes you want (see example)

Attributes:

  • pickerBackgroundColor - background color
  • pickerPrimaryColor - primary picker color (no permission/empty texts, cancel icon)
  • pickerSecondaryColor - secondary picker color (snackbar)
  • pickerControlColor - color of buttons, icons, checkboxes, ripple
  • pickerGalleryIcon - drawable for Gallery icon (to remove it use @null as attribute value)
  • pickerCameraIcon - drawable for Camera icon (to remove it use @null as attribute value)
  • pickerCornerRadius - background's corners radius
  • pickerDividerColor - color of line below Gallery/Camera buttons

Localization

It's difficult to translate library to each language, so default strings are on English, but you can easily override them. Example for common strings and plurals are here. All strings used in library can be found here

License

Copyright 2019 Chili Labs

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