{"id":15040948,"url":"https://github.com/robertlevonyan/media-picker","last_synced_at":"2025-02-26T02:20:07.391Z","repository":{"id":46584000,"uuid":"125543555","full_name":"robertlevonyan/media-picker","owner":"robertlevonyan","description":"Easy customizable picker for all your needs in Android application","archived":false,"fork":false,"pushed_at":"2023-10-27T12:09:40.000Z","size":725,"stargazers_count":190,"open_issues_count":5,"forks_count":36,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-18T23:08:20.353Z","etag":null,"topics":["android","android-app","android-application","android-architecture","android-development","android-library","android-sdk","android-studio","android-ui","androidstudio","kotlin","kotlin-android","kotlin-android-extensions","kotlin-extensions","kotlin-library","material-components","material-design","material-ui"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertlevonyan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-03-16T16:40:06.000Z","updated_at":"2025-01-31T10:38:46.000Z","dependencies_parsed_at":"2022-08-31T04:11:45.754Z","dependency_job_id":"a05e61c4-430c-4526-a81e-18bb3f366a84","html_url":"https://github.com/robertlevonyan/media-picker","commit_stats":null,"previous_names":["robertlevonyan/mediapicker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fmedia-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fmedia-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fmedia-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fmedia-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertlevonyan","download_url":"https://codeload.github.com/robertlevonyan/media-picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240777948,"owners_count":19855933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","android-application","android-architecture","android-development","android-library","android-sdk","android-studio","android-ui","androidstudio","kotlin","kotlin-android","kotlin-android-extensions","kotlin-extensions","kotlin-library","material-components","material-design","material-ui"],"created_at":"2024-09-24T20:45:19.251Z","updated_at":"2025-02-26T02:20:07.341Z","avatar_url":"https://github.com/robertlevonyan.png","language":"Kotlin","funding_links":["https://www.buymeacoffee.com/robertlevonyan"],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://github.com/robertlevonyan/media-picker/blob/master/Images/logo.png\"  width=\"25\" height=\"25\" /\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp; Universal Media Picker\n\n|Easy customizable picker for all your needs in Android application|\u003cimg src=\"https://github.com/robertlevonyan/MediaPicker/blob/master/Images/picker.png\"  width=\"400\" /\u003e|\n|----------------------------------------------------------------------------------------------|-----------|\n\n|Android Arsenal|[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Universal%20Media%20Picker-yellow.svg?style=flat-square)](https://android-arsenal.com/details/1/6862) [![API](https://img.shields.io/badge/API-14%2B-yellow.svg?style=flat-square)](https://android-arsenal.com/api?level=14)|\n|--------------------|--------------------|\n|PickerDialogVersion|[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.robertlevonyan.components/Picker/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.robertlevonyan.components/Picker)|\n|PickerComposeVersion|[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.robertlevonyan.compose/picker/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.robertlevonyan.compose/picker)|\n\n## Setup\n\nAdd following line of code to your project level gradle file\n\n```kotlin\n  repositories {\n    mavenCentral()\n  }\n```\n\n#### Gradle:\n\nAdd following line of code to your module(app) level gradle file\n\n```groovy\n    implementation 'com.robertlevonyan.components:Picker:\u003cPickerDialogVersion\u003e'\n```\n\n#### Kotlin:\n\n```kotlin\n    implementation(\"com.robertlevonyan.components:Picker:$PickerDialogVersion\")\n```\n\n#### Maven:\n\n```xml\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.robertlevonyan.components\u003c/groupId\u003e\n    \u003cartifactId\u003ePicker\u003c/artifactId\u003e\n    \u003cversion\u003ePickerDialogVersion\u003c/version\u003e\n    \u003ctype\u003epom\u003c/type\u003e\n  \u003c/dependency\u003e\n```\n\n### For Jetpack Compose version\n\n```kotlin\n    implementation(\"com.robertlevonyan.compose:picker:$PickerComposeVersion\")\n```\n\n## Usage\n\nBuildung picker\n```kotlin\n  // in fragment or activity\n  pickerDialog {\n    setTitle(...)          // String value or resource ID\n    setTitleTextSize(...)  // Text size of title\n    setTitleTextColor(...) // Color of title text\n    setListType(...)       // Type of the picker, must be PickerDialog.TYPE_LIST or PickerDialog.TYPE_Grid\n    setItems(...)          // List of ItemModel-s which should be in picker\n }.setPickerCloseListener { type: ItemType, uris: List\u003cUri\u003e -\u003e\n   // Getting the result\n   when (type) {\n            ItemType.Camera -\u003e /* do something with the photo you've taken */\n            ItemType.Video -\u003e /* do something with the video you've recorded */\n            is ItemType.ImageGallery -\u003e /* do something with the images you've chosen */\n            is ItemType.AudioGallery -\u003e /* do something with the audios you've chosen */\n            is ItemType.VideoGallery -\u003e /* do something with the videos you've chosen */\n            is ItemType.Files -\u003e /* do something with the files you've chosen */\n        }\n }.show()\n```\n\nCreating items\n```kotlin\n  /*  Create a camera item, can be\n      ItemType.Camera\n      ItemType.Video\n      ItemType.ImageGallery\n      ItemType.AudioGallery\n      ItemType.VideoGallery\n      ItemType.Files\n  */\n  val itemModel = ItemModel(ItemModel.Camera)\n  \n  // Some optional parameters\n  val itemModel = ItemModel(\n                    ItemModel.Camera,\n                    itemLabel, // Default value is \"\", in this case default text value will be set\n                    itemIcon,  // Default value is 0, in this case default icon will be set\n                    hasBackground, // draw a shape background over the icon, default value is true\n                    backgroundType, // choose a type for icon background, only works if hasBackground is true, can have one of\n                                    // this values: ItemType.TYPE_CIRCLE, ItemType.TYPE_SQUARE, ItemType.TYPE_ROUNDED_SQUARE\n                    itemBackgroundColor, // custom color for background shape, only works if hasBackground is true, \n                                         // default color is accent color of your app\n                    )\n```\n\nNow you can set custom file types for pickers\n```kotlin\n MimeType.Audio.All\n MimeType.Audio.Mp3\n MimeType.Audio.M4a\n MimeType.Audio.Wav\n MimeType.Audio.Amr\n MimeType.Audio.Awb\n MimeType.Audio.Ogg\n MimeType.Audio.Aac\n MimeType.Audio.Mka\n MimeType.Audio.Midi\n MimeType.Audio.Flac\n\n MimeType.Video.All\n MimeType.Video.Mpeg\n MimeType.Video.Mp4\n MimeType.Video.`3gp\n MimeType.Video.Mkv\n MimeType.Video.Webm\n MimeType.Video.Avi\n\n MimeType.Image.All\n MimeType.Image.Jpeg\n MimeType.Image.Png\n MimeType.Image.Gif\n MimeType.Image.Bmp\n MimeType.Image.Webp\n\n MimeType.Files.All\n MimeType.Files.Txt\n MimeType.Files.Html\n MimeType.Files.Pdf\n MimeType.Files.Doc\n MimeType.Files.Xls\n MimeType.Files.Ppt\n MimeType.Files.Zip\n\n MimeType.Custom() // if you can't find your desired file type you can use this one\n```\n\n### For Jetpack Compose version\n\n```kotlin\nsetContent {\n val coroutine = rememberCoroutineScope()\n\n PickerDialog(\n   dialogTitle = stringResource(id = R.string.app_name),\n   dialogTitleSize = 22.sp,\n   dialogListType = ListType.TYPE_GRID,\n   dialogGridSpan = 3,\n   dialogItems = setOf(\n     ItemModel(ItemType.Camera, backgroundType = ShapeType.TYPE_ROUNDED_SQUARE, itemBackgroundColor = Color.Red),\n     ItemModel(ItemType.Video),\n     ItemModel(ItemType.ImageGallery()),\n     ItemModel(ItemType.AudioGallery()),\n     ItemModel(ItemType.VideoGallery()),\n     ItemModel(ItemType.Files())\n   ),\n   onItemSelected = { selectedUris -\u003e\n    // get uris\n   }\n ) { bottomSheetState -\u003e\n   Column {\n     Button(onClick = {\n       coroutine.launch {\n         if (bottomSheetState.isVisible) {\n           bottomSheetState.hide()\n         } else {\n           bottomSheetState.show()\n         }\n       }\n     }) {\n       Text(text = \"Open picker\")\n     }\n   }\n }\n}\n```\n\nAnd the result is\n\n|List picker                                            |Grid picker                                                |\n|-------------------------------------------------------|-----------------------------------------------------------|\n|\u003cimg src=\"https://github.com/robertlevonyan/media-picker/blob/master/Images/picker_list.jpg\"  width=\"500\" /\u003e|\u003cimg src=\"https://github.com/robertlevonyan/media-picker/blob/master/Images/picker_grid.jpg\"  width=\"500\" /\u003e|\n\n## Versions\n\n### 2.2.0\n\nMore customizable item types\n\n### 2.1.2 - 2.1.6\n\nUpdate to Java 11\nSDK 31 ready\nMinor updates\n\n#### 2.1.1\n\nSingle picker issue fixed\n\n### 2.1.0\n\nMigration to mavenCentral\n\n#### 2.0.1 - 2.0.2\n\nRefactoring and some UI changes\n\n### 2.0.0\n\nNew version of library.\nMostly rewritten. Now supports multiple selection.\n\n#### 1.0.1 - 1.1.5\n\nRefactoring and some UI changes\n\n### 1.0.0\n\nFirst version of library\n\n## Compose versions\n\n### 1.1.0\n\nMore customizable item types\n\n### 1.0.0\n\nFirst version of library\n\n## Contact\n\n- **Email**: me@robertlevonyan.com\n- **Website**: https://robertlevonyan.com/\n- **Medium**: https://medium.com/@RobertLevonyan\n- **Twitter**: https://twitter.com/@RobertLevonyan\n- **Facebook**: https://facebook.com/robert.levonyan\n- **Google Play**: https://play.google.com/store/apps/dev?id=5477562049350283357\n\nSpecial thanks to @chimzycash for createing an amazing logo for this project ☺️\n\n\u003ca href=\"https://www.buymeacoffee.com/robertlevonyan\"\u003e\n  \u003cimg src=\"https://github.com/robertlevonyan/media-picker/blob/master/Images/coffee.jpeg\"  width=\"300\" /\u003e\n\u003c/a\u003e\n\n\n## Licence\n\n```\n    Universal Media Picker©\n    Copyright 2021 Robert Levonyan\n    Url: https://github.com/robertlevonyan/MediaPicker\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n```\n\n\u003cimg src=\"https://github.com/robertlevonyan/media-picker/blob/master/Images/logo_title.png\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertlevonyan%2Fmedia-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertlevonyan%2Fmedia-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertlevonyan%2Fmedia-picker/lists"}