EasyImage


Source link: https://github.com/jkwiecien/EasyImage

What is it?

EasyImage allows you to easily capture images from the gallery, camera or documents without creating lots of boilerplate.

Setup

Runtime permissions

This library requires specific runtime permissions. Declare it in your AndroidMnifest.xml:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Please note: for devices running API 23 (marshmallow) you have to request this permission in the runtime, before calling EasyImage.openCamera(). It's demonstrated in the sample app.

There is also one issue about runtime permissions. According to the docs:

If your app targets M and above and declares as using the CAMERA permission which is not granted, then attempting to use this action will result in a SecurityException. 

For this reason, if your app uses CAMERA permission, you should check it along with WRITE_EXTERNAL_STORAGE before calling EasyImage.openCamera()

This library will help you manage runtime permissions.

Gradle dependency

Get the latest version from jitpack

Please keep in mind that support for SDK 14 & 15 ended on version 1.3.1. If you have to support one of those, use that version of the library:

dependencies {

  compile 'com.github.jkwiecien:EasyImage:1.3.1' 
}
 

Usage

Essentials

Taking image straight from camera

  • EasyImage.openCamera(Activity activity, int type);
  • EasyImage.openCamera(Fragment fragment, int type);

Taking image from gallery or the gallery picker if there is more than 1 gallery app

  • EasyImage.openGallery(Activity activity, int typee);
  • EasyImage.openGallery(Fragment fragment, int type);

Taking image from documents

  • EasyImage.openDocuments(Activity activity, int type);
  • EasyImage.openDocuments(Fragment fragment, int type);

Displaying system picker to chose from camera, documents, or gallery if no documents apps are available

  • EasyImage.openChooserWithDocuments(Activity activity, String chooserTitle, int type);
  • EasyImage.openChooserWithDocuments(Fragment fragment, String chooserTitle, int type);

Displaying system picker to chose from camera or gallery app

  • EasyImage.openChooserWithGallery(Activity activity, String chooserTitle, int type);
  • EasyImage.openChooserWithGallery(Fragment fragment, String chooserTitle, int type);

The type parameter is there only if you want to return different kind of images on the same screen. Otherwise, pass any int like 0.

Getting the photo file

@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {

  super.onActivityResult(requestCode, resultCode, data);

EasyImage.handleActivityResult(requestCode, resultCode, data, this, new DefaultCallback() {

@Override

public void onImagePickerError(Exception e, EasyImage.ImageSource source, int type) {

 //Some error handling

}

 @Override

public void onImagesPicked(List<File> imagesFiles, EasyImage.ImageSource source, int type) {

 //Handle the images

 onPhotosReturned(imagesFiles);

}

  
}
);
 
}

Additional features

Removing canceled but captured photo

If the user takes photo using camera, but then cancels, you might wanna remove that photo from the device. Sample app present's the usage:

  @Override
public void onCanceled(EasyImage.ImageSource source, int type) {

 // Cancel handling, you might wanna remove taken photo if it was canceled

 if (source == EasyImage.ImageSource.CAMERA) {

  File photoFile = EasyImage.lastlyTakenButCanceledPhoto(MainActivity.this);

  if (photoFile != null) photoFile.delete();

 
}

}

Additional configuration

  EasyImage.configuration(this)

  .setImagesFolderName("My app images") // images folder name, default is "EasyImage"

  .saveInAppExternalFilesDir() // if you want to use root internal memory for storying images

  .saveInRootPicturesDirectory();
 // if you want to use internal memory for storying images - default
 .setAllowMultiplePickInGallery(true) // allows multiple picking in galleries that handle it. Also only for phones with API 18+ but it won't crash lower APIs. False by default

Configuration is persisted by default, so if you wish to clear it before the next use call EasyImage.clearConfiguration(Context context);

License

Copyright 2015 Jacek Kwiecie?.  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

Great sound quality, audio cleanliness and very smooth interface. Playing the folder structure, artist or album or create your own playlists with local or online tracks.

  • 10-band equalizer
  • Themes
  • mp3, flac, aac, ogg, oga, m4a, m4b, m4p, wma and other audio formats

Shape Ripple is a library that emulates a ripple like animations with cool tweaks on the go. It runs on API level 11 and upwards.

As addition you can even create your own shape renderer through the canvas to create a custom shape ripple.

An unofficial Unsplash API library.

MapDrawingTools is an android library to Drawing manually polygon, polyline and points in the Google Map and return coordinates from library to your App. this library useful for application that pick multiple point or drawing border of land to get data from users.

Aesthetic is an easy to use, fast, Rx-powered theme engine for Android applications.

Android developers should collect the following utils.

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