{"id":19495453,"url":"https://github.com/guilhe/recyclerpickerdialog","last_synced_at":"2025-04-25T21:32:39.516Z","repository":{"id":57727785,"uuid":"300292134","full_name":"GuilhE/RecyclerPickerDialog","owner":"GuilhE","description":"A FragmentDialog implemented with RecyclerView that can accept Single or Multiple selections","archived":false,"fork":false,"pushed_at":"2022-08-29T17:21:23.000Z","size":4554,"stargazers_count":38,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T03:41:13.026Z","etag":null,"topics":["android-dialog","android-dialog-view","android-view","androidx","dialog-fragment","recyclerview"],"latest_commit_sha":null,"homepage":"https://guilhe.github.io/RecyclerPickerDialog","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/GuilhE.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"https://www.buymeacoffee.com/GuilhE"}},"created_at":"2020-10-01T13:37:22.000Z","updated_at":"2023-08-03T18:49:20.000Z","dependencies_parsed_at":"2022-08-30T09:20:43.166Z","dependency_job_id":null,"html_url":"https://github.com/GuilhE/RecyclerPickerDialog","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhE%2FRecyclerPickerDialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhE%2FRecyclerPickerDialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhE%2FRecyclerPickerDialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuilhE%2FRecyclerPickerDialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuilhE","download_url":"https://codeload.github.com/GuilhE/RecyclerPickerDialog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250900373,"owners_count":21505042,"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-dialog","android-dialog-view","android-view","androidx","dialog-fragment","recyclerview"],"created_at":"2024-11-10T21:37:49.921Z","updated_at":"2025-04-25T21:32:38.279Z","avatar_url":"https://github.com/GuilhE.png","language":"Kotlin","funding_links":["https://www.buymeacoffee.com/GuilhE"],"categories":[],"sub_categories":[],"readme":"# RecyclerPickerDialog\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-RecyclerPickerDialog-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/8191)\n    \nA FragmentDialog implemented with RecyclerView that can accept Single or Multiple selections\n\n## Installation\n\nRecyclerPickerDialog is distributed through [Maven Central](https://search.maven.org/artifact/com.github.guilhe/recycler-picker-dialog) and [Jitpack](https://jitpack.io/#GuilhE/RecyclerPickerDialog).\n\n```groovy\nimplementation 'com.github.guilhe:recycler-picker-dialog:${LATEST_VERSION}'\n```\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.guilhe/recycler-picker-dialog.svg)](https://search.maven.org/search?q=g:com.github.guilhe%20AND%20recycler-picker-dialog)\n\n## Usage\n\n### Selection types\n```kotlin\nenum class SelectionType { SINGLE, MULTIPLE }\n```\n\n### Selector types\n```kotlin\nenum class SelectorType { CHECK_BOX, RADIO_BUTTON, SWITCH }\n```\n \n### Custom fields (and default values)\n```kotlin\nvar title = \"\"\nvar showSearchBar = false\nvar inputHint = \"\"\nvar buttonText: String = \"Ok\"\nvar resetValuesOnShow = true\nvar dismissKeyboardOnSelection = true\nvar dismissOnSelection = false\nvar isChoiceMandatory = false\nvar data: ArrayList\u003cItem\u003e = arrayListOf()\n@AnimRes var itemsLayoutAnimator: Int? = null\nvar dialogHeight: Int = ViewGroup.LayoutParams.MATCH_PARENT\nvar lifecycleOwner: LifecycleOwner? = null\n```\n\n### Avoid Memory Leaks\nJust add the following line to avoid memory leak if not dismissed before activity or fragment are destroyed:\n```kotlin\npicker.newInstance(/* setup... */).apply { lifecycleOwner = this@MainActivity }\n```\n    \n### Themes\n\n\u003cimg src=\"media/sampleA.gif\" alt=\"Sample A\" width=\"24%\"/\u003e \u003cimg src=\"media/sampleB.gif\" alt=\"Sample B\" width=\"24%\"/\u003e \u003cimg src=\"media/sampleC.gif\" alt=\"Sample C\" width=\"24%\"/\u003e \u003cimg src=\"media/sampleD.gif\" alt=\"Sample D\" width=\"24%\"/\u003e\n  \n\nTo override default theme just create yours by simply extending it and replacing desired color values:  \n```xml\n\u003cstyle name=\"DialogA\" parent=\"RecyclerPickerDialogTheme\"\u003e\n    \u003citem name=\"colorPrimary\"\u003e@color/red\u003c/item\u003e\n    \u003citem name=\"recyclerPickerDialogCornerRadius\"\u003e20dp\u003c/item\u003e\n\u003c/style\u003e\n```\n\n#### Attributes\nYou can override the following attributes:\n```xml\n\u003cresources\u003e\n    \u003cstyle name=\"RecyclerPickerDialogTheme\" parent=\"Theme.MaterialComponents.Light.Dialog\"\u003e\n        \u003citem name=\"colorPrimary\"/\u003e\n        \u003citem name=\"colorOnPrimary\"/\u003e\n        \u003citem name=\"colorSecondary\"/\u003e\n     \n        \u003citem name=\"android:textColorPrimary\"/\u003e\n        \u003citem name=\"android:textColorSecondary\"/\u003e\n\n        \u003citem name=\"colorAccent\"/\u003e\n        \u003citem name=\"android:colorEdgeEffect\"/\u003e\n        \u003citem name=\"recyclerPickerDialogCornerRadius\"/\u003e\n    \u003c/style\u003e\n\u003c/resources\u003e\n```\nWhere:\n\n- _colorPrimary_ \u003e Title and Button background color\n- _colorOnPrimary_ \u003e Title and Button text color\n- _colorSecondary_ \u003e Dialog and Row background color\n- _colorEdgeEffect_ \u003e RecyclerView edge color\n- _textColorPrimary_ \u003e Search and Row text color\n- _textColorSecondary_ \u003e Search hint and icon color; Horizontal Lines color\n- _colorSurface_ \u003e CheckBox, RadioButton and Switch unchecked color\n- _colorOnSurface_ \u003e Button background when disabled (__note__ overrides _colorSurface_)\n- _colorAccent_ \u003e CheckBox, RadioButton and Switch checked color; Hint cursor color\n- _recyclerPickerDialogCornerRadius_ \u003e Dialog corners radius\n\n## Creating new instance:\n```kotlin\nval picker = \n    RecyclerPickerDialogFragment\n        .newInstance(\n            type = SelectionType.SINGLE, //default\n            selector = SelectorType.CHECK_BOX, //default\n            theme = R.style.RecyclerPickerDialogTheme, //default\n            onItemsPicked = { selected -\u003e /* selected items or empty */ }\n        )\n        .apply {\n            /* configure custom fields */ \n        }\n```\n\nShow it when desired:\n```kotlin\npicker.show(supportFragmentManager, \"MyPickerDialogFragment\")\n```\n\nTry out the __sample app__ to see it working!\n\n## Dependencies\n\n- [androidx.appcompat:appcompat](https://developer.android.com/jetpack/androidx/releases/appcompat)\n- [androidx.recyclerview:recyclerview](https://developer.android.com/jetpack/androidx/releases/recyclerview)\n- [androidx.constraintlayout:constraintlayout](https://developer.android.com/jetpack/androidx/releases/constraintlayout)\n- [com.google.android.material:material](https://github.com/material-components/material-components-android/releases)\n\n## Bugs and Feedback\n\nFor bugs, questions and discussions please use the [Github Issues](https://github.com/GuilhE/RecyclerPickerDialog/issues).\n\n## LICENSE\n\nCopyright (c) 2020-present GuilhE\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilhe%2Frecyclerpickerdialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguilhe%2Frecyclerpickerdialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilhe%2Frecyclerpickerdialog/lists"}