class SlidingTabStrip
extends LinearLayout
Modifier and Type | Class and Description |
---|---|
private static class |
SlidingTabStrip.SimpleTabColorizer |
Modifier and Type | Field and Description |
---|---|
private static byte |
DEFAULT_BOTTOM_BORDER_COLOR_ALPHA |
private static int |
DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS |
private static int |
DEFAULT_SELECTED_INDICATOR_COLOR |
private Paint |
mBottomBorderPaint |
private int |
mBottomBorderThickness |
private SlidingTabLayout.TabColorizer |
mCustomTabColorizer |
private int |
mDefaultBottomBorderColor |
private SlidingTabStrip.SimpleTabColorizer |
mDefaultTabColorizer |
private Paint |
mSelectedIndicatorPaint |
private int |
mSelectedIndicatorThickness |
private int |
mSelectedPosition |
private float |
mSelectionOffset |
private static int |
SELECTED_INDICATOR_THICKNESS_DIPS |
Constructor and Description |
---|
SlidingTabStrip(Context context) |
SlidingTabStrip(Context context,
AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
private static int |
blendColors(int color1,
int color2,
float ratio)
Blend
color1 and color2 using the given ratio. |
protected void |
onDraw(Canvas canvas) |
(package private) void |
onViewPagerPageChanged(int position,
float positionOffset) |
private static int |
setColorAlpha(int color,
byte alpha)
Set the alpha value of the
color to be the given alpha value. |
(package private) void |
setCustomTabColorizer(SlidingTabLayout.TabColorizer customTabColorizer) |
(package private) void |
setSelectedIndicatorColors(int... colors) |
private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS
private static final byte DEFAULT_BOTTOM_BORDER_COLOR_ALPHA
private static final int SELECTED_INDICATOR_THICKNESS_DIPS
private static final int DEFAULT_SELECTED_INDICATOR_COLOR
private final int mBottomBorderThickness
private final Paint mBottomBorderPaint
private final int mSelectedIndicatorThickness
private final Paint mSelectedIndicatorPaint
private final int mDefaultBottomBorderColor
private int mSelectedPosition
private float mSelectionOffset
private SlidingTabLayout.TabColorizer mCustomTabColorizer
private final SlidingTabStrip.SimpleTabColorizer mDefaultTabColorizer
SlidingTabStrip(Context context)
SlidingTabStrip(Context context, AttributeSet attrs)
void setCustomTabColorizer(SlidingTabLayout.TabColorizer customTabColorizer)
void setSelectedIndicatorColors(int... colors)
void onViewPagerPageChanged(int position, float positionOffset)
protected void onDraw(Canvas canvas)
private static int setColorAlpha(int color, byte alpha)
color
to be the given alpha
value.private static int blendColors(int color1, int color2, float ratio)
color1
and color2
using the given ratio.ratio
- of which to blend. 1.0 will return color1
, 0.5 will give an even blend,
0.0 will return color2
.