https://github.com/natario1/bottomsheetcoordinatorlayout
A handy CoordinatorLayout that works well when used in a bottom sheet, even with AppBarLayouts inside.
https://github.com/natario1/bottomsheetcoordinatorlayout
android android-ui appbarlayout bottomsheet bottomsheetbehavior coordinatorlayout
Last synced: 8 months ago
JSON representation
A handy CoordinatorLayout that works well when used in a bottom sheet, even with AppBarLayouts inside.
- Host: GitHub
- URL: https://github.com/natario1/bottomsheetcoordinatorlayout
- Owner: natario1
- License: apache-2.0
- Created: 2017-04-19T16:17:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-10-24T08:57:11.000Z (over 6 years ago)
- Last Synced: 2025-06-30T10:03:20.997Z (8 months ago)
- Topics: android, android-ui, appbarlayout, bottomsheet, bottomsheetbehavior, coordinatorlayout
- Language: Java
- Size: 3.92 MB
- Stars: 270
- Watchers: 11
- Forks: 46
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# BottomSheetCoordinatorLayout
```groovy
implementation 'com.otaliastudios:bottomsheetcoordinatorlayout:1.0.4'
```
A handy `CoordinatorLayout` that works well when used in a bottom sheet, even with `AppBarLayout`s inside.
*Having issues with android.support v28? Please try `com.otaliastudios:bottomsheetcoordinatorlayout:1.1.0-RC1`.*
## Usage
Just use `BottomSheetCoordinatorLayout` as the root view of your bottom sheet. It will be automatically
given the right `BottomSheetBehavior`.
```xml
```
To get an instance of the behavior, use `bscl.getBehavior()`.
As usual with behaviors, the returned value might be null if the view has not gone through a layout,
so wait for that.
If you just want to set appropriate `BottomSheetCallback`, you can use `bscl.setBottomSheetCallback()`.
Callbacks will be added to the sheet behavior as soon as it is available, so this can be called safely
whenever you want. Same goes for other set() methods: they will apply the result to the behavior as soon
as it is available.
## Contributing
You are welcome to contribute with issues, PRs or suggestions. To contact me, send an email.