Class CircularIndeterminateDrawable
java.lang.Object
icyllis.modernui.graphics.drawable.Drawable
icyllis.modernui.material.drawable.CircularIndeterminateDrawable
- All Implemented Interfaces:
Animatable
An indeterminate progress drawable for ProgressBar, similar to Material Design,
but not so rich animation effects.
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.modernui.graphics.drawable.Drawable
Drawable.Callback, Drawable.ConstantState
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCircularIndeterminateDrawable
(Resources res, int size, int inset, float thickness) -
Method Summary
Modifier and TypeMethodDescriptionprotected Animator
void
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha).int
getAlpha()
Gets the current alpha value for the drawable.int
int
Returns the drawable's intrinsic height.int
Returns the drawable's intrinsic width.int
boolean
Indicates whether the animation is running.void
setAlpha
(int alpha) Specify an alpha value for the drawable.void
setIndicatorColor
(int indicatorColor) void
setTrackColor
(int trackColor) boolean
setVisible
(boolean visible, boolean restart) Set whether this Drawable is visible.void
start()
Starts the drawable's animation.void
stop()
Stops the drawable's animation.Methods inherited from class icyllis.modernui.graphics.drawable.Drawable
applyTheme, canApplyTheme, clearMutated, copyBounds, copyBounds, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOutline, getPadding, getState, hasFocusStateSpecified, invalidateSelf, isAutoMirrored, isStateful, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, scaleFromDensity, scaleFromDensity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, unscheduleSelf
-
Field Details
-
mIndicatorColor
protected int mIndicatorColor -
mTrackColor
protected int mTrackColor -
mAlpha
protected int mAlpha -
mAnimator
-
-
Constructor Details
-
CircularIndeterminateDrawable
-
-
Method Details
-
draw
Description copied from class:Drawable
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha). -
getIntrinsicWidth
public int getIntrinsicWidth()Description copied from class:Drawable
Returns the drawable's intrinsic width.Intrinsic width is the width at which the drawable would like to be laid out, including any inherent padding. If the drawable has no intrinsic width, such as a solid color, this method returns -1.
- Overrides:
getIntrinsicWidth
in classDrawable
- Returns:
- the intrinsic width, or -1 if no intrinsic width
-
getIntrinsicHeight
public int getIntrinsicHeight()Description copied from class:Drawable
Returns the drawable's intrinsic height.Intrinsic height is the height at which the drawable would like to be laid out, including any inherent padding. If the drawable has no intrinsic height, such as a solid color, this method returns -1.
- Overrides:
getIntrinsicHeight
in classDrawable
- Returns:
- the intrinsic height, or -1 if no intrinsic height
-
createAnimator
-
setIndicatorColor
public void setIndicatorColor(int indicatorColor) -
setTrackColor
public void setTrackColor(int trackColor) -
getIndicatorColor
public int getIndicatorColor() -
getTrackColor
public int getTrackColor() -
setAlpha
public void setAlpha(int alpha) Description copied from class:Drawable
Specify an alpha value for the drawable. 0 means fully transparent, and 255 means fully opaque. -
getAlpha
public int getAlpha()Description copied from class:Drawable
Gets the current alpha value for the drawable. 0 means fully transparent, 255 means fully opaque. This method is implemented by Drawable subclasses and the value returned is specific to how that class treats alpha. The default return value is 255 if the class does not override this method to return a value specific to its use of alpha. -
start
public void start()Description copied from interface:Animatable
Starts the drawable's animation.- Specified by:
start
in interfaceAnimatable
-
stop
public void stop()Description copied from interface:Animatable
Stops the drawable's animation.- Specified by:
stop
in interfaceAnimatable
-
isRunning
public boolean isRunning()Description copied from interface:Animatable
Indicates whether the animation is running.- Specified by:
isRunning
in interfaceAnimatable
- Returns:
- True if the animation is running, false otherwise.
-
setVisible
public boolean setVisible(boolean visible, boolean restart) Description copied from class:Drawable
Set whether this Drawable is visible. This generally does not impact the Drawable's behavior, but is a hint that can be used by some Drawables, for example, to decide whether run animations.- Overrides:
setVisible
in classDrawable
- Parameters:
visible
- Set to true if visible, false if not.restart
- You can supply true here to force the drawable to behave as if it has just become visible, even if it had last been set visible. Used for example to force animations to restart.- Returns:
- true if the new visibility is different from its previous state.
-