PixImagePicker
Pix is a Whatsapp image picker replica. with this, you can integrate an image picker just like WhatsApp.
Install / Use
/learn @akshay2211/PixImagePickerREADME

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.
<img src="http://img.shields.io/liberapay/receives/akshay2211.svg?logo=liberapay">
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
videoOptions : VideoOptions //Video configurations
}
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
- FragmentSample for Plain Fragment implementation
- NavControllerSample for Fragments with NavController implementation
- ViewPager2Sample for Fragments with ViewPager2 implementation
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! 🙏🙏 <a href="https://opencollective.com/piximagepicker#backers" target="_blank"><img src="https://opencollective.com/piximagepicker/backers.svg?width=890"></a>
Download
Download or grab via Gradle:
include in app level build.gradle
repositories {
mavenCentral()
}
implementation 'io.ak1.pix:piximagepicker:1.6.8'
or Maven:
<dependency>
<groupId>io.ak1.pix</groupId>
<artifactId>piximagepicker</artifactId>
<version>1.6.8</version>
<type>pom</type>
</dependency>
or ivy:
<dependency org='io.ak1.pix' name='piximagepicker' rev='1.6.8'>
<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.
Development
Code Quality Tools
This project uses modern code quality tools to maintain high standards:
- Spotless: Automatic code formatting with ktlint
- Detekt: Static code analysis for Kotlin best practices
- Dokka: API documentation generation
Setup
-
Install the pre-commit hook:
chmod +x .git/hooks/pre-commit -
Run code formatting:
./gradlew :pix:spotlessApply -
Run static analysis:
./gradlew :pix:detekt -
Generate documentation:
./gradlew :pix:dokkaHtmlView at:
pix/build/dokka/html/index.html
Available Tasks
# Spotless
./gradlew :pix:spotlessCheck # Check formatting
./gradlew :pix:spotlessApply # Apply formatting
# Detekt
./gradlew :pix:detekt # Run analysis
./gradlew :pix:detektCreateBaseline # Create baseline for existing violations
# Dokka
./gradlew :pix:dokkaHtml # Generate HTML docs
./gradlew :pix:dokkaHtmlOpen # Generate and open docs
# Combined
./gradlew :pix:check # Run all checks
./gradlew :pix:build # Full build with checks
Contributing
Before submitting a PR:
- Ensure code is formatted:
./gradlew :pix:spotlessCheck - Pass static analysis:
./gradlew :pix:detekt - Add documentation to public APIs
- Write tests for new features
The pre-commit hook will automatically run these checks on git commit. You can bypass it with
git commit --no-verify if needed (not recommended).
WIP for KMP migration.
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 :coffee: to keep me recharged :metal: 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!
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
