{"id":19508622,"url":"https://github.com/commit451/modalbottomsheetdialogfragment","last_synced_at":"2025-04-05T16:09:32.325Z","repository":{"id":40744540,"uuid":"121712059","full_name":"Commit451/ModalBottomSheetDialogFragment","owner":"Commit451","description":"Modal bottom sheet dialog based on the Material Guidelines","archived":false,"fork":false,"pushed_at":"2023-02-07T06:22:04.000Z","size":465,"stargazers_count":450,"open_issues_count":0,"forks_count":36,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-29T15:08:46.632Z","etag":null,"topics":["android","bottomsheet","material-design","material-guidelines"],"latest_commit_sha":null,"homepage":"https://material.io/components/sheets-bottom","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/Commit451.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-02-16T03:42:03.000Z","updated_at":"2024-10-06T11:47:18.000Z","dependencies_parsed_at":"2024-01-16T10:08:42.060Z","dependency_job_id":null,"html_url":"https://github.com/Commit451/ModalBottomSheetDialogFragment","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Commit451%2FModalBottomSheetDialogFragment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Commit451%2FModalBottomSheetDialogFragment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Commit451%2FModalBottomSheetDialogFragment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Commit451%2FModalBottomSheetDialogFragment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Commit451","download_url":"https://codeload.github.com/Commit451/ModalBottomSheetDialogFragment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361693,"owners_count":20926643,"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","bottomsheet","material-design","material-guidelines"],"created_at":"2024-11-10T23:08:25.855Z","updated_at":"2025-04-05T16:09:32.305Z","avatar_url":"https://github.com/Commit451.png","language":"Kotlin","readme":"# ModalBottomSheetDialogFragment\nModal bottom sheet dialog based on the [Material Guidelines](https://material.io/components/sheets-bottom)\n\n[![](https://jitpack.io/v/Commit451/ModalBottomSheetDialogFragment.svg)](https://jitpack.io/#Commit451/ModalBottomSheetDialogFragment)\n\n\u003cimg src=\"/art/simple.png?raw=true\" width=\"200px\"\u003e \u003cimg src=\"/art/header.png?raw=true\" width=\"200px\"\u003e \u003cimg src=\"/art/custom.png?raw=true\" width=\"200px\"\u003e\n\n## Dependency\n\nAdd this in your root `build.gradle` file (**not** your module `build.gradle` file):\n\n```gradle\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url \"https://jitpack.io\" }\n\t}\n}\n```\n\nThen, add the library to your project `build.gradle`\n```gradle\ndependencies {\n    implementation(\"com.github.Commit451:ModalBottomSheetDialogFragment:latest.version.here\")\n}\n```\n\n## Usage\n`ModalBottomSheetDialogFragment`s are typically inflated via a menu item resource. The menu item resource defines the title, icon, and ID is of each `Option`. The menu item resource might looks something like this:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmenu xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n\n    \u003citem\n        android:id=\"@+id/action_favorite\"\n        android:icon=\"@drawable/ic_favorite_black_24dp\"\n        android:title=\"Favorite\" /\u003e\n\n    \u003citem\n        android:id=\"@+id/action_share\"\n        android:icon=\"@drawable/ic_share_black_24dp\"\n        android:title=\"Share\" /\u003e\n\n    \u003citem\n        android:id=\"@+id/action_edit\"\n        android:icon=\"@drawable/ic_edit_black_24dp\"\n        android:title=\"Edit\" /\u003e\n\n\u003c/menu\u003e\n```\nUse the builder to create and show the bottom sheet dialog:\n```kotlin\nModalBottomSheetDialogFragment.Builder()\n    .add(R.menu.options)\n    .show(supportFragmentManager, \"options\")\n```\nMake sure that your `Activity` or `Fragment` implements `ModalBottomSheetDialogFragment.Listener`. For example:\n```kotlin\noverride fun onModalOptionSelected(tag: String?, option: Option) {\n    when (option.id) {\n        R.id.action_edit -\u003e {\n            // edit something\n        }\n        R.id.action_delete -\u003e {\n            // delete something\n        }\n    }\n    Snackbar.make(root, \"Selected option ${option.title} from fragment with tag $tag\", Snackbar.LENGTH_SHORT)\n            .show()\n}\n```\nYou can also customize things to your liking:\n```kotlin\nModalBottomSheetDialogFragment.Builder()\n    .add(R.menu.option_lots)\n    //custom option, without needing menu XML\n    .add(OptionRequest(123, \"Custom\", R.drawable.ic_bluetooth_black_24dp))\n    .layout(R.layout.item_custom)\n    .theme(R.style.CustomTheme)\n    .header(\"Neat\")\n    .columns(3)\n    .show(supportFragmentManager, \"custom\")\n```\nSee the sample app for more.\n\nLicense\n--------\n\n    Copyright 2022 Commit 451\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommit451%2Fmodalbottomsheetdialogfragment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommit451%2Fmodalbottomsheetdialogfragment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommit451%2Fmodalbottomsheetdialogfragment/lists"}