Skip to main content

Components

Accordion

Accordions are used to hide and show large amounts of content

banner-Accordion

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.LgnAccordion
android:id="@+id/accordion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sometext"
app:showSeparator="true">

Attributes

Attribute NameXml AttrsRelated method(s)Description
Idandroid:idtextTo set id for accordion
Textandroid:texttextTo set Text value directly via xml
Separatorapp:showSeparatorshowSeparatorTo Give line separator between accordion

Example

Static in xml

<LinearLayout
android:id="@+id/containerContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.telkom.legion.component.accordion.LgnAccordion
android: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 ->



accordion - android