• Stars
    star
    159
  • Rank 231,158 (Top 5 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated almost 3 years ago

Reviews

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

Repository Details

📸Image Picker for Android, Pick an image from Gallery or Capture a new image with Camera.
OpenSooq logo

Gliger [Android Image Picker Library]

API API License Download Android Arsenal

⭐ Star us on GitHub — it helps!

forthebadge

Gliger is an Easy, lightweight and high performance image picker library for Android!
Gliger load images using Android content resolver with the help of coroutines to lazy load the images and improve the performance!
Gliger handle permission requests, support camera capture, and limit for the max number of images to pick.

Demo

Table of content

Download

This library is available in jCenter which is the default Maven repository used in Android Studio. You can also import this library from source as a module.

dependencies {
    // other dependencies here
    implementation 'com.opensooq.supernova:gligar:1.1.0'
}

Sample Project

We have a sample project demonstrating how to use the library.

Checkout the demo here

Usage

Simpler than ever!

To open the Picker:

Kotlin

GligarPicker().requestCode(PICKER_REQUEST_CODE).withActivity(this).show()

Java

new GligarPicker().requestCode(PICKER_REQUEST_CODE).withActivity(this).show();

To get the result override onActivityResult method:

Kotlin

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if (resultCode != Activity.RESULT_OK) {
            return
        }

        when (requestCode) {
            PICKER_REQUEST_CODE -> {
                val imagesList = data?.extras?.getStringArray(GligarPicker.IMAGES_RESULT)// return list of selected images paths.
                if (!imagesList.isNullOrEmpty()) {
                    imagesCount.text = "Number of selected Images: ${imagesList.size}"
                }
            }
        }
    }

Java

@Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode != Activity.RESULT_OK) {
            return;
        }
        switch (requestCode){
            case PICKER_REQUEST_CODE : {
              String pathsList[]= data.getExtras().getStringArray(GligarPicker.IMAGES_RESULT); // return list of selected images paths.
                imagesCount.text = "Number of selected Images: " + pathsList.length;
                break;
            }   
        }
    }
Method usage
withActivity(activity: Activity) used to set the activity will recive the result
withFragment(fragment: Fragment) used to set the fragment will recive the result
requestCode(requestCode: Int) used to set the request code for the result
limit(limit: Int) used to set the max number of images to select
disableCamera(disableCamera: Boolean) by default the value of disableCamera is false, it determine to allow camera captures or not
cameraDirect(cameraDirect: Boolean) by default the value of cameraDirect is false, it determine to open the camera before showing the picker or not

UI customization

Customizable Colors

override any color to change inside your project colors.xml

Property Description
counter_bg selection counter background color
counter_color selection counter text color
selector_color selection tint color
place_holder_color empty image holder color
ripple_color selection ripple color
toolbar_bg toolbar color
done Done button color
change_album_color change album text color
camera_icon_color camera icon color
camera_text_color camera text color
permission_alert_bg permission alert background color
permission_alert_color permission alert text color

Customizable Texts

override any string to change inside your project strings.xml

Property Description
over_limit_msg selection limit reached message
capture_new_image capture image text
change_album_text change album text
permission_storage_never_ask permission denied message
all_images all images album name

License

Copyright 2019 OpenSooq

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.

More Repositories

1

Pluto

Pluto is an Easy, lightweight and high performance slider view library for Android. You have the flexibility to customize it to any view since it based RecyclerView.
Kotlin
109
star
2

Abra

Your next favorite image and video picker from Gallery for Swift
Swift
19
star
3

Charizard

Automated tool for improving the quality of web pages 🔥. You can run it against any web page, public or requiring authentication. It has audits for performance, accessibility, progressive web apps, SEO and more.
CSS
19
star
4

yii2-firebase-notification

This extension will make send firebase notifications easy to do for the Yii2 framework.
PHP
14
star
5

Diglett

Diglett is a cron management system that manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.
JavaScript
13
star
6

react-mic-record

Record a user's voice and display as an oscillation. Works via the HTML5 MediaRecorder API (currently only available in Chrome & Firefox).
JavaScript
13
star
7

Gloom

Gloom is a service to create short URLs that can be easily shared, tweeted, or emailed to friends.
JavaScript
7
star
8

socketio_repeater

This application serves the purpose of passing messages between two different versions of Socket IO (1.X and 2.X). Any message received from one of them is automatically passed to all others.
JavaScript
7
star
9

Lapras

Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift, based on IDMPhotoBrowser, MWPhotoBrowser.
Swift
4
star
10

WebService

Building a RESTful Web Service :: Learn how to create a RESTful web service with Yii2
PHP
2
star