Components
Tab Bar
Displays a tab bar to switch different views
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.
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.LgnTabLayoutandroid: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 AdaptervpBase.adapter = CommonPagerAdapters(listFragment)// Attach Tab to ViewPager2TabLayoutMediator(this, viewPager2) { tab, position ->tab.text = label[position]}.attach()
Attributes
Attribute Name | Xml Attrs | Related method(s) | Description |
---|---|---|---|
Tab indicator color | app:tabIndicatorColor | setSelectedTabIndicatorColor() | Change Tab indicator color |
Tab indicator | app:tabIndicator | setSelectedTabIndicatorColor() | Change Tab indicator |
Tab indicator gravity | app:tabIndicatorGravity | setSelectedTabIndicatorGravity() | Change Tab indicator gravity |
Tab indicator animation mode | app:tabIndicatorAnimationMode | .tabIndicatorAnimationMode | Change Tab indicator animation mode |
Tab mode | app:tabMode | .tabMode | Change Type of Tab Style |
Tab inline label | app:tabInlineLabel | .isInlineLabel | Change Tab Label Position to Inline |
Tab text colors | app:tabTextColor | .tabTextColors | Change Tab Text Color State Not Selected |
Tab text colors selected | app:tabSelectedTextColor | .tabTextColors | Change Tab Text Color State Not Selected |
Tab padding | app:tabPadding | N/A | Change Tab all padding |
Tab padding start | app:tabPaddingStart | N/A | Change Tab start padding |
Tab padding top | app:tabPaddingTop | N/A | Change Tab top padding |
Tab padding end | app:tabPaddingEnd | N/A | Change Tab end padding |
Tab padding bottom | app:tabPaddingBottom | N/A | Change Tab bottom padding |
Tab text appreance | app:tabTextAppearance | N/A | Change Tab text apreance |
Tab background | app:tabBackground | N/A | Change Tab background |
Tab indicator animation duration | app:tabIndicatorAnimationDuration | N/A | Change Tab indicator animation duration] |