{"id":18925830,"url":"https://github.com/michael-rapp/androidbottomsheet","last_synced_at":"2025-04-07T07:18:22.686Z","repository":{"id":57721484,"uuid":"51331877","full_name":"michael-rapp/AndroidBottomSheet","owner":"michael-rapp","description":"Provides a bottom sheet as proposed by Android's Material design guidelines.","archived":false,"fork":false,"pushed_at":"2018-10-30T22:29:21.000Z","size":5046,"stargazers_count":329,"open_issues_count":2,"forks_count":32,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T06:06:22.690Z","etag":null,"topics":["android","bottomsheet"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/michael-rapp.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}},"created_at":"2016-02-08T22:27:36.000Z","updated_at":"2024-09-21T13:48:54.000Z","dependencies_parsed_at":"2022-09-26T21:50:16.366Z","dependency_job_id":null,"html_url":"https://github.com/michael-rapp/AndroidBottomSheet","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-rapp%2FAndroidBottomSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-rapp%2FAndroidBottomSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-rapp%2FAndroidBottomSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-rapp%2FAndroidBottomSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michael-rapp","download_url":"https://codeload.github.com/michael-rapp/AndroidBottomSheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608160,"owners_count":20965953,"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"],"created_at":"2024-11-08T11:13:35.301Z","updated_at":"2025-04-07T07:18:22.668Z","avatar_url":"https://github.com/michael-rapp.png","language":"Java","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=X75YSLEJV3DWE"],"categories":[],"sub_categories":[],"readme":"# AndroidBottomSheet - README\n\n[![API-Level](https://img.shields.io/badge/API-14%2B-orange.svg)](https://android-arsenal.com/api?level=14) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=X75YSLEJV3DWE)\n\n\"AndroidBottomSheet\" is an Android-library, which provides a bottom sheet as a proposed by Android's Material design guidelines (see [here](http://www.google.com/design/spec/components/bottom-sheets.html) for further details), which even works on pre-Lollipop devices. A bottom sheet is supposed to contain menu items, which can be clicked by the user. By default only a few items are shown, but by dragging the bottom sheet, it can be expanded to display all items. The following screenshot shows the appearance of a bottom sheet, which has been created by using the library:\n\n![](doc/images/example.png)\n\nThe library provides the following features:\n\n- The library provides a builder, which allows to create bottom sheets by specifying a title, icon, items etc.\n- A bottom sheet's items can be displayed as a list, as a two-columned list or as a grid.\n- It is possible to separate a bottom sheet's items by adding dividers (with optional titles).\n- The library offers a possibility to display all applications, which are suited for handling an Intent, as a bottom sheet's items\n- The items of a bottom sheet can be enabled/disabled individually.\n- As an alternative to displaying items, a bottom sheet's items can be be replaced with a custom view.\n- The library comes with a dark theme in addition to the default light theme. Both themes can be modified by using theme attributes.\n\n## License Agreement\n\nThis project is distributed under the Apache License version 2.0. For further information about this license agreement's content please refer to its full version, which is available at http://www.apache.org/licenses/LICENSE-2.0.txt.\n\nPrior to version 1.0.1 this library was distributed under the GNU Lesser General Public License version 3.0 (GLPLv3).\n\n## Download\n\nThe latest release of this library can be downloaded as a zip archive from the download section of the project's Github page, which is available [here](https://github.com/michael-rapp/AndroidBottomSheet/releases). Furthermore, the library's source code is available as a Git repository, which can be cloned using the URL https://github.com/michael-rapp/AndroidBottomSheet.git.\n\nAlternatively, the library can be added to your Android app as a Gradle dependency by adding the following to the respective module's `build.gradle` file:\n\n```groovy\ndependencies {\n    compile 'com.github.michael-rapp:android-bottom-sheet:2.0.0'\n}\n```\n\n## Examples\n\nThe following examples illustrate the use of the library. In addition to these examples, a more detailed documentation is contained in the project's Wiki. Furthermore generated javadoc files are available.\n\nThe code below shows how to create and show a bottom sheet by using the library's `BottomSheet.Builder`. The bottom sheet contains a title as well as multiple items and dividers. The `this` parameter, which is passed to the builder's constructor in the example below, must be a `Context`, e.g. an `Activity`. By calling the builder's `setOnItemClickListener`-method, a listener can be registered to be notified, when one of the bottom sheet's items has been clicked.\n\n```java\nBottomSheet.Builder builder = new BottomSheet.Builder(this); \nbuilder.setTitle(R.string.bottom_sheet_title);\nbuilder.addItem(R.string.item1_title, R.drawable.item1_icon);\nbuilder.addItem(R.string.item2_title, R.drawable.item2_icon);\nbuilder.addDivider();\nbuilder.addItem(R.string.item3_title, R.drawable.item3_icon);\nbuilder.addItem(R.string.item4_title, R.drawable.item4_icon);\nbuilder.addDivider(R.string.divider_title);\nbuilder.addItem(R.string.item5_title, R.drawable.item5_icon);\nbuilder.addItem(R.string.item6_title, R.drawable.item6_icon);\nBottomSheet bottomSheet = builder.create();\nbottomSheet.show();\n```\n\n### Displaying suitable applications for handling an intent\n\nInstead of manually specifying the items of a bottom sheet, it is also possible to display the applications, which are suited for handling a specific `Intent`. This is possible by using the `setIntent`-method as shown in the example code below. The `this` parameter, which is passed to the `setIntent`-method has to be an `Activity`. \n\n```java\nBottomSheet.Builder builder = new BottomSheet.Builder(this);\nIntent intent = new Intent();\nintent.setAction(Intent.ACTION_SEND);\nintent.putExtra(Intent.EXTRA_TEXT, \"This is my text to send.\");\nintent.setType(\"text/plain\");\nbuilder.setIntent(this, intent);\n```\n\nThe image below illustrates the appearance of bottom sheets, which show applications that are suited for handling the `Intent` used in the previous example. \n\n![](doc/images/example-intent.png)\n\n### Using the dark theme\n\nBy default the bottom sheet uses a light theme, which can be referenced by using the resource id `R.style.BottomSheet_Light`. If a dark theme should be used instead, the resource id `R.style.BottomSheet` has to be passed to the builder's constructor like shown below. \n\n```java\nBottomSheet.Builder builder = new BottomSheet.Builder(this, R.style.BottomSheet);\n```\n\nAlternatively, the default theme, which is used by all bottom sheets by default, can be changed globally by using the theme attribute `bottomSheetTheme`. The attribute has to be included in the app's theme, which is defined in the `res/values/styles.xml` file, like it is shown below:\n\n```xml\n\u003cresources\u003e\n\n    \u003cstyle name=\"AppTheme\" parent=\"@style/Theme.AppCompat.Light.DarkActionBar\"\u003e\n        \u003citem name=\"colorPrimary\"\u003e@color/color_primary\u003c/item\u003e\n        \u003citem name=\"colorPrimaryDark\"\u003e@color/color_primary_dark\u003c/item\u003e\n        \u003citem name=\"colorAccent\"\u003e@color/color_accent\u003c/item\u003e\n        \u003citem name=\"bottomSheetTheme\"\u003e@style/BottomSheet\u003c/item\u003e\n    \u003c/style\u003e\n\n\u003c/resources\u003e\n```\n\nThe following screenshot shows the appearance of a bottom sheet using the dark theme.\n\n![](doc/images/example-dark.png)\n\n## Contact information\n\nFor personal feedback or questions feel free to contact me via the mail address, which is mentioned on my [Github profile](https://github.com/michael-rapp). If you have found any bugs or want to post a feature request please use the [bugtracker](https://github.com/michael-rapp/AndroidBottomSheet/issues) to report them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichael-rapp%2Fandroidbottomsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichael-rapp%2Fandroidbottomsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichael-rapp%2Fandroidbottomsheet/lists"}