All Projects → robertlevonyan → media-picker

robertlevonyan / media-picker

Licence: Apache-2.0 license
Easy customizable picker for all your needs in Android application

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to media-picker

Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (-37.13%)
Mutual labels:  material-ui, android-sdk, android-development, android-application, android-architecture, material-components, android-ui, android-studio, android-app, androidstudio
Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (-17.96%)
Mutual labels:  material-ui, android-sdk, android-development, android-application, android-architecture, material-components, android-ui, android-studio, android-app, androidstudio
Modern Android Development
Modern Android Development tools & key points
Stars: ✭ 219 (+31.14%)
Mutual labels:  android-sdk, android-development, android-application, android-architecture, android-ui, android-studio, android-app, androidstudio
Android Inappbilling
A sample which uses Google's Play Billing Library and it does InApp Purchases and Subscriptions.
Stars: ✭ 114 (-31.74%)
Mutual labels:  android-sdk, android-development, android-application, android-architecture, android-ui, android-studio, android-app, androidstudio
Cameraxdemo
A sample camera app with CameraX API from Android Jetpack
Stars: ✭ 112 (-32.93%)
Mutual labels:  android-sdk, android-development, android-application, android-architecture, android-ui, android-studio, android-app, androidstudio
Androidkex
Extensions for Kotlin. Use the power of Kotlin to make your code smaller and beautiful.
Stars: ✭ 35 (-79.04%)
Mutual labels:  android-sdk, android-development, android-application, android-architecture, android-ui, android-studio, android-app, androidstudio
Android-daily-read-tips
log for articles and info in android for every developer
Stars: ✭ 13 (-92.22%)
Mutual labels:  android-sdk, android-development, android-application, android-architecture, android-ui, android-studio, android-app
Biometric-Authentication-Android
A sample implementation of AndroidX biometrics API using Kotlin. Authenticate using biometrics or PIN/Password if biometrics isn't available on device. Fully implemented in Jetpack compose using Material 3 dynamic theming and also has a separate implementation in xml with MDC 3.
Stars: ✭ 29 (-82.63%)
Mutual labels:  android-sdk, android-development, android-ui, android-studio, android-app, androidstudio
Android Arsenal.com
Source to android-arsenal.herokuapp.com
Stars: ✭ 541 (+223.95%)
Mutual labels:  android-sdk, android-development, android-application, android-architecture, android-ui, android-app
Android-MonetizeApp
A sample which uses Google's Play Billing Library and it makes In-app Purchases and Subscriptions.
Stars: ✭ 149 (-10.78%)
Mutual labels:  android-sdk, android-development, android-architecture, android-studio, android-app, androidstudio
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (+31.14%)
Mutual labels:  material-ui, android-development, android-application, material-components, android-ui, android-app
Zoomrecylerlayout
🎢 Zoom Recycler Layout Manager For Android Kotlin
Stars: ✭ 618 (+270.06%)
Mutual labels:  android-development, android-application, android-ui, android-studio, android-app, androidstudio
CustomFontView
Custom View classes for TextView, EditText & Buttons - to set custom fonts
Stars: ✭ 26 (-84.43%)
Mutual labels:  android-sdk, android-application, android-architecture, android-ui, android-studio, android-app
Datingapp
Dating UI kit is used for online meet up with girls and boys . The screen contains more than 30 icons and most of all required elements required to design an application like this. The XML and JAVA files contains comments at each and every point for easy understanding. Everything was made with a detail oriented style and followed by today's web trends. Clean coded & Layers are well-organized, carefully named, and grouped.
Stars: ✭ 97 (-41.92%)
Mutual labels:  material-ui, android-development, android-application, android-ui, android-app, androidstudio
Awesomedialog
A Beautiful Dialog Library for Kotlin Android
Stars: ✭ 163 (-2.4%)
Mutual labels:  android-sdk, android-development, android-ui, android-app, androidstudio
Livesmashbar
An elegant looking and easy to use informative library with LiveData integration for Android.
Stars: ✭ 107 (-35.93%)
Mutual labels:  android-sdk, android-development, android-application, android-studio, android-app
android-jetpack
🚀 Road to Accelerate Android Development using Jetpack
Stars: ✭ 50 (-70.06%)
Mutual labels:  android-sdk, android-development, android-architecture, android-studio, android-app
Awesome Android Ui
😎 A curated list of awesome Android UI/UX libraries
Stars: ✭ 353 (+111.38%)
Mutual labels:  android-sdk, android-development, android-ui, android-studio, android-app
Kotlin Android Scaffolding
An android project structure using kotlin and most common libraries.
Stars: ✭ 53 (-68.26%)
Mutual labels:  android-sdk, android-development, android-application, android-studio, android-app
Material-Backdrop-Android
Material Backdrop
Stars: ✭ 106 (-36.53%)
Mutual labels:  material-ui, android-development, android-architecture, material-components, android-ui

    Universal Media Picker

Easy customizable picker for all your needs in Android application
Android Arsenal Android Arsenal API
PickerDialogVersion Maven Central
PickerComposeVersion Maven Central

Setup

Add following line of code to your project level gradle file

  repositories {
    mavenCentral()
  }

Gradle:

Add following line of code to your module(app) level gradle file

    implementation 'com.robertlevonyan.components:Picker:<PickerDialogVersion>'

Kotlin:

    implementation("com.robertlevonyan.components:Picker:$PickerDialogVersion")

