{"id":27407907,"url":"https://github.com/kinnerapriyap/sher-gil","last_synced_at":"2025-04-14T07:18:32.724Z","repository":{"id":48657831,"uuid":"266549787","full_name":"kinnerapriyap/sher-gil","owner":"kinnerapriyap","description":"Media Image picker library in kotlin for Android 🥳","archived":false,"fork":false,"pushed_at":"2021-07-15T13:26:06.000Z","size":451,"stargazers_count":7,"open_issues_count":18,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2023-07-26T22:20:52.062Z","etag":null,"topics":["android-image-picker","android-image-selector","android-library","image-picker-android","image-picker-library","kotlin"],"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/kinnerapriyap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-24T13:45:33.000Z","updated_at":"2023-06-08T23:31:15.000Z","dependencies_parsed_at":"2022-09-02T03:31:04.237Z","dependency_job_id":null,"html_url":"https://github.com/kinnerapriyap/sher-gil","commit_stats":null,"previous_names":[],"tags_count":13,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinnerapriyap%2Fsher-gil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinnerapriyap%2Fsher-gil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinnerapriyap%2Fsher-gil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinnerapriyap%2Fsher-gil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinnerapriyap","download_url":"https://codeload.github.com/kinnerapriyap/sher-gil/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837232,"owners_count":21169374,"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-image-picker","android-image-selector","android-library","image-picker-android","image-picker-library","kotlin"],"created_at":"2025-04-14T07:18:32.044Z","updated_at":"2025-04-14T07:18:32.716Z","avatar_url":"https://github.com/kinnerapriyap.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sher-gil\n### Media picker library in kotlin for Android 🥳\n[ ![Download](https://img.shields.io/maven-central/v/com.kinnerapriyap/sher-gil) ](https://search.maven.org/artifact/com.kinnerapriyap/sher-gil)\n![kotlin](https://img.shields.io/badge/language-kotlin-orange)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![@kinnerapriyap](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Ftwitter.com%2Fkinnerapriyap)](https://twitter.com/kinnerapriyap)\n\nWritten in kotlin with Android architecture components, `sher-gil` aims to be a reliable library resource for media picking.\n\n## Features\n\n* Multiple media selection (currently only images)\n* Custom MIME types\n* Handles runtime permissions\n* Returns media selection as `List\u003cUri\u003e`\n* Custom theme\n\n## Download\n\n### Gradle\nAdd the dependency to your project `build.gradle` file\n```\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation 'com.kinnerapriyap:sher-gil:$latest_version'\n}\n```\nLatest version: [ ![Download](https://api.bintray.com/packages/kinnerapriyap/maven-android/sher-gil/images/download.svg) ](https://bintray.com/kinnerapriyap/maven-android/sher-gil/_latestVersion)\n\n## Usage\n\nSher-gil may be started from either an Activity or a Fragment.\n\n```\nShergil.create(this)\n    .mimeTypes(MimeType.IMAGES)\n    .showDisallowedMimeTypes(false)\n    .numOfColumns(2)\n    .theme(R.style.Shergil)\n    .allowPreview(true)\n    .maxSelectable(Integer.MAX_VALUE)\n    .allowCamera(true)\n    .showDeviceCamera(false)\n    .showCameraFirst(false)\n    .orientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)\n    .withRequestCode(REQUEST_SHERGIL)\n```\n\n#### Get result\n\n```\noverride fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {\n    super.onActivityResult(requestCode, resultCode, data) \n    if (resultCode == Activity.RESULT_OK \u0026\u0026 requestCode == REQUEST_SHERGIL) {\n        val mediaUris: List\u003cUri\u003e = Shergil.getMediaUris(data)\n    }\n}\n```\n\nIf you're on `API level \u003e R`, you can use `registerForActivityResult(ActivityResultContract, ActivityResultCallback)` with the appropriate ActivityResultContract and handle the result in the callback.\n\n**Min SDK:** sher-gil supports a minimum SDK of 21.\n\n#### compileOptions should be applied in the `build.gradle` android closure\n\n```\nandroid {\n    ...\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n}\n```\n\n#### Navigation safe args classpath should be added to application level build.gradle\n\n```\nbuildScript {\n    ...\n    dependencies {\n        classpath \"androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0\"\n    }\n}\n```\n\nRef: [Java 8 support](https://developer.android.com/studio/write/java8-support)\n\n## Contributing\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)\n\nIf you have any feedback or a suggestion for a better implementation, please don't hesitate to open an issue or a pull request. \nFor major changes, please open an issue first to discuss what you would like to change.\n\n## *aha*\n\n#### Named after \n[Amrita Sher-Gil](https://artsandculture.google.com/entity/amrita-sher-gil/m09sphm?categoryId=artist\u0026hl=en), a pre-eminent Hungarian-Indian early modernist painter who became known as the 'Indian Frida Kahlo'.\n\n#### Inspired by \nThe [Matisse](https://github.com/zhihu/Matisse) library\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinnerapriyap%2Fsher-gil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinnerapriyap%2Fsher-gil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinnerapriyap%2Fsher-gil/lists"}