All Projects → alhazmy13 → Mediapicker

alhazmy13 / Mediapicker

Licence: other
Media Picker is an Android Libary that lets you to select multiple images or video

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Mediapicker

Belvedere
An image picker library for Android
Stars: ✭ 122 (-51.97%)
Mutual labels:  images, media, picker
Imagestore
Open source google photos alternative!
Stars: ✭ 429 (+68.9%)
Mutual labels:  images, media
Laravel Medialibrary
Associate files with Eloquent models
Stars: ✭ 4,743 (+1767.32%)
Mutual labels:  images, media
Filepicker
FilePicker library for Android
Stars: ✭ 181 (-28.74%)
Mutual labels:  media, picker
Lassi-Android
All in 1 picker library for android.
Stars: ✭ 108 (-57.48%)
Mutual labels:  images, picker
Contentmanager
Android library for getting photo or video from a device gallery, cloud or camera. Working with samsung devices. Made by Stfalcon
Stars: ✭ 108 (-57.48%)
Mutual labels:  images, picker
server-media
This repository collects icons, logos & information about game servers.
Stars: ✭ 29 (-88.58%)
Mutual labels:  images, media
android-pickpic
Ready to use library that allows people to select pictures from their device and Facebook account.
Stars: ✭ 12 (-95.28%)
Mutual labels:  images, picker
imagemin-power-cli
Optimize (compress) images with power using imagemin 💪
Stars: ✭ 13 (-94.88%)
Mutual labels:  images
mp-weixin-region-data
微信小程序省市区选择器数据字典
Stars: ✭ 18 (-92.91%)
Mutual labels:  picker
android-folder-picker-library
A light-weight (just 27 KB) android library to let users choose folder / files.
Stars: ✭ 64 (-74.8%)
Mutual labels:  picker
Director
Director is a facility scale broadcast orchestration and control suite. Not actively maintained
Stars: ✭ 35 (-86.22%)
Mutual labels:  media
Dockerfiles
Optimized media, analytics and graphics software stack images. Use the dockerfile(s) in your project or as a recipe book for bare metal installation.
Stars: ✭ 98 (-61.42%)
Mutual labels:  media
kubectl-images
🕸 Show container images used in the cluster.
Stars: ✭ 153 (-39.76%)
Mutual labels:  images
WatchKitTimePicker
⏱ A Time Picker data source for WatchKit that mirrors the behavior of UIDatePicker.
Stars: ✭ 37 (-85.43%)
Mutual labels:  picker
ColorPick.js
A simple and minimal jQuery color picker plugin for the modern web.
Stars: ✭ 48 (-81.1%)
Mutual labels:  picker
cast control
📺 Control Chromecasts from Linux and D-Bus
Stars: ✭ 443 (+74.41%)
Mutual labels:  media
TYHeightPicker
It's custom height picker for your health app. you can you this where picking up height or number from user.
Stars: ✭ 33 (-87.01%)
Mutual labels:  picker
Liked-Saved-Image-Downloader
Save content you enjoy!
Stars: ✭ 80 (-68.5%)
Mutual labels:  images
mediafeed
Web application to help categorize and aggregate subscriptions of media channels for easy access. (working only with Youtube channels at this moment)
Stars: ✭ 15 (-94.09%)
Mutual labels:  media

Media Picker

Codacy Badge

Please let me know if your application go to production via this link

Media Picker is an Android Libary that lets you to select multiple images, video or voice for Android 4.1 (API 16) +. You can report any issue on issues page. Note: If you speak Arabic, you can submit issues with Arabic language and I will check them. :)

NOTE


This build 2.x.x will break backward compatibility and there are a lot of changes to improve the performance and fix a lot of Leak memory issues, So please read below document carefully.

Installation


Maven

<dependency>
<groupId>net.alhazmy13.MediaPicker</groupId>
<artifactId>libary</artifactId>
<version>2.4.4</version>
</dependency>

Gradle

dependencies {
	implementation 'net.alhazmy13.MediaPicker:libary:2.4.4'
}

Usage


Images

After adding the library, you need to:

  1. Create an object from ImagePicker or VideoPicker
  2. Override onActivityResult to receive the path of image or videos.

Create an ImagePicker

You will need to create a new instance of ImagePicker. Once the instance are configured, you can call build().

        new ImagePicker.Builder(MainActivity.this)
                        .mode(ImagePicker.Mode.CAMERA_AND_GALLERY)
                        .compressLevel(ImagePicker.ComperesLevel.MEDIUM)
                        .directory(ImagePicker.Directory.DEFAULT)
                        .extension(ImagePicker.Extension.PNG)
                        .scale(600, 600)
                        .allowMultipleImages(false)
                        .enableDebuggingMode(true)
                        .build();

