Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
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.

Methods

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)

Tab

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()

Clone this wiki locally