Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Tab Bar

Displays a tab bar to switch different views

banner-Tab Bar
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 Upcoming

Tabs organize content across different screens, data sets, and other interactions.

Usage

You can implement Tabs by using this tag LgnTabLayout in xml file.

<com.telkom.legion.component.tabbar.LgnTabLayout
android:id="@+id/tabBase"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

You can alse customize the Tabs in the fragment or activity from Kotlin file .

Tabs adapter

...
class CommonPagerAdapters(
fragment: Fragment,
val data: List<Fragment>
) : FragmentStateAdapter(fragment) {
override fun getItemCount(): Int {
return data.size
}

Activity or Fragment file

...
with(binding) {
...
// Configure ViewPager2 with Adapter
vpBase.adapter = CommonPagerAdapters(listFragment)
// Attach Tab to ViewPager2
TabLayoutMediator(this, viewPager2) { tab, position ->
tab.text = label[position]
}.attach()

Attributes

Attribute NameXml AttrsRelated method(s)Description
Tab indicator colorapp:tabIndicatorColorsetSelectedTabIndicatorColor()Change Tab indicator color
Tab indicatorapp:tabIndicatorsetSelectedTabIndicatorColor()Change Tab indicator
Tab indicator gravityapp:tabIndicatorGravitysetSelectedTabIndicatorGravity()Change Tab indicator gravity
Tab indicator animation modeapp:tabIndicatorAnimationMode.tabIndicatorAnimationModeChange Tab indicator animation mode
Tab modeapp:tabMode.tabModeChange Type of Tab Style
Tab inline labelapp:tabInlineLabel.isInlineLabelChange Tab Label Position to Inline
Tab text colorsapp:tabTextColor.tabTextColorsChange Tab Text Color State Not Selected
Tab text colors selectedapp:tabSelectedTextColor.tabTextColorsChange Tab Text Color State Not Selected
Tab paddingapp:tabPaddingN/AChange Tab all padding
Tab padding startapp:tabPaddingStartN/AChange Tab start padding
Tab padding topapp:tabPaddingTopN/AChange Tab top padding
Tab padding endapp:tabPaddingEndN/AChange Tab end padding
Tab padding bottomapp:tabPaddingBottomN/AChange Tab bottom padding
Tab text appreanceapp:tabTextAppearanceN/AChange Tab text apreance
Tab backgroundapp:tabBackgroundN/AChange Tab background
Tab indicator animation durationapp:tabIndicatorAnimationDurationN/AChange Tab indicator animation duration]