Override onActivityResult

In order to receive the path of image, you will need to override onActivityResult .

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

        if (requestCode == ImagePicker.IMAGE_PICKER_REQUEST_CODE && resultCode == RESULT_OK) {
            List<String> mPaths = data.getStringArrayListExtra(ImagePicker.EXTRA_IMAGE_PATH);
            //Your Code
        }
    }

Additional Options

  • mode to select the mode, you can choose one of these CAMERA,GALLERY or CAMERA_AND_GALLERY
.mode(ImagePicker.Mode.CAMERA)
  • extension You can change the extension of image to PNG or JPG
.extension(ImagePicker.Extension.PNG)
  • compressLevel You can change the quality of image with three different levels HARD,MEDIUM, SOFT or NONE
.compressLevel(ImagePicker.ComperesLevel.MEDIUM)
  • directory You can pass the storage path, or select Directory.DEFAULT_DIR to keep the default path.
.directory(ImagePicker.Directory.DEFAULT)

//OR

.directory(Environment.getExternalStorageDirectory()+"/myFolder")

  • scale You can scale the image to a a minimum width and height. This will only be used if compressLevel is set. To avoid OutOfMemory issues, ensure this is used.
.scale(500, 500)
  • allowMultipleImages Extra used to select and return multiple images from gallery CANNOT select single image from gallery if this feature was enabled
	.allowMultipleImages(true)
  • enableDebuggingMode used to print Image Picker Log
	.enableDebuggingMode(true)
  • allowOnlineImages an option to allow the user to select any image from online resource ex: Google Drive (KNOWN ISSUE) if you enable this option then you cannot select multiple images
	.allowOnlineImages(true)

Create an VideoPicker

You will need to create a new instance of VideoPicker. Once the instance are configured, you can call build().

        new VideoPicker.Builder(MainActivity.this)
                        .mode(VideoPicker.Mode.CAMERA_AND_GALLERY)
                        .directory(VideoPicker.Directory.DEFAULT)
                        .extension(VideoPicker.Extension.MP4)
                        .enableDebuggingMode(true)
                        .build();

Override onActivityResult

In order to receive the path of videos, you will need to override onActivityResult .

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

        if (requestCode == VideoPicker.VIDEO_PICKER_REQUEST_CODE && resultCode == RESULT_OK) {
            List<String> mPaths =  data.getStringArrayListExtra(VideoPicker.EXTRA_VIDEO_PATH);
            //Your Code
        }
    }

Additional Options

  • mode to select the mode, you can choose one of these CAMERA,GALLERY or CAMERA_AND_GALLERY
.mode(VideoPicker.Mode.CAMERA)
  • extension You can change the extension of video to MP4
.extension(VideoPicker.Extension.MP4)
  • directory You can pass the storage path, or select Directory.DEFAULT_DIR to keep the default path.
.directory(VideoPicker.Directory.DEFAULT)

//OR

.directory(Environment.getExternalStorageDirectory()+"/myFolder")

  • enableDebuggingMode used to print Video Picker Log
	.enableDebuggingMode(true)

RxJava 2 for MediaPicker

It's an extenstion that allow you to return an observable from ImagePickerBuilder or VideoPickerBuilder, all you need is to add below dependency and then return the observable from ImagePickerHelper || VideoPickerHelper class.

Gradle

dependencies {
  implementation 'io.reactivex.rxjava2:rxandroid:(Last_version)'
  implementation 'io.reactivex.rxjava2:rxjava:(Last_version)'
	implementation 'net.alhazmy13.MediaPicker:rxjava:(Last_version)'
}
  new ImagePickerHelper(
        new ImagePicker.Builder(Context)
                ...)
                .getObservable()
                .subscribe(....);

Theme the pickers

You can change the strings be overwriting below resources in your project.

    <string name="media_picker_select_from">Select From:</string>
    <string name="media_picker_camera">Camera</string>
    <string name="media_picker_gallery">Gallery</string>
    <string name="media_picker_ok">Ok</string>
    <string name="media_picker_cancel">Cancel</string>
    <string name="media_picker_some_permission_is_denied">Some Permission is Denied</string>
    <string name="media_picker_you_need_to_grant_access_to">You need to grant access to</string>
    <string name="media_picker_read_Write_external_storage"><![CDATA[Read & Write External Storage]]></string>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].