public class SeekBar
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SeekBar.IndicatorModeDef |
| Modifier and Type | Field and Description |
|---|---|
static int |
INDICATOR_ALWAYS_HIDE |
static int |
INDICATOR_ALWAYS_SHOW |
static int |
INDICATOR_ALWAYS_SHOW_AFTER_TOUCH |
static int |
INDICATOR_SHOW_WHEN_TOUCH |
static int |
MATCH_PARENT |
static int |
WRAP_CONTENT |
| Constructor and Description |
|---|
SeekBar(RangeSeekBar rangeSeekBar,
android.util.AttributeSet attrs,
boolean isLeft) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
collide(float x,
float y)
拖动检测
|
protected void |
draw(android.graphics.Canvas canvas)
绘制按钮和提示背景和文字
Draw buttons and tips for background and text
|
protected java.lang.String |
formatCurrentIndicatorText(java.lang.String text2Draw)
格式化提示文字
format the indicator text
|
protected boolean |
getActivate() |
android.content.Context |
getContext() |
int |
getIndicatorArrowSize() |
int |
getIndicatorBackgroundColor() |
int |
getIndicatorDrawableId() |
int |
getIndicatorHeight() |
int |
getIndicatorMargin() |
int |
getIndicatorPaddingBottom() |
int |
getIndicatorPaddingLeft() |
int |
getIndicatorPaddingRight() |
int |
getIndicatorPaddingTop() |
float |
getIndicatorRadius() |
int |
getIndicatorRawHeight()
include indicator text Height、padding、margin
|
int |
getIndicatorShowMode() |
int |
getIndicatorTextColor() |
java.text.DecimalFormat |
getIndicatorTextDecimalFormat() |
int |
getIndicatorTextSize() |
int |
getIndicatorWidth() |
float |
getProgress() |
float |
getRawHeight() |
android.content.res.Resources |
getResources() |
int |
getThumbDrawableId() |
int |
getThumbHeight() |
int |
getThumbInactivatedDrawableId() |
float |
getThumbScaleHeight() |
float |
getThumbScaleRatio()
when you touch or move, the thumb will scale, default not scale
|
float |
getThumbScaleWidth() |
int |
getThumbWidth() |
protected void |
initVariables() |
boolean |
isShowIndicator() |
boolean |
isVisible() |
void |
materialRestore() |
protected void |
onDrawIndicator(android.graphics.Canvas canvas,
android.graphics.Paint paint,
java.lang.String text2Draw)
This method will draw the indicator background dynamically according to the text.
|
protected void |
onDrawThumb(android.graphics.Canvas canvas)
绘制按钮
如果没有图片资源,则绘制默认按钮
|
protected void |
onSizeChanged(int x,
int y)
计算每个按钮的位置和尺寸
Calculates the position and size of each button
|
void |
resetThumb() |
void |
scaleThumb() |
protected void |
setActivate(boolean activate) |
void |
setIndicatorArrowSize(int indicatorArrowSize) |
void |
setIndicatorBackgroundColor(int indicatorBackgroundColor) |
void |
setIndicatorDrawableId(int indicatorDrawableId) |
void |
setIndicatorHeight(int indicatorHeight) |
void |
setIndicatorMargin(int indicatorMargin) |
void |
setIndicatorPaddingBottom(int indicatorPaddingBottom) |
void |
setIndicatorPaddingLeft(int indicatorPaddingLeft) |
void |
setIndicatorPaddingRight(int indicatorPaddingRight) |
void |
setIndicatorPaddingTop(int indicatorPaddingTop) |
void |
setIndicatorRadius(float indicatorRadius) |
void |
setIndicatorShowMode(int indicatorShowMode)
the indicator show mode
INDICATOR_SHOW_WHEN_TOUCH
INDICATOR_ALWAYS_SHOW
INDICATOR_ALWAYS_SHOW_AFTER_TOUCH
INDICATOR_ALWAYS_SHOW |
void |
setIndicatorText(java.lang.String text) |
void |
setIndicatorTextColor(int indicatorTextColor) |
void |
setIndicatorTextDecimalFormat(java.lang.String formatPattern) |
void |
setIndicatorTextSize(int indicatorTextSize) |
void |
setIndicatorTextStringFormat(java.lang.String formatPattern) |
void |
setIndicatorWidth(int indicatorWidth) |
protected void |
setShowIndicatorEnable(boolean isEnable) |
void |
setThumbDrawableId(int thumbDrawableId) |
void |
setThumbDrawableId(int thumbDrawableId,
int width,
int height) |
void |
setThumbHeight(int thumbHeight) |
void |
setThumbInactivatedDrawableId(int thumbInactivatedDrawableId,
int width,
int height) |
void |
setThumbWidth(int thumbWidth) |
void |
setTypeface(android.graphics.Typeface typeFace) |
void |
setVisible(boolean visible)
if visble is false, will clear the Canvas
|
void |
showIndicator(boolean isShown) |
protected void |
slide(float percent) |
public static final int INDICATOR_SHOW_WHEN_TOUCH
public static final int INDICATOR_ALWAYS_HIDE
public static final int INDICATOR_ALWAYS_SHOW_AFTER_TOUCH
public static final int INDICATOR_ALWAYS_SHOW
public static final int WRAP_CONTENT
public static final int MATCH_PARENT
public SeekBar(RangeSeekBar rangeSeekBar, android.util.AttributeSet attrs, boolean isLeft)
protected void initVariables()
public android.content.Context getContext()
public android.content.res.Resources getResources()
protected void onSizeChanged(int x,
int y)
x - position xy - position ypublic void scaleThumb()
public void resetThumb()
public float getRawHeight()
protected void draw(android.graphics.Canvas canvas)
canvas - Canvasprotected void onDrawThumb(android.graphics.Canvas canvas)
draw the thumb button If there is no image resource, draw the default button
canvas - canvasprotected java.lang.String formatCurrentIndicatorText(java.lang.String text2Draw)
text2Draw - protected void onDrawIndicator(android.graphics.Canvas canvas,
android.graphics.Paint paint,
java.lang.String text2Draw)
canvas - Canvastext2Draw - Indicator textprotected boolean collide(float x,
float y)
protected void slide(float percent)
protected void setShowIndicatorEnable(boolean isEnable)
public void materialRestore()
public void setIndicatorText(java.lang.String text)
public void setIndicatorTextDecimalFormat(java.lang.String formatPattern)
public java.text.DecimalFormat getIndicatorTextDecimalFormat()
public void setIndicatorTextStringFormat(java.lang.String formatPattern)
public int getIndicatorDrawableId()
public void setIndicatorDrawableId(int indicatorDrawableId)
public int getIndicatorArrowSize()
public void setIndicatorArrowSize(int indicatorArrowSize)
public int getIndicatorPaddingLeft()
public void setIndicatorPaddingLeft(int indicatorPaddingLeft)
public int getIndicatorPaddingRight()
public void setIndicatorPaddingRight(int indicatorPaddingRight)
public int getIndicatorPaddingTop()
public void setIndicatorPaddingTop(int indicatorPaddingTop)
public int getIndicatorPaddingBottom()
public void setIndicatorPaddingBottom(int indicatorPaddingBottom)
public int getIndicatorMargin()
public void setIndicatorMargin(int indicatorMargin)
public int getIndicatorShowMode()
public void setIndicatorShowMode(int indicatorShowMode)
INDICATOR_SHOW_WHEN_TOUCH
INDICATOR_ALWAYS_SHOW
INDICATOR_ALWAYS_SHOW_AFTER_TOUCH
INDICATOR_ALWAYS_SHOWindicatorShowMode - public void showIndicator(boolean isShown)
public boolean isShowIndicator()
public int getIndicatorRawHeight()
public int getIndicatorHeight()
public void setIndicatorHeight(int indicatorHeight)
public int getIndicatorWidth()
public void setIndicatorWidth(int indicatorWidth)
public int getIndicatorTextSize()
public void setIndicatorTextSize(int indicatorTextSize)
public int getIndicatorTextColor()
public void setIndicatorTextColor(int indicatorTextColor)
public int getIndicatorBackgroundColor()
public void setIndicatorBackgroundColor(int indicatorBackgroundColor)
public int getThumbInactivatedDrawableId()
public void setThumbInactivatedDrawableId(int thumbInactivatedDrawableId,
int width,
int height)
public int getThumbDrawableId()
public void setThumbDrawableId(int thumbDrawableId,
int width,
int height)
public void setThumbDrawableId(int thumbDrawableId)
public int getThumbWidth()
public void setThumbWidth(int thumbWidth)
public float getThumbScaleHeight()
public float getThumbScaleWidth()
public int getThumbHeight()
public void setThumbHeight(int thumbHeight)
public float getIndicatorRadius()
public void setIndicatorRadius(float indicatorRadius)
protected boolean getActivate()
protected void setActivate(boolean activate)
public void setTypeface(android.graphics.Typeface typeFace)
public float getThumbScaleRatio()
public boolean isVisible()
public void setVisible(boolean visible)
visible - public float getProgress()