Components
Bottom Sheet
The bottom sheet is a slides from the bottom of the screen
Component Status Details
Status component contains a list of checks and completeness that has been tested and owned by each component
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 :
- Title with handler or without handler
- Description with handler or without Handler
- Button with handler or without handler
- Icon left with handler or without handler
- Hide or show close button
- Hide header

Usage
To implement bottomsheet, you can follow the steps below.
Basic implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = LgnBottomSheet.HeaderView.HandlersetContent<LayoutBottomsheetBinding> {...}
Title with handler implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = LgnBottomSheet.HeaderView.DefaultWithHandler(title = "title")setContent<LayoutBottomsheetBinding> {...}
Description with handler implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = LgnBottomSheet.HeaderView.DefaultWithHandler(description = "description")setContent<LayoutBottomsheetBinding> {...}
Button with handler implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = LgnBottomSheet.HeaderView.DefaultWithHandler(title = "title")setContent<LayoutBottomsheetBinding> {...}
Icon with handler implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = 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.VERTICALheader = LgnBottomSheet.HeaderView.DefaultWithHandler(showClose = true)setContent<LayoutBottomsheetBinding> {...}
Title without handler implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = LgnBottomSheet.HeaderView.Default(title = "title")setContent<LayoutBottomsheetBinding> {...}
Description without handler implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = LgnBottomSheet.HeaderView.Default(description = "description")setContent<LayoutBottomsheetBinding> {...}
Button without handler implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = LgnBottomSheet.HeaderView.Default(title = "title")setContent<LayoutBottomsheetBinding> {...}
Icon without handler implement
...btnAction.setOnClickListener {LgnBottomSheet.setup(requireContext()) {...orientation = LgnBottomSheet.Orientation.VERTICALheader = 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.VERTICALheader = LgnBottomSheet.HeaderView.Default(showClose = false)setContent<LayoutBottomsheetBinding> {...}
Themes
There are 4 themes available on the bottom sheet Legion :
- Legion Default
- Agree Culture
- Agree Livestock
- Agree Fisheries
Attributes
Attribute Name | Xml Attrs | Related method(s) | Description |
---|---|---|---|
Header View | N/A | header | Set view type for header |
Orientation Button | N/A | orientation | Set footer button orientation |
Set Content View | N/A | setContent<T : ViewBinding> | Configure content views, can modify your views at provided lambda |
Add Button | N/A | addButton | Add 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] |
Dismiss | N/A | dismiss | Dismiss Bottom Sheet |
Dismiss Listener | N/A | setBottomSheetListener | receive listener on bottom sheet is dismiss |