• Stars
    star
    863
  • Rank 52,844 (Top 2 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated 3 months ago

Reviews

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

Repository Details

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

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!

More Repositories

1

BubbleTabBar

BubbleTabBar is a bottom navigation bar with customizable bubble-like tabs
Kotlin
752
star
2

Oblique

With Oblique explore new styles of displaying images
Java
652
star
3

MusicWave

With MusicWave represent your Sound in a gradient colored Visualization
Java
567
star
4

DrawBox

DrawBox is a multi-purpose tool to draw anything on canvas, written completely on jetpack compose.
Kotlin
303
star
5

Paper

A minimal notes application in Jetpack Compose with MVVM architecture. Built with components like DataStore, Coroutines, ViewModel, LiveData, Room, Navigation-Compose, Coil, koin etc.
Kotlin
176
star
6

NYTimes-Compose

An offline-first application in Jetpack Compose with MVVM architecture, representing a minimalistic implementation of Top Stories API.
Kotlin
126
star
7

Ariana

Provide Multiple Gradients in ImageViews and Texts. Integrate with ViewPager to change colors dynamically.
Java
79
star
8

Stash

This Library allows you to store custom objects and arrrayLists in SharedPreference just like you store string and int.
Java
68
star
9

Cue

Library to create fully customizable Bootstrap styled alerts
Java
51
star
10

Numpad

Numpad is light weight library for multipurpose usage in numaric input
Java
44
star
11

PixEditor

PixEditor is a Whatsapp image Editor replica. with this, you can integrate an image editor just like WhatsApp.
Kotlin
16
star
12

JetAlarm

Alarm Application on android compose
Kotlin
14
star
13

akshay2211.github.io

Akshay Sharma Portfolio
HTML
12
star
14

akshay2211

readme
8
star
15

rang-vikalp

Simple Color picker in Jetpack Compose
Kotlin
8
star
16

ImgurSearchSample

Android Application sample based on Mvvm, Koin, LiveData, Paging, Room & Coroutines
Kotlin
7
star
17

UserList

Android Application sample in Compose which follows SSOT concept and demonstrate the power of Paging
Kotlin
6
star
18

LineUp

Todo list app (on going Project )
Kotlin
6
star
19

splice

sorting alogs
Vue
5
star
20

android-ui-libraries

List of UI/UX & Utility Libraries and Components for Android
CSS
3
star
21

Huddle

Kotlin
3
star
22

Stamps

Kotlin
2
star
23

pexels-api

Kotlin
1
star
24

Profiler

Profiler is a dynamic banner for your readme.md
Kotlin
1
star