Maven:

  <dependency>
    <groupId>com.robertlevonyan.components</groupId>
    <artifactId>Picker</artifactId>
    <version>PickerDialogVersion</version>
    <type>pom</type>
  </dependency>

For Jetpack Compose version

    implementation("com.robertlevonyan.compose:picker:$PickerComposeVersion")

Usage

Buildung picker

  // in fragment or activity
  pickerDialog {
    setTitle(...)          // String value or resource ID
    setTitleTextSize(...)  // Text size of title
    setTitleTextColor(...) // Color of title text
    setListType(...)       // Type of the picker, must be PickerDialog.TYPE_LIST or PickerDialog.TYPE_Grid
    setItems(...)          // List of ItemModel-s which should be in picker
 }.setPickerCloseListener { type: ItemType, uris: List<Uri> ->
   // Getting the result
   when (type) {
            ItemType.Camera -> /* do something with the photo you've taken */
            ItemType.Video -> /* do something with the video you've recorded */
            is ItemType.ImageGallery -> /* do something with the images you've chosen */
            is ItemType.AudioGallery -> /* do something with the audios you've chosen */
            is ItemType.VideoGallery -> /* do something with the videos you've chosen */
            is ItemType.Files -> /* do something with the files you've chosen */
        }
 }.show()

Creating items

  /*  Create a camera item, can be
      ItemType.Camera
      ItemType.Video
      ItemType.ImageGallery
      ItemType.AudioGallery
      ItemType.VideoGallery
      ItemType.Files
  */
  val itemModel = ItemModel(ItemModel.Camera)
  
  // Some optional parameters
  val itemModel = ItemModel(
                    ItemModel.Camera,
                    itemLabel, // Default value is "", in this case default text value will be set
                    itemIcon,  // Default value is 0, in this case default icon will be set
                    hasBackground, // draw a shape background over the icon, default value is true
                    backgroundType, // choose a type for icon background, only works if hasBackground is true, can have one of
                                    // this values: ItemType.TYPE_CIRCLE, ItemType.TYPE_SQUARE, ItemType.TYPE_ROUNDED_SQUARE
                    itemBackgroundColor, // custom color for background shape, only works if hasBackground is true, 
                                         // default color is accent color of your app
                    )

Now you can set custom file types for pickers

 MimeType.Audio.All
 MimeType.Audio.Mp3
 MimeType.Audio.M4a
 MimeType.Audio.Wav
 MimeType.Audio.Amr
 MimeType.Audio.Awb
 MimeType.Audio.Ogg
 MimeType.Audio.Aac
 MimeType.Audio.Mka
 MimeType.Audio.Midi
 MimeType.Audio.Flac

 MimeType.Video.All
 MimeType.Video.Mpeg
 MimeType.Video.Mp4
 MimeType.Video.`3gp
 MimeType.Video.Mkv
 MimeType.Video.Webm
 MimeType.Video.Avi

 MimeType.Image.All
 MimeType.Image.Jpeg
 MimeType.Image.Png
 MimeType.Image.Gif
 MimeType.Image.Bmp
 MimeType.Image.Webp

 MimeType.Files.All
 MimeType.Files.Txt
 MimeType.Files.Html
 MimeType.Files.Pdf
 MimeType.Files.Doc
 MimeType.Files.Xls
 MimeType.Files.Ppt
 MimeType.Files.Zip

 MimeType.Custom() // if you can't find your desired file type you can use this one

For Jetpack Compose version

setContent {
 val coroutine = rememberCoroutineScope()

 PickerDialog(
   dialogTitle = stringResource(id = R.string.app_name),
   dialogTitleSize = 22.sp,
   dialogListType = ListType.TYPE_GRID,
   dialogGridSpan = 3,
   dialogItems = setOf(
     ItemModel(ItemType.Camera, backgroundType = ShapeType.TYPE_ROUNDED_SQUARE, itemBackgroundColor = Color.Red),
     ItemModel(ItemType.Video),
     ItemModel(ItemType.ImageGallery()),
     ItemModel(ItemType.AudioGallery()),
     ItemModel(ItemType.VideoGallery()),
     ItemModel(ItemType.Files())
   ),
   onItemSelected = { selectedUris ->
    // get uris
   }
 ) { bottomSheetState ->
   Column {
     Button(onClick = {
       coroutine.launch {
         if (bottomSheetState.isVisible) {
           bottomSheetState.hide()
         } else {
           bottomSheetState.show()
         }
       }
     }) {
       Text(text = "Open picker")
     }
   }
 }
}

And the result is

List picker Grid picker

Versions

2.2.0

More customizable item types

2.1.2 - 2.1.6

Update to Java 11 SDK 31 ready Minor updates

2.1.1

Single picker issue fixed

2.1.0

Migration to mavenCentral

2.0.1 - 2.0.2

Refactoring and some UI changes

2.0.0

New version of library. Mostly rewritten. Now supports multiple selection.

1.0.1 - 1.1.5

Refactoring and some UI changes

1.0.0

First version of library

Compose versions

1.1.0

More customizable item types

1.0.0

First version of library

Contact

Special thanks to @chimzycash for createing an amazing logo for this project ☺️

Licence

    Universal Media Picker©
    Copyright 2021 Robert Levonyan
    Url: https://github.com/robertlevonyan/MediaPicker

    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.

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].