<declare-styleable name="TabLayout">
    <! -- The color of the indicator used to display the currently selected TAB. -->
    <attr format="color" name="tabIndicatorColor"/>
    <! Instead, set the inherent size of the custom draw provided to the tabIndicator property to change the indicator height. For example, this can be done by setting the <size> property in the <shape> resource. -->
    <attr format="dimension" name="tabIndicatorHeight"/>
    <! -- The position of the starting edge on the Y-axis from which the TAB should be positioned. -->
    <attr format="dimension" name="tabContentStart"/>
    <! -- A reference to the background to be applied to the TAB. -->
    <attr format="reference" name="tabBackground"/>
    <! -- Drawing for TAB selection indicators. If this property is not specified, the indicator defaults to a line along the bottom of the TAB. -->
    <attr format="reference" name="tabIndicator"/>
    <! -- Tag selects the gravity constant of the indicator. -->
    <attr name="tabIndicatorGravity">
        <! Align the indicator to the bottom of the TAB layout. -->
        <enum name="bottom" value="0"/>
        <! Align indicators along the center of the TAB layout. -->
        <enum name="center" value="1"/>
        <! Align the indicator at the top of the TAB layout. -->
        <enum name="top" value="2"/>
        <! Stretch the indicator to match the height and width of the TAB items in this layout. -->
        <enum name="stretch" value="3"/>
    </attr>
    <! -- Select the duration of the indicator's animation from one TAB item to another in milliseconds. -->
    <attr format="integer" name="tabIndicatorAnimationDuration"/>
    <! -- Select whether the width of the indicator should fill the full width of the TAB item, or whether it should fit the content of the TAB text. If no text label appears, it will be set to the icon's width or minimum width of 24dp. -->
    <attr format="boolean" name="tabIndicatorFullWidth"/>
    <! -- Behavior mode of the tabs in this layout -->
    <attr name="tabMode">
        <enum name="scrollable" value="0"/>
        <enum name="fixed" value="1"/>
        <enum name="auto" value="2"/>
    </attr>
    <! -- Gravity constant of the label. -->
    <attr name="tabGravity">
        <enum name="fill" value="0"/>
        <enum name="center" value="1"/>
        <enum name="start" value="2"/>
    </attr>
    <! -- Whether to display TAB labels horizontally inline with ICONS or below them. -->
    <attr format="boolean" name="tabInlineLabel"/>
    <! -- The minimum width of the TAB. -->
    <attr format="dimension" name="tabMinWidth"/>
    <! -- The maximum width of the TAB. -->
    <attr format="dimension" name="tabMaxWidth"/>
    <! A reference to the TextAppearance style to be applied to the TAB. -->
    <attr format="reference" name="tabTextAppearance"/>
    <! -- The default text color to apply to the TAB. -->
    <attr format="color" name="tabTextColor"/>
    <! Instead, provide a ColorStateList with the selected color set for the tabTextColor property. -->
    <attr format="color" name="tabSelectedTextColor"/>
    <! -- Preferred padding along the opening edge of the TAB. -->
    <attr format="dimension" name="tabPaddingStart"/>
    <! -- Preferred padding for the top edge of the TAB. -->
    <attr format="dimension" name="tabPaddingTop"/>
    <! -- Preferred padding along the end edge of the TAB. -->
    <attr format="dimension" name="tabPaddingEnd"/>
    <! -- Preferred padding for the bottom edge of the TAB. -->
    <attr format="dimension" name="tabPaddingBottom"/>
    <! -- Preferred padding for all edges of the TAB. -->
    <attr format="dimension" name="tabPadding"/>
    <! If the label icon exists, apply color. This can be a list of color states or a color. -->
    <attr format="color" name="tabIconTint"/>
    <! Blend mode applies to TAB ICONS. -->
    <attr name="tabIconTintMode">
        <enum name="src_over" value="3"/>
        <enum name="src_in" value="5"/>
        <enum name="src_atop" value="9"/>
        <enum name="multiply" value="14"/>
        <enum name="screen" value="15"/>
        <enum name="add" value="16"/>
    </attr>
    <! -- Corrugated label color. This could be a list of color states if the expected ripple color should be stateful. -->
    <attr format="color" name="tabRippleColor"/>
    <! -- Whether to use unbounded ripple effects on tabs, or whether ripples should be bound to TAB entry boundaries. -->
    <attr format="boolean" name="tabUnboundedRipple"/>
</declare-styleable>
Copy the code