Configuration reference
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
RecyclerTabLayout can be configured with XML attributes when declared in a layout, and some of the same settings
are available as properties at runtime. Defaults come from the library’s RecyclerTabLayout style.
XML attributes
All attributes use the app: (res-auto) namespace.
| Attribute | Format | Default | Description |
|---|---|---|---|
|
color |
|
Color of the line drawn under the selected tab. |
|
dimension |
|
Height of the indicator line. |
|
dimension |
|
Inset of the indicator from the start edge of the selected tab. In right-to-left layouts the start edge is on the right. |
|
dimension |
|
Inset of the indicator from the end edge of the selected tab. |
|
dimension |
|
Estimated tab width. When the tab being selected is not laid out yet (it is far off screen), the view uses this width to scroll it to the centre. Set it to roughly the width of your tab views. |
|
boolean |
|
Whether |
|
boolean |
|
Whether users can scroll the tab strip horizontally. When |
To change the defaults for every RecyclerTabLayout in an app, apply a style that extends RecyclerTabLayout:
<style name="AppRecyclerTabLayout" parent="RecyclerTabLayout">
<item name="tabIndicatorColor">?attr/colorSecondary</item>
<item name="tabIndicatorHeight">3dp</item>
<item name="tabMinWidth">96dp</item>
</style>
<com.irurueta.android.recyclertablayout.RecyclerTabLayout
style="@style/AppRecyclerTabLayout"
android:layout_width="match_parent"
android:layout_height="48dp" />
Properties and methods
| Member | Description |
|---|---|
|
Indicator color, as a 32-bit ARGB integer. |
|
Indicator height in pixels. |
|
Left and right indicator insets in pixels. When the view is created, they are set from |
|
Selects the tab at |
|
When |
|
Duration of the indicator animation: 200 ms. |
Call invalidate() after changing the indicator properties at runtime so that the view is redrawn.
Because RecyclerTabLayout is a RecyclerView, every RecyclerView API is available too: adapter,
addOnScrollListener, scrollToPosition, and so on. The exception is layoutManager, which the view manages
itself.
The full API is documented in the API documentation.