EZPhotoPicker


Source link: https://github.com/Siclo-Mobile/EZPhotoPicker

EZPhotoPicker

If you want to pick up a photo from the gallery and camera, store it somewhere then do something, this library will be the best choice for you. It will handle all the storing, scaling, rotating, threading, loading dialog. Easy to start a photo intent, easy to get the result, you won't need to code a lot as what you used to do.

It also help you to handle about realtime permission without any lines of code.

Try it, you will see what I mean.

Intergrating gradle

Add this to your module's build.gradle

repositories {

  mavenCentral()
  maven {

url 'https://dl.bintray.com/siclo/SicloAndroidOSS'
  
}
 
}
compile 'com.siclo.ezphotopick:library:1.0.7'

Usage

For full example, please refer to sample

Start image picker activity

EZPhotoPickConfig config = new EZPhotoPickConfig();
 config.photoSource = PhotoSource.GALLERY; // or PhotoSource.CAMERA config.isAllowMultipleSelect = true; // only for GALLERY pick and API >18 config.maxExportingSize = 1000; EZPhotoPick.startPhotoPickActivity(MainActivity.this, config);

For more configurations, check EZPhotoPickConfig class

Receive result onActivityResult

For simplest way, load and use the bitmap, and dont care about the photo name/path:
@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {

super.onActivityResult(requestCode, resultCode, data);

if (resultCode != RESULT_OK) {

 return;

}

 if (requestCode == EZPhotoPick.PHOTO_PICK_GALLERY_REQUEST_CODE || requestCode == EZPhotoPick.PHOTO_PICK_CAMERA_REQUEST_CODE) {

Bitmap pickedPhoto = new EZPhotoPickStorage(this).loadLatestStoredPhotoBitmap();

//do something with the bitmap

}

  
}
 
Or you need the photo name
 String photoName = data.getStringExtra(EZPhotoPick.PICKED_PHOTO_NAME_KEY);

  Bitmap pickedPhoto = ezPhotoPickStorage.loadStoredPhotoBitmap(photoDir, photoName, 300);
Or you need the absolute stored photo path for doing something
 String photoName = data.getStringExtra(EZPhotoPick.PICKED_PHOTO_NAME_KEY);

  String photoPath = ezPhotoPickStorage.getAbsolutePathOfStoredPhoto(photoDir, photoName);

  //do something with the path
Or multiple photos (Only for gallery pick)
 ArrayList<String> pickedPhotoNames = data.getStringArrayListExtra(EZPhotoPick.PICKED_PHOTO_NAMES_KEY);

  for(String photoName: photoNames){

  Bitmap pickedPhoto = ezPhotoPickStorage.loadStoredPhotoBitmap(photoDir, photoName, 300);

  
}

For more public api for the storage, check EZPhotoPickStorage class

Contribution

Questions

If you have any questions regarding EZPhotoPicker,create an Issue

Feature request, new features?

We are still working on it to add more useful option/feature, to create a new feature request, open an issue

I'll try to answer as soon as I find the time.

Pull requests welcome

Feel free to contribute to EZPhotoPicker.

Either you found a bug or have created a new and awesome feature, just create a pull request.

License

Copyright 2016 Siclo Mobile Vietnam

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. 

Resources

An adaptation of the JSR-310 backport for Android.

Android Simple Location Tracker is an Android library that helps you get user location with a object named LocationTracker.

Add mask on your EditText components.

This project allows you to calculate the direction between two locations and display the route on a Google Map using the Google Directions API.

Simple photopicker.

Ascent is an Android library that simplifies applying custom fonts to TextViews and sub-classes. Annotation processing is used to remove boilerplate from your code.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes