Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 31
TabLayout
Yanndroid edited this page Feb 10, 2022
·
3 revisions
de.dlyt.yanndroid.oneui.widget.TabLayout
Samsung's TabLayout.

<de.dlyt.yanndroid.oneui.widget.TabLayout
android:layout_width="match_parent"android:layout_height="wrap_content" />If you want to set it up with a ViewPager you'll have to use the ViewPager (implementation) bundled in the library, the usage is the same as Google's TabLayout.
Add a custom ImageButton like in Samsung's Gallery (as seen in screenshot).
publicvoidaddTabCustomButton(Drawableicon, CustomButtonClickListenerlistener)Set the style to:
publicvoidseslSetSubTabStyle()Show a badge.
publicvoidseslShowDotBadge(intindex, booleanshow)
publicvoidseslShowBadge(intindex, booleanshow, intbadge)
publicvoidseslShowBadge(intindex, booleanshow, Stringtext)
publicvoidseslShowBadge(intindex, booleanshow, Stringtext, StringcontentDescription)Set Colors.
publicvoidseslSetTabSubTextColors(ColorStateListcolor)
publicvoidseslSetTabSubTextColors(intdefaultColor, intselectedColor)
publicColorStateListseslGetTabSubTextColors()
publicvoidseslSetBadgeColor(@ColorIntintcolor)
publicvoidseslSetBadgeTextColor(@ColorIntintcolor)
publicvoidseslSetSubTabSelectedIndicatorColor(@ColorIntintcolor)Set Sizes.
publicvoidseslSetIconTextGap(intgap)
publicvoidseslSetSubTabIndicatorHeight(intheight)
publicvoidseslSetTabWidth(intwidth)Returns tab title/subtext textview (only for sub tabs).
publicTextViewseslGetTextView()
publicTextViewseslGetSubTextView()Set sub text (only for sub tabs).
publicCharSequenceseslGetSubText()
publicTabseslSetSubText(@NullableCharSequencesubText)Samsung's Tab has two additional modes (not working in RTL currently):
- SESL_MODE_FIXED_AUTO: auto switch to scrollable mode, tabs have all the same size
- SESL_MODE_WEIGHT_AUTO: auto switch to scrollable mode, tabs have individual size depending the content
publicvoidsetTabMode(@Modeintmode)
publicintgetTabMode()BlackMesa123 - OneUI Design Library - Yanndroid