{"id":18792419,"url":"https://github.com/emanprague/bottom-sheet","last_synced_at":"2026-05-05T22:41:10.567Z","repository":{"id":75962428,"uuid":"146562454","full_name":"eManPrague/bottom-sheet","owner":"eManPrague","description":"Implementation of Google's Bottom Sheet which was modified to fully support two peek heights.","archived":false,"fork":false,"pushed_at":"2020-01-27T08:06:59.000Z","size":232,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-12-29T15:26:34.275Z","etag":null,"topics":["android","android-library","bottomsheet","java"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eManPrague.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2018-08-29T07:30:26.000Z","updated_at":"2020-01-15T15:51:49.000Z","dependencies_parsed_at":"2023-02-28T10:45:40.508Z","dependency_job_id":null,"html_url":"https://github.com/eManPrague/bottom-sheet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eManPrague%2Fbottom-sheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eManPrague%2Fbottom-sheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eManPrague%2Fbottom-sheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eManPrague%2Fbottom-sheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eManPrague","download_url":"https://codeload.github.com/eManPrague/bottom-sheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239718371,"owners_count":19685725,"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","android-library","bottomsheet","java"],"created_at":"2024-11-07T21:19:47.335Z","updated_at":"2025-12-28T10:30:17.254Z","avatar_url":"https://github.com/eManPrague.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bottom Sheet with two peek heights\n\n[ ![Download](https://api.bintray.com/packages/emanprague/maven/cz.eman.bottomsheet/images/download.svg?version=1.0.0) ](https://bintray.com/emanprague/maven/cz.eman.bottomsheet/1.0.0/link)\n\nThis repository contains implementation of Google's Bottom Sheet which was modified to fully support two peek heights.\n\n## Contents\n\nRepository consists of two modules:\n- `app` - sample application which implements required interfaces\n- `sheet` - library \n\n## Quickstart\n\nFirst of all add link `bottom-sheet` library to your project.\n \n```groovy\n// Gradle Kotlin DSL\nimplementation(\"cz.eman.bottomsheet:bottomsheet:1.0.0\")\n// Groovy\nimplementation 'cz.eman.bottomsheet:bottomsheet:1.0.0'\n```\n\nNow let's create a layout for our view. You will need:\n- `background_container` - container which will contain fragment that sheet will overlap (probably map)\n- `coordinator_layout` - do not forget to include id of layout or `CoordinatorLayout` will not restore instance state\n- `bottom_sheet` - our sheet will inflate into this layout\n- `sheet_container` - place sheet container here\n\nHere's sample:\n\n```xml\n\u003cFrameLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:background=\"@color/activity_background\"\n    android:layout_height=\"match_parent\"\u003e\n\n    \u003cFrameLayout\n        android:id=\"@+id/background_container\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:fitsSystemWindows=\"false\"/\u003e\n        \n        \u003candroidx.coordinatorlayout.widget.CoordinatorLayout\n            xmlns:android=\"http://schemas.android.com/apk/res/android\"\n            xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n            android:id=\"@+id/coordinator_layout\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:focusable=\"true\"\n            android:focusableInTouchMode=\"true\"\u003e\n\n            \u003cLinearLayout\n                android:id=\"@+id/bottom_sheet\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:background=\"@android:color/white\"\n                android:clipToPadding=\"true\"\n                android:orientation=\"vertical\"\n                app:layout_behavior=\"@string/bottom_sheet_two_states\"\u003e\n                \n\n                \u003cFrameLayout\n                    android:id=\"@+id/sheet_container\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"match_parent\"\n                    android:elevation=\"2dp\"/\u003e\n\n            \u003c/LinearLayout\u003e\n            \n        \u003c/androidx.coordinatorlayout.widget.CoordinatorLayout\u003e\n        \n    \u003c/FrameLayout\u003e\n    \n\u003c/FrameLayout\u003e\n```\n\nThen in your code initialize your sheet. You can do it manually, or you can use our handy `SheetHelper`. \nBy default you'll need to just specify two peek heights - collapsed (smaller) and semi-collapsed (bigger).\n\n```kotlin\nval helper = SheetsHelper.Builder(context = this, sheetView = this).apply {\n        setCollapsedHeight(resources.getDimensionPixelSize(R.dimen.sheet_collapsed_height))\n        setSemiCollapsedHeight(resources.getDimensionPixelSize(R.dimen.sheet_semicollapsed_height))\n}.build()\n```\n\nThen just attach sheet with helper depending on your desires.\n- `SheetHelper#init(View, BottomSheet)` - initializes with two collapsed states as defined in builder\n- `SheetHelper#initSemiCollapsed(View, BottomSheet)` - initializes with only collapsed state (semi-collapsed) as defined in builder\n- `SheetHelper#initCollapsed(View, BottomSheet)` - initializes with only collapsed state (collapsed) as defined in builder\n\n```kotlin\nhelper.init(bottomSheet, behavior)\nhelper.initSemiCollapsed(bottomSheet, behavior)\nhelper.initCollapsed(bottomSheet, behavior)\n```\n\nChanging states is also really easy - image that your sheet now supports two collapsed states and you want to change it to just one bigger. No problem, call one of these:\n```java\nhelper.animateToSemiCollapsed()\nhelper.restoreSemiCollapsedState()\n```\n\nWant to restore two collapsed states behaviour? Pick one of these:\n```kotlin\nhelper.animateToTwoStates()\nhelper.restoreTwoStates()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanprague%2Fbottom-sheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femanprague%2Fbottom-sheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanprague%2Fbottom-sheet/lists"}