{"id":20307800,"url":"https://github.com/rayliverified/customimagepicker","last_synced_at":"2025-04-11T15:12:37.871Z","repository":{"id":67048099,"uuid":"96936687","full_name":"rayliverified/CustomImagePicker","owner":"rayliverified","description":"Custom Image Picker provides a drop-in popup gallery for selecting recent images.","archived":false,"fork":false,"pushed_at":"2019-12-03T04:29:28.000Z","size":6846,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T04:49:05.648Z","etag":null,"topics":["android","chooser","gallery","image","image-gallery","image-picker","photo","photos","picker","select","selector","viewer"],"latest_commit_sha":null,"homepage":"http://rayliverified.com/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rayliverified.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-11T20:58:58.000Z","updated_at":"2025-02-16T06:46:48.000Z","dependencies_parsed_at":"2023-04-08T10:02:11.468Z","dependency_job_id":null,"html_url":"https://github.com/rayliverified/CustomImagePicker","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayliverified%2FCustomImagePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayliverified%2FCustomImagePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayliverified%2FCustomImagePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayliverified%2FCustomImagePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rayliverified","download_url":"https://codeload.github.com/rayliverified/CustomImagePicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429117,"owners_count":21101785,"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","chooser","gallery","image","image-gallery","image-picker","photo","photos","picker","select","selector","viewer"],"created_at":"2024-11-14T17:19:10.396Z","updated_at":"2025-04-11T15:12:37.862Z","avatar_url":"https://github.com/rayliverified.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub release](https://img.shields.io/github/release/searchy2/CustomImagePicker.svg?style=flat-square)](https://github.com/searchy2/CustomImagePicker/releases) [![GitHub Release Date](https://img.shields.io/github/release-date/searchy2/CustomImagePicker.svg?style=flat-square)](https://github.com/searchy2/CustomImagePicker) [![Libraries.io for GitHub](https://img.shields.io/librariesio/github/searchy2/CustomImagePicker.svg?style=flat-square)](https://github.com/searchy2/CustomImagePicker) [![GitHub issues](https://img.shields.io/github/issues/searchy2/CustomImagePicker.svg?style=flat-square)](https://github.com/searchy2/CustomImagePicker) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/searchy2/CustomImagePicker.svg?style=flat-square)](https://github.com/searchy2/CustomImagePicker) [![API](https://img.shields.io/badge/API-15%2B-blue.svg?style=flat-square)](https://github.com/searchy2/CustomImagePicker) [![GitHub top language](https://img.shields.io/github/languages/top/searchy2/CustomImagePicker.svg?style=flat-square)](https://github.com/searchy2/CustomImagePicker)\r\n# Custom Image Picker\r\n\r\n![Screenshots](screenshots/Custom-Recent-Images-Cover.gif)\r\n\r\nCustom Image Picker is a popup image picker for quick selection of recent images. This photo chooser does not require a custom image provider. Custom Image Picker works great for choosing images in a chat app, selecting a profile image, or any quick image selection needs.\r\n\r\n### Single Row \r\n![Screenshots](screenshots/Recent%20Images%201%20Row.png)\r\n\r\n### Double Row\r\n![Screenshots](screenshots/Recent%20Images%202%20Rows.png)\r\n\r\nThis library is part of the [Custom UI](http://rayliverified.com/index.php/code/) collection of beautiful, minimalistic, and customizable Android UI components.\r\n\r\n# Gradle Dependency\r\n\r\nAdd this line to your `build.gradle` project. Use the latest release version for the version code. \r\n\r\n```java\r\nrepositories {\r\n    maven { url 'https://jitpack.io' }\r\n}\r\ncompile 'com.github.searchy2:CustomImagePicker:latest-version'\r\n```\r\n# Usage\r\n\r\n### Code\r\n\r\nCustom Image Picker uses a Dialog popup to display the image gallery. Copy the following code into your project and you will have a working image picker. It's that simple!\r\n\r\nFirst, initialize the bottom sheet layout of our image picker gallery and create the popup dialogue. \r\n\r\n```java\r\nfinal View bottomSheet = getLayoutInflater().inflate(R.layout.bottom_sheet, null);\r\nfinal Dialog mBottomSheetDialog = new Dialog(this, R.style.MaterialDialogSheet);\r\nmBottomSheetDialog.setContentView(bottomSheet);\r\nmBottomSheetDialog.setCancelable(true);\r\nmBottomSheetDialog.getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);\r\nmBottomSheetDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n```\r\n\r\nNext, create the image gallery adapter and show it to the user. \r\n\r\n```java\r\nCustomImagePicker imagePicker = new CustomImagePicker();\r\nimagePicker.setHeight(100);\r\nimagePicker.setWidth(100);\r\nImageAdapter adapter = imagePicker.getAdapter(MainActivity.this);\r\n\r\nTwoWayGridView gridview = bottomSheet.findViewById(R.id.gridview);\r\ngridview.getLayoutParams().height = Units.dpToPx(mContext, 200);\r\ngridview.setNumRows(2);\r\ngridview.setAdapter(adapter);\r\ngridview.setOnItemClickListener(new TwoWayAdapterView.OnItemClickListener() {\r\n    public void onItemClick(TwoWayAdapterView parent, View v, int position, long id) {\r\n        imageUri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id);\r\n        //Do what you want with the returned imageUri here.\r\n        mBottomSheetDialog.dismiss();\r\n    }\r\n});\r\n\r\nmBottomSheetDialog.show();\r\n```\r\n\r\nThat's it! Now you have a fancy new image picker! \r\n\r\n# Customization\r\n\r\n### Layouts\r\n\r\nCustom Image Picker is highly customizable. The default `bottom_sheet_default.xml` layout contains only an image gallery but you can design your own image picker layout or use an existing layout. Please view the sample app for an example image layout with action sheet buttons that capture a photo and open the device image gallery. \r\n\r\n### Builder Attributes\r\n\r\n`getAdapter(Context context)` - default method to get adapter\r\n\r\n`getAdapter(Context context, String columns, String sort)` - filter available images and sort in `Descending` or `Ascending` order. \r\n\r\n`setDrawable(int drawable)` - set drawable resource Id to replace default placeholder image.\r\n\r\n`setHeight(int height)` - set image height (dp).\r\n\r\n`setWidth(int width)` - set image width (dp).\r\n\r\n`setPadding(int padding)` - set image padding (dp).\r\n\r\n`setSize(int size)` - set 1, 2, 3, 4 for image thumbnail quality. 1 is the best quality and 4 is the lowest quality. Default 1.\r\n\r\n\r\n# Features Wishlist\r\n\r\nThese features would make this library even more awesome. You can contribute to this library by developing any of the features below. Or, if you really want to see a feature developed, you can sponsor me to develop the feature.\r\n\r\n---\r\n\r\n\u003eNone\r\n\r\nIf you have any ideas for marking this library even more awesome, please let me know! \r\n\r\n---\r\n\r\nPull requests are most welcome!\r\n\r\nIf you've fixed a bug or have a feature you've added, just create a pull request. If you've found a bug, file an issue. If you have any questions or would like to discuss upcoming features, please get in touch. You can get in touch with me in the Contact section below. \r\n\r\n# ★ Acknowledgements ★\r\n**♥ Developer ♥**\r\n\r\n[Ray Li](https://rayliverified.com)\r\n\r\n**♥ Designer ♥**\r\n\r\n[Ray Li](https://rayliverified.com)\r\n\r\n**♥ Inspiration ♥**\r\nImage selection code from https://github.com/amirarcane/recent-images\r\n\r\n# ★ Get in Touch ★\r\n\u003ca href=\"mailto:ray.li.verified@gmail.com\"\u003e\r\n  \u003cimg alt=\"Ray Li Email\"\r\n       src=\"https://lh3.googleusercontent.com/yN_m90WN_HSCohXdgC2k91uSTk9dnYfoxTYwG_mv_l5_05dV2CzkQ1B6rEqH4uqdgjA=w96\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://rayliverified.com\"\u003e\r\n  \u003cimg alt=\"Ray Li Website\"\r\n       src=\"https://lh3.googleusercontent.com/YmMGcgeO7Km9-J9vFRByov5sb7OUKetnKs8pTi0JZMDj3GVJ61GMTcTlHB7u9uHDHag=w96\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://twitter.com/RayLiVerified\"\u003e\r\n  \u003cimg alt=\"Ray Li Twitter\"\r\n       src=\"https://lh3.ggpht.com/lSLM0xhCA1RZOwaQcjhlwmsvaIQYaP3c5qbDKCgLALhydrgExnaSKZdGa8S3YtRuVA=w96\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://linkedin.com/in/rayliverified/\"\u003e\r\n  \u003cimg alt=\"Ray Li LinkedIn\"\r\n       src=\"https://lh3.googleusercontent.com/00APBMVQh3yraN704gKCeM63KzeQ-zHUi5wK6E9TjRQ26McyqYBt-zy__4i8GXDAfeys=w90\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://www.uplabs.com/ray\"\u003e\r\n  \u003cimg alt=\"Ray Li UpLabs\"\r\n       src=\"https://lh3.googleusercontent.com/fDJB4jtIgZQF_Dj7AFAPEv2dJOJE8LaLSbaiOOFejQJl3oFbkOLLScstkp699oMDcEU=w90\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://github.com/searchy2\"\u003e\r\n  \u003cimg alt=\"Ray Li GitHub\"\r\n       src=\"https://lh3.googleusercontent.com/L15QqmKK7Vl-Ag1ZxaBqNQlXVEw58JT2BDb-ef5t2eboDh0pPSLjDgi3-aQ3Opdhhyk=w96\" /\u003e\r\n\u003c/a\u003e\r\n\r\n# Apps Using This Library\r\n\r\nWant to be here? You can include yourself by making a `pull request`. \r\n\r\n\u003ctable\u003e\r\n\t\u003ctr\u003e\r\n\t\t\u003ctd\u003e\u003cimg src=\"https://lh3.googleusercontent.com/R-vJInTblK1KBOqZaSDm_ac270QBHsiIcU9agHnN-rrp9K_lkN8rLzGIH8asCfkb420Q=w64\"/\u003e\u003c/td\u003e\r\n\t\t\u003ctd\u003e\u003ca href=\"https://play.google.com/store/apps/details?id=io.ideastarter\"\u003eCrowdfunding Community\u003c/a\u003e\u003c/td\u003e\r\n\t\u003c/tr\u003e\r\n\u003c/table\u003e\r\n\r\n#### Search Terms\r\nandroid, image, photo, picker, select, selector, chooser, gallery, viewer\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayliverified%2Fcustomimagepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayliverified%2Fcustomimagepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayliverified%2Fcustomimagepicker/lists"}