Coder Social home page Coder Social logo

jasonbekolay / piximagepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from akshay2211/piximagepicker

0.0 0.0 0.0 16.5 MB

Pix is a Whatsapp image picker replica. with this, you can integrate an image picker just like WhatsApp.

License: Apache License 2.0

Kotlin 100.00%

piximagepicker's Introduction

Preview image

Pix (WhatsApp Style Image and Video Picker)

Pix is a WhatsApp image picker replica. with this you can integrate a image picker just like WhatsApp.

Android Weekly Google Dev Library Codacy Badge Pix Image Picker xscode

Demo

Usage

set configuration as

    val options = Options().apply{
        ratio = Ratio.RATIO_AUTO                                    //Image/video capture ratio
        count = 1                                                   //Number of images to restrict selection count
        spanCount = 4                                               //Number for columns in grid
        path = "Pix/Camera"                                         //Custom Path For media Storage
        isFrontFacing = false                                       //Front Facing camera on start
        videoDurationLimitInSeconds = 10                            //Duration for video recording
        mode = Mode.All                                             //Option to select only pictures or videos or both
        flash = Flash.Auto                                          //Option to select flash type
        preSelectedUrls = ArrayList<Uri>()                          //Pre selected Image Urls
    }

Ratio can be

  RATIO_4_3, RATIO_16_9, RATIO_AUTO

Mode to to select the media type can be as

  All, Picture, Video

Then pass this config to the pix fragment either via

     addPixToActivity(R.id.container, options) {
          when (it.status) {
              PixEventCallback.Status.SUCCESS -> //use results as it.data
              PixEventCallback.Status.BACK_PRESSED -> // back pressed called
          }
      }

or plain fragment can be retrieved via

private val pixFragment = pixFragment(options)

The results can be retrieved via the constructor callback from the fragment

    pixFragment(options){
        when (it.status) {
            PixEventCallback.Status.SUCCESS -> //use results as it.data
            PixEventCallback.Status.BACK_PRESSED -> // back pressed called
        }
    }

Or can be retrieved by anywhere in the Application from the state flow eventbus

    PixBus.results {
        when (it.status) {
             PixEventCallback.Status.SUCCESS ->  //use results as it.data
             PixEventCallback.Status.BACK_PRESSED -> // back pressed called
        }
    }

For detailed usage kindly refer to the below samples

Customise

Theme

include these items in colors.xml with custom color codes

<resources>
    <color name="video_counter_color_pix">#E53935</color>
    <color name="primary_color_pix">#075e54</color>
    <color name="primary_light_color_pix">#80075e54</color>
    <color name="surface_color_pix">#ffffff</color>
    <color name="text_color_pix">#807f7f</color>
</resources>

Thanks to

Backers

Become a backer and help us sustain our activities! ๐Ÿ™๐Ÿ™

Download

Download or grab via Gradle:

include in app level build.gradle

repositories {
   mavenCentral()
}
 implementation  'io.ak1.pix:piximagepicker:1.6.3'

or Maven:

<dependency>
  <groupId>io.ak1.pix</groupId>
  <artifactId>piximagepicker</artifactId>
  <version>1.6.3</version>
  <type>pom</type>
</dependency>

or ivy:

<dependency org='io.ak1.pix' name='piximagepicker' rev='1.6.3'>
  <artifact name='pix' ext='pom' ></artifact>
</dependency>

Find docs for old versions in wiki for 1.5.6 and 1.2.5

Also you can find the source for version 1.5.6 here.

License

Licensed under the Apache License, Version 2.0, click here for the full license.

Author & support

This project was created by Akshay Sharma.

If you appreciate my work, consider buying me a cup of โ˜• to keep me recharged ๐Ÿค˜ by PayPal

I love using my work and I'm available for contract work. Freelancing helps to maintain and keep my open source projects up to date!

piximagepicker's People

Contributors

akshay2211 avatar 73k05 avatar sabieber avatar marcauberer avatar abhinandansingh11 avatar ahmedcs2600 avatar diefferson avatar jasonbekolay avatar loic5 avatar praslnx8 avatar sajal-sploot avatar shobhitgupta1245 avatar codacy-badger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.