allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.Deishelon:RoundedBottomSheet:1.0.1'
}
Simply extend RoundedBottomSheetDialogFragment
, inflate your layout and show it
import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment
class MyRoundedBottomSheet: RoundedBottomSheetDialogFragment(){
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.dialog_2_my_rounded_bottom_sheet, container, false)
}
}
Simply extend or create an instance of RoundedBottomSheetDialog
, inflate your layout and show it
import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialog
val mBottomSheetDialog = RoundedBottomSheetDialog(context!!)
val sheetView = layoutInflater.inflate(R.layout.dialog_2_my_rounded_bottom_sheet, null)
mBottomSheetDialog.setContentView(sheetView)
mBottomSheetDialog.show()
We provide a few options to customize, to make sure your Bottom Sheet will feel native to your app To change default values, just override the recourse you wish, like so:
<color name="roundedBottomSheetPrimaryBackground">#F06292</color>
Recourse | Description | Default value |
---|---|---|
@color/roundedBottomSheetPrimaryBackground | Background colour | #FFFFFFFF |
@color/roundedBottomSheetPrimaryNavigationBarColor | Navigation bar colour | #FFFFFFFF |
@dimen/roundedBottomSheetCornerRadius | Bottom sheet corner radius | 16dp |
@dimen/roundedBottomSheetCornerRadiusTopPadding | Top padding | 8dp |
@dimen/roundedBottomSheetCornerRadiusLeftPadding | Left padding | 8dp |
@dimen/roundedBottomSheetCornerRadiusRightPadding | Right padding | 8dp |