Components
Accordion
Accordions are used to hide and show large amounts of content
Usage
Accordion is a component that consists of a series of titles, and when you click on a specific title, the detailed description will be expanded. This will ensure that the user can focus on only one opened item at a time.
The following is the format for using Legion Accordion
<com.telkom.legion.component.accordion.LgnAccordionandroid:id="@+id/accordion"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="@string/sometext"app:showSeparator="true">
Attributes
Attribute Name | Xml Attrs | Related method(s) | Description |
---|---|---|---|
Id | android:id | text | To set id for accordion |
Text | android:text | text | To set Text value directly via xml |
Separator | app:showSeparator | showSeparator | To Give line separator between accordion |
Example
Static in xml
<LinearLayoutandroid:id="@+id/containerContent"android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical"><com.telkom.legion.component.accordion.LgnAccordionandroid:id="@+id/accordion"android:layout_width="match_parent"
Dynamic using Kotlin*
......override fun onViewCreated(view: View, savedInstanceState: Bundle?) {super.onViewCreated(view, savedInstanceState)with(binding) {val isExpand = MutableStateFlow(false)lifecycleScope.launch {isExpand.collectLatest { isExpanded ->
Do you have feedback?
Please let us know to make it better