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