-
- All Implemented Interfaces:
-
android.graphics.drawable.Animatable
public abstract class Indicator extends Drawable implements Animatable
Created by Jack Wang on 2016/8/5.
-
-
Field Summary
Fields Modifier and Type Field Description private intalphaprotected RectdrawBounds
-
Constructor Summary
Constructors Constructor Description Indicator()
-
Method Summary
Modifier and Type Method Description intgetAlpha()voidsetAlpha(int alpha)RectgetDrawBounds()voidsetDrawBounds(Rect drawBounds)intgetColor()voidsetColor(int color)voidsetAnimationSpeedMultiplier(float speedMultiplier)Set the animation speed multiplier. floatgetAnimationSpeedMultiplier()Get the current animation speed multiplier. intgetOpacity()voidsetColorFilter(ColorFilter colorFilter)voiddraw(Canvas canvas)abstract voiddraw(Canvas canvas, Paint paint)abstract ArrayList<ValueAnimator>onCreateAnimators()voidstart()voidstop()booleanisRunning()voidaddUpdateListener(ValueAnimator animator, ValueAnimator.AnimatorUpdateListener updateListener)Your should use this to add AnimatorUpdateListener whencreate animator , otherwise , animator doesn't work whenthe animation restart . voidpostInvalidate()intgetWidth()intgetHeight()intcenterX()intcenterY()floatexactCenterX()floatexactCenterY()-
Methods inherited from class android.graphics.drawable.Drawable
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromStream, createFromXml, createFromXmlInner, draw, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpacity, getOpticalInsets, getOutline, getPadding, getState, getTransparentRegion, hasFocusStateSpecified, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, mutate, onLayoutDirectionChanged, resolveOpacity, scheduleSelf, setAlpha, setAutoMirrored, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, setTintMode, setVisible, unscheduleSelf -
Methods inherited from class android.graphics.drawable.Animatable
isRunning, start, stop -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getAlpha
int getAlpha()
-
setAlpha
void setAlpha(int alpha)
-
getDrawBounds
Rect getDrawBounds()
-
setDrawBounds
void setDrawBounds(Rect drawBounds)
-
getColor
int getColor()
-
setColor
void setColor(int color)
-
setAnimationSpeedMultiplier
void setAnimationSpeedMultiplier(float speedMultiplier)
Set the animation speed multiplier.
- Parameters:
speedMultiplier- Speed multiplier (1.0f = normal speed, 2.0f = 2x speed, 0.
-
getAnimationSpeedMultiplier
float getAnimationSpeedMultiplier()
Get the current animation speed multiplier.
-
getOpacity
int getOpacity()
-
setColorFilter
void setColorFilter(ColorFilter colorFilter)
-
onCreateAnimators
abstract ArrayList<ValueAnimator> onCreateAnimators()
-
start
void start()
-
stop
void stop()
-
isRunning
boolean isRunning()
-
addUpdateListener
void addUpdateListener(ValueAnimator animator, ValueAnimator.AnimatorUpdateListener updateListener)
Your should use this to add AnimatorUpdateListener whencreate animator , otherwise , animator doesn't work whenthe animation restart .
-
postInvalidate
void postInvalidate()
-
getWidth
int getWidth()
-
getHeight
int getHeight()
-
centerX
int centerX()
-
centerY
int centerY()
-
exactCenterX
float exactCenterX()
-
exactCenterY
float exactCenterY()
-
-
-
-