Need help with SuperBottomSheet?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

andrefrsousa
475 Stars 61 Forks MIT License 86 Commits 7 Opened issues

Description

Android native BottomSheet on steroids 💪

Services available

!
?

Need anything else?

Contributors list

No Data

Super Bottom Sheet

Android native bottom sheet on steroids 💪

Build Status jitpack api

Summary

This 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:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency:

dependencies {
    implementation 'com.github.andrefrsousa:SuperBottomSheet:2.0.0'
}

Sample Project

We have a sample project in Kotlin that demonstrates the use of the library here.

Use

It 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:

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.

// 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:

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é Sousa  

Licensed 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 at

http://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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.