Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrefrsousa/superbottomsheet
Android native BottomSheet on steroids πͺ
https://github.com/andrefrsousa/superbottomsheet
android android-app android-application android-development android-library android-ui bottomsheet bottomsheet-dialogs-library bottomsheetdialog bottomsheetdialogfragment bottomsheetview kotlin kotlin-android kotlin-language kotlin-library
Last synced: 3 days ago
JSON representation
Android native BottomSheet on steroids πͺ
- Host: GitHub
- URL: https://github.com/andrefrsousa/superbottomsheet
- Owner: andrefrsousa
- License: mit
- Created: 2018-10-16T20:31:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-23T09:07:53.000Z (about 4 years ago)
- Last Synced: 2025-01-18T12:09:14.846Z (3 days ago)
- Topics: android, android-app, android-application, android-development, android-library, android-ui, bottomsheet, bottomsheet-dialogs-library, bottomsheetdialog, bottomsheetdialogfragment, bottomsheetview, kotlin, kotlin-android, kotlin-language, kotlin-library
- Language: Kotlin
- Homepage: https://andrefrsousa.github.io/SuperBottomSheet/
- Size: 845 KB
- Stars: 706
- Watchers: 11
- Forks: 75
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Super Bottom Sheet
Android native bottom sheet on steroids πͺ
### SummaryThis library allows you to display the bottom sheets in your application with the bonus of **animating the color of the status bar** and the **upper rounded corners** while scrolling.
## Download
This library is available in **jitpack**, so to use it you need to add the above statement to your root *build.gradle*:
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
Add the dependency:```groovy
dependencies {
implementation 'com.github.andrefrsousa:SuperBottomSheet:2.0.0'
}
```
## Sample ProjectWe have a sample project in Kotlin that demonstrates the use of the library [here](https://github.com/andrefrsousa/SuperBottomSheet/blob/master/demo/src/main/java/com/andrefrsousa/superbottomsheet/demo/MainActivity.kt).
![](/raw/example.gif)
## UseIt is recommended that you review the sample project to get a full understanding of all the features offered by the library.
To create a bottom sheet in your project, you only need to extend *SuperBottomSheetFragment*.Example:
```kotlin
class MySheetFragment : SuperBottomSheetFragment() {override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
super.onCreateView(inflater, container, savedInstanceState)
return inflater.inflate(R.layout.fragment_demo_sheet, container, false)
}
}
```
## Adjustments
This is a group of general properties that you can define. These properties are applied to the entire *SuperBottomSheet* in your project.```xml
// The set of DIM applied to the background from 0 to 1.
// Background color of the sheet.
// To corner radius to be applied. 0 if you want none.
// Enable or disable the status bar animation. Default value is true.
// Enable or disable the radius animation. Default is true.
// Enable this option if you want to skip the collapse state. Default value is false.
// Default is true.
// Default is true.
// Color of the status bar. The default uses the attribute value colorDark.
// The height of the bottom sheet when it is collapsed.
// The height of the bottom sheet when it is expanded. Default value is match_parent (-1).
```
If you want to change the properties of a single bottom sheet you can override these methods:
```kotlin
fun getPeekHeight(): Int {
// Your code goes here
}fun getDim(): Float {
// Your code goes here
}fun getBackgroundColor(): Int {
// Your code goes here
}fun getStatusBarColor(): Int {
// Your code goes here
}fun getCornerRadius(): Float {
// Your code goes here
}fun isSheetAlwaysExpanded(): Boolean {
// Your code goes here
}fun isSheetCancelableOnTouchOutside(): Boolean {
// Your code goes here
}fun isSheetCancelable(): Boolean {
// Your code goes here
}fun animateCornerRadius(): Boolean {
// Your code goes here
}fun animateStatusBar(): Boolean {
// Your code goes here
}fun getExpandedHeight(): Int {
// Your code goes here
}```
## License
```
Copyright (c) 2018 AndrΓ© SousaLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```