• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    Kotlin
  • Created about 6 years ago
  • Updated over 3 years ago

Reviews

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

Repository Details

Gallery Picker allows you to design a custom gallery for image/ video picker in your android projects.

Gallery Picker

License

What is Gallery Picker?

Gallery Picker allows you to design a custom gallery for image/ video picker in your android projects. You can also use the in-built cutom fragment developed with the help of the utility methods provided in the library. The utility methods include fetching data from the android's media store efficiently and album separations.

Screenshot 2

Implementation

[1] In your app module gradle file

dependencies {
    implementation 'com.github.tizisdeepan:gallerypicker:1.0.1'
}

[2] In your project level gradle file

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

[3] In your manifest.xml

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

NOTE: Make sure to implement run time permissions request in your app.

[4] In your project, you can start PickerActivity by adding this line

startActivity(Intent(this@MainActivity, PickerActivity::class.java))

[5] You can define Picker Limits via your Intent

val i = Intent(this@MainActivity, PickerActivity::class.java)
i.putExtra("IMAGES_LIMIT", 7) // Allows you to pick 7 images
i.putExtra("VIDEOS_LIMIT", 7) // Allows you to pick 7 videos
startActivity(i)

[6] If you don't want to use the PickerActivity, you this to fetch Photos and Videos

val images = GalleryPicker(context).getImages()
val videos = GalleryPicker(context).getVideos()
Log.e("RESULT", "IMAGES COUNT: ${images.size}\nVIDEOS COUNT: ${videos.size}")

Documentation

GalleryImage Model

Property Description
ID [String] Unique Identifier for the image
DATA [String] Uri of the image
DATE_ADDED [Long] Date (timeInMillis) of when the image has been Added
DATE_MODIFIED [Long] Date (timeInMillis) of when the image has been Last Modified
DATE_TAKEN [Long] Date (timeInMillis) of when the image has been Captured
DISPLAY_NAME [String] Name of the image
HEIGHT [String] Height of the image in pixels
WIDTH [String] Width of the image in pixels
MIME_TYPE [String] Mime Type of the image
SIZE [String] Size of the image in bytes
TITLE [String] Title of the Image
BUCKET_DISPLAY_NAME [String] Bucket Name of the image in Media Store
BUCKET_ID [String] Bucket ID of the image in Media Store
DESCRIPTION [String] Decription of the image
IS_PRIVATE [String] Tells whether the image is in Private Directory or not
LATITUDE [String] Location coordinates - Latitude
LONGITUDE [String] Location coordinates - Longitude
MINI_THUMB_MAGIC [String] Mini Thumb Magic property from Media Store
ORIENTATION [String] Orientation type - Exif property
PICASA_ID [String] Picasa ID property from Media Store
ALBUM_NAME [String] Name of the Album in which the image is present

GalleryVideo Model

Property Description
ID [String] Unique Identifier for the video
DATA [String] Uri of the video
DATE_ADDED [Long] Date (timeInMillis) of when the video has been Added
DATE_MODIFIED [Long] Date (timeInMillis) of when the video has been Last Modified
DATE_TAKEN [Long] Date (timeInMillis) of when the video has been Captured
DISPLAY_NAME [String] Name of the video
HEIGHT [String] Height of the video in pixels
WIDTH [String] Width of the video in pixels
MIME_TYPE [String] Mime Type of the video
SIZE [String] Size of the video in bytes
TITLE [String] Title of the video
ALBUM [String] Album Name of the video in Media Store
ARTIST [String] Artist Name of the video in Media Store
BOOKMARK [String] Bookmark of the video in Media Store
BUCKET_DISPLAY_NAME [String] Bucket Name of the video in Media Store
BUCKET_ID [String] Bucket ID of the video in Media Store
CATEGORY [String] Category of the video
DESCRIPTION [String] Description of the video
DURATION [String] Duration of the video in milli seconds
IS_PRIVATE [String] Tells whether the video is in Private Directory or not
LANGUAGE [String] Language of the video
LATITUDE [String] Location coordinates - Latitude
LONGITUDE [String] Location coordinates - Longitude
MINI_THUMB_MAGIC [String] Mini Thumb Magic property from Media Store
RESOLUTION [String] Resolution of the video
TAGS [String] Tags property from Media Store
ALBUM_NAME [String] Name of the Album in which the video is present

Developed By

Follow me on Twitter Add me to Linkedin

More Repositories

1

EventsCalendar

Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project!
Kotlin
231
star
2

VideoEditor

FFmpeg is a powerful multimedia framework which allows us to decode, encode, transcode, stream, filter and play most of the media content available now. With the help of these tools, you can develop and application that can manipulate any form of media to the desired output. Sky is not the limit when using FFmpeg. I prefer FFmpeg-all which is a Bible for FFmpeg but it is difficult to read if you do not know what you are looking for. To make it easy, I will summarise the basics of video manipulations using FFmpeg which, then you can use in your own applications or libraries that you are working on. I have developed a simple library that enables you to trim and crop a video, additionally you can compress any video and convert it into any format that you desire.
Kotlin
211
star
3

dots

Dots indicator that shows the current position on a View Pager. It does all the work for you with a few customisations.
Kotlin
24
star
4

PieProgress

Pie Progress is a type of circular progress view similar to the one that you can find in iOS devices while updating applications. It's a simple to use library where the progress gets updated by passing values to a single method.
Kotlin
21
star
5

pulldownlayout

PullDownLayout is a small library that allows you to implement a view that can be dragged down your layout. PullDownLayout can also be used to implement Pull-To-Dismiss feature for your activities and fragments.
Kotlin
18
star
6

android-hilt-sample

Kotlin
4
star
7

StayUpdated

This repository is a project that helps testing a basic news headlines api.
Kotlin
1
star
8

GoWeather

Implementation of androidx LiveData, ViewModel and RxKotlin.
Kotlin
1
star
9

tizisdeepan

1
star
10

StateRelativeLayout

StateRelativeLayout helps you to manage between various UI states, for example, loading state, data state, error state, finish state.
Kotlin
1
star