Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Accordion

Accordions are used to hide and show large amounts of content

banner-Accordion
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

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

Basic

<com.telkom.legion.component.accordion.LgnAccordion
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen_16dp"
android:text="Item 1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/foo_long"

Accordion with icon

<com.telkom.legion.component.accordion.LgnAccordion
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen_16dp"
app:startIconDrawable="@drawable/ic_calendar"
android:text="Item 1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"

Variants

Accordion without divider

<com.telkom.legion.component.accordion.LgnAccordion
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Item 3">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dimen_16dp"
android:text="@string/foo_long" />

Accordion with divider

<com.telkom.legion.component.accordion.LgnAccordion
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen_16dp"
android:text="Item 1"
app:showSeparator="true"
app:startIconDrawable="@drawable/ic_calendar">
<TextView
android:layout_width="match_parent"

Attributes

Attribute NameXml AttrsRelated method(s)Description
Idandroid:idtextTo set id for accordion
Titleandroid:text.titleTo set Text value directly via xml
Separatorapp:showSeparator.showSeparatorShow line separator between accordion
Set Expandedapp:isExpanded.isExpandedSet expanded state on Accordion
Show start Iconapp:startIconDrawable.startIconDrawableShow start Icon on 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