Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Bottom Sheet

The bottom sheet is a slides from the bottom of the screen

banner-Bottom Sheet
Component Status Details

Status component contains a list of checks and completeness that has been tested and owned by each component

check-list-icon We don't use color as the only visual tool to convey information.
check-list-icon The component’s structure and properties include relevant options such as variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.check-list-icon The title is the component name that uses the frame base component template.check-list-icon The base component name contains: .Base & "Component Name" if there is more than one.check-list-icon All component properties use the Legion foundation.
check-list-icon We can change all the parts that are connected to the component base.check-list-icon The inside of the base component remains connected to the master component.check-list-icon All variant options are not damaged when we change from one to another.check-list-icon Overriding changes to components will not reset other variants.
check-list-icon Component's already has component specs documentation.

Status

Resources

Upcoming Upcoming

Bottomsheets are bottom-anchored overlays that that allow the user to easily return to the previous screen. They are meant for temporary focused tasks. Sheets are the mobile equivalent of the modal or overlay on web. Bottomsheet also known as Drawer , Panel, Tray.

Legion has some variant of Bottomsheet and can set :

  1. Title with handler or without handler
  2. Description with handler or without Handler
  3. Button with handler or without handler
  4. Icon left with handler or without handler
  5. Hide or show close button
  6. Hide header
bottomsheet android

Usage

To implement bottomsheet, you can follow the steps below.

Basic implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.Handler
setContent<LayoutBottomsheetBinding> {
...
}

Title with handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.DefaultWithHandler(title = "title")
setContent<LayoutBottomsheetBinding> {
...
}

Description with handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.DefaultWithHandler(description = "description")
setContent<LayoutBottomsheetBinding> {
...
}

Button with handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.DefaultWithHandler(title = "title")
setContent<LayoutBottomsheetBinding> {
...
}

Icon with handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.DefaultWithHandler(icon = ContextCompat.getDrawable(requireContext(),android.R.drawable.ic_menu_info_details))
setContent<LayoutBottomsheetBinding> {
...
}

Show close with handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.DefaultWithHandler(showClose = true)
setContent<LayoutBottomsheetBinding> {
...
}

Title without handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.Default(title = "title")
setContent<LayoutBottomsheetBinding> {
...
}

Description without handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.Default(description = "description")
setContent<LayoutBottomsheetBinding> {
...
}

Button without handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.Default(title = "title")
setContent<LayoutBottomsheetBinding> {
...
}

Icon without handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.Default(icon = ContextCompat.getDrawable(requireContext(),android.R.drawable.ic_menu_info_details))
setContent<LayoutBottomsheetBinding> {
...
}

Hide close without handler implement

...
btnAction.setOnClickListener {
LgnBottomSheet.setup(requireContext()) {
...
orientation = LgnBottomSheet.Orientation.VERTICAL
header = LgnBottomSheet.HeaderView.Default(showClose = false)
setContent<LayoutBottomsheetBinding> {
...
}

Themes

There are 4 themes available on the bottom sheet Legion :

  1. Legion Default
  2. Agree Culture
  3. Agree Livestock
  4. Agree Fisheries

Attributes

Attribute NameXml AttrsRelated method(s)Description
Header ViewN/AheaderSet view type for header
Orientation ButtonN/AorientationSet footer button orientation
Set Content ViewN/AsetContent<T : ViewBinding>Configure content views, can modify your views at provided lambda
Add ButtonN/AaddButtonAdd Button on Footer Bottom Sheet with Builder Pattern, and maximum users can add button. is 3 button, and when more than 3 will throw [IndexOutOfBoundsException]
DismissN/AdismissDismiss Bottom Sheet
Dismiss ListenerN/AsetBottomSheetListenerreceive listener on bottom sheet is dismiss