MultipleImageSelect


Source link: https://github.com/darsh2/MultipleImageSelect

#MultipleImageSelect

An android library that allows selection of multiple images from gallery. It shows an initial album (buckets) chooser and then images in selected album. Can limit the number of images that can be selected. Can be used in apps with APK 11 onwards.

Sample app can be found here #Usage Include this library in your project using gradle (thanks to JitPack.io).

For stable build:

repositories {

maven {

  url "https://jitpack.io"

}
 
}
  dependencies {

compile 'com.github.darsh2:MultipleImageSelect:v0.0.4' 
}

For using the latest build, replace the tag in dependencies above with latest commit hash. Example:

repositories {

maven {

  url "https://jitpack.io"

}
 
}
  dependencies {

compile 'com.github.darsh2:MultipleImageSelect:3474549' 
}

In project's AndroidManifest.xml, add the following under application node:

<activity
android:name="com.darsh.multipleimageselect.activities.AlbumSelectActivity"
android:theme="@style/MultipleImageSelectTheme">
<intent-filter>
  <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </activity>

In the activity from where you want to call image selector, create Intent as follows:

Intent intent = new Intent(this, AlbumSelectActivity.class);
 //set limit on number of images that can be selected, default is 10 intent.putExtra(Constants.INTENT_EXTRA_LIMIT, numberOfImagesToSelect);
 startActivityForResult(intent, Constants.REQUEST_CODE);

and override onActivityResult as follows:

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

if (requestCode == Constants.REQUEST_CODE && resultCode == RESULT_OK && data != null) {

  //The array list has the image paths of the selected images
  ArrayList<Image> images = data.getParcelableArrayListExtra(Constants.INTENT_EXTRA_IMAGES);

  ...

}

#Custom Styles

  1. To change the color of UI elements, in colors.xml file, override the following attributes with the desired colors. Example:
<color name="multiple_image_select_primary">#673AB7</color> <color name="multiple_image_select_primaryDark">#512DA8</color> <color name="multiple_image_select_primaryLight">#D1C4E9</color> <color name="multiple_image_select_accent">#536DFE</color> <color name="multiple_image_select_primaryText">#212121</color> <color name="multiple_image_select_secondaryText">#727272</color> <color name="multiple_image_select_divider">#B6B6B6</color> <color name="multiple_image_select_toolbarPrimaryText">#FFFFFF</color> <color name="multiple_image_select_albumTextBackground">#99FFFFFF</color> <color name="multiple_image_select_imageSelectBackground">#000000</color>
 

  1. To change the theme altogether, do step 1, and make the following changes in styles.xml and manifest file:

styles.xml: Create the theme you want to use along with a theme for toolbar and actionmode. Example:

<style name="OverrideMultipleImageSelectTheme" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/multiple_image_select_primary</item>
<item name="colorPrimaryDark">@color/multiple_image_select_primaryDark</item>
<item name="colorAccent">@color/multiple_image_select_accent</item>
<item name="actionModeStyle">@style/OverrideCustomActionModeStyle</item>
<item name="windowActionModeOverlay">true</item> </style> <style name="OverrideCustomActionModeStyle" parent="Base.Widget.AppCompat.ActionMode">
<item name="background">@color/multiple_image_select_primary</item> </style> <style name="OverrideCustomToolbarTheme" parent="Base.ThemeOverlay.AppCompat.ActionBar"> </style>

AndroidManifest.xml: Add tools:replace="android:theme" to AlbumSelectActivity and ImageSelectActivity and specify theme to use. Example:

<manifest ...
xmlns:tools="http://schemas.android.com/tools"
...>

<activity android:name="com.darsh.multipleimageselect.activities.AlbumSelectActivity"
tools:replace="android:theme"
  android:theme="@style/OverrideMultipleImageSelectTheme">
  <intent-filter>

 <category android:name="ANDROID.INTENT.CATEGORY.DEFAULT" />
  </intent-filter>
  </activity>
<activity android:name="com.darsh.multipleimageselect.activities.ImageSelectActivity"
  tools:replace="android:theme"
  android:theme="@style/OverrideMultipleImageSelectTheme">
  <intent-filter>

 <category android:name="ANDROID.INTENT.CATEGORY.DEFAULT" />
  </intent-filter>
</activity>

#Screenshots Can be found here #Apps using this Gallery Organizer

PictureJam Collage Maker #Similar Projects Similar libraries can be found here #Acknowledgements This library makes use of Glide by Bump Technologies. (Thanks to WindSekirun for suggesting Glide) #License

Copyright 2015 Darshan Dorai  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

Android Five Stars Library is a small library that helps developers add a "Rate My App" dialog to their applications.

A simple tool for code generation of android.content.SharedPreferences based on model class described in java with a little help of annotations. Provides an ability to encapsulate data, saves time writing boiler-plate code, goes beyond SharedPreferences usage with easy-to use Serialization & default values evaluation at runtime.

Actions for android animations. Inspired by libgdx scene2d actions.

The main goal of this project is making creating of complex animations easier.

A lovely snail, you can use it as a seekbar or progressbar.

A beautiful RefreshLayout.

Android indeterminate loader widget with rubber shape and color animations.

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