Coder Social home page Coder Social logo

akshaaatt / media-picker Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 9.0 22.98 MB

Android Library for easing Media Selection to your apps with support for Images and Videos with a beautiful sample app.

Home Page: https://play.google.com/store/apps/dev?id=9090365888631054420

License: GNU General Public License v3.0

Kotlin 100.00%
android images picker videos library kotlin 2021 media sample opensource

media-picker's Introduction

Media-Picker

GitHub issues GitHub last commit GitHub issues GitHub pull requests

FeaturesDevelopmentUsageLicenseContribution


vid 1611683708571.jpg 1611683708587.jpg

Media-Picker

Android Library for easing Media Selection to your apps with support for Images and Videos with a beautiful sample app.

Features

  • Written in Kotlin
  • Pick Multiple Images and Videos
  • Restrict User to Pick no of Images and Videos
  • Capture Images and Videos
  • Latest CameraX API

Gradle Dependency

  • Add the JitPack repository to your project's build.gradle file
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  • Add the dependency in your app's build.gradle file
dependencies {
    implementation 'com.github.akshaaatt:Media-Picker:1.0.2'
}

Usage

Initialization

 val dazzleOptions =
            DazzleOptions.init().apply {
                maxCount = 5                        //maximum number of images/videos to be picked
                maxVideoDuration = 10               //maximum duration for video capture in seconds
                allowFrontCamera = true             //allow front camera use
                excludeVideos = false               //exclude or include video functionalities
            }

        binding.selectMedia.setOnClickListener {
            Dazzle.startPicker(this, dazzleOptions)    //this -> context of Activity or Fragment
        }

Callback

  override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)

        if (resultCode == Activity.RESULT_OK && requestCode == REQUEST_CODE_PICKER){
            val mImageList = data?.getStringArrayListExtra(PICKED_MEDIA_LIST) as ArrayList //List of selected/captured images/videos
            mImageList.map {
                Log.e(TAG, "onActivityResult: $it" )
            }
        }
    }

Contribution

You are most welcome to contribute to this project. Always looking forward for your support!

media-picker's People

Contributors

akshaaatt avatar vedraj360 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

media-picker's Issues

Crashing on lower android version

java.lang.IllegalArgumentException: No supported surface combination is found for camera device - Id : 0.  May be attempting to bind too many use cases. Existing surfaces: [] New configs: [androidx.camera.core.impl.PreviewConfig@596aa18, androidx.camera.core.impl.ImageCaptureConfig@f89ec71, androidx.camera.core.impl.VideoCaptureConfig@42a4a56]
    at androidx.camera.lifecycle.LifecycleCameraRepository.bindToLifecycleCamera(LifecycleCameraRepository.java:280)
    at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:532)
    at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:360)
    at com.aemerse.dazzle.Dazzle.bindCameraUseCases(Dazzle.kt:273)
    at com.aemerse.dazzle.Dazzle.startCamera$lambda-5(Dazzle.kt:136)
    at com.aemerse.dazzle.Dazzle.$r8$lambda$hgoHsu-8lNyO_11VaXnXg8Z2w1w(Dazzle.kt)
    at com.aemerse.dazzle.Dazzle$$ExternalSyntheticLambda12.run(Unknown Source)
    at android.os.Handler.handleCallback(Handler.java:742)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:157)
    at android.app.ActivityThread.main(ActivityThread.java:5603)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)

Could not find com.github.akshaaatt:Media-Picker:version

My Build
Could not determine the dependencies of task ':app:compileDebugKotlin'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.akshaaatt:Media-Picker:1.0.2.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/akshaaatt/Media-Picker/1.0.2/Media-Picker-1.0.2.pom
- https://jcenter.bintray.com/com/github/akshaaatt/Media-Picker/1.0.2/Media-Picker-1.0.2.pom
- https://repo.maven.apache.org/maven2/com/github/akshaaatt/Media-Picker/1.0.2/Media-Picker-1.0.2.pom
- https://jitpack.io/com/github/akshaaatt/Media-Picker/1.0.2/Media-Picker-1.0.2.pom

dependencies
implementation 'com.github.akshaaatt:Media-Picker:1.0.2'
and repositories
maven { url "https://jitpack.io" }

Also Try with
maven { url 'https://jitpack.io' }

Result contains previous selections

First of all thanks for making this awesome library.
But I have found some issue.

In onActivityResult it also returns the previously selected items.

For example I have selected 3 items first time then again created instance and selected 1 item. So in the second time I will get 4 items ( first 3 + 1 of this time ).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.