DeterminateDrawable
public
final
class
DeterminateDrawable
extends Drawable
implements
Animatable2Compat
This class draws the graphics for determinate mode.
Summary
Protected methods |
boolean
|
onLevelChange(int level)
When progress is updated, it changes the level of drawable's level and calls this method
afterward.
|
Inherited methods |
From class
android.graphics.drawable.Drawable
void
|
applyTheme(Resources.Theme arg0)
|
boolean
|
canApplyTheme()
|
void
|
clearColorFilter()
|
final
Rect
|
copyBounds()
|
final
void
|
copyBounds(Rect arg0)
|
static
Drawable
|
createFromPath(String arg0)
|
static
Drawable
|
createFromResourceStream(Resources arg0, TypedValue arg1, InputStream arg2, String arg3, BitmapFactory.Options arg4)
|
static
Drawable
|
createFromResourceStream(Resources arg0, TypedValue arg1, InputStream arg2, String arg3)
|
static
Drawable
|
createFromStream(InputStream arg0, String arg1)
|
static
Drawable
|
createFromXml(Resources arg0, XmlPullParser arg1)
|
static
Drawable
|
createFromXml(Resources arg0, XmlPullParser arg1, Resources.Theme arg2)
|
static
Drawable
|
createFromXmlInner(Resources arg0, XmlPullParser arg1, AttributeSet arg2, Resources.Theme arg3)
|
static
Drawable
|
createFromXmlInner(Resources arg0, XmlPullParser arg1, AttributeSet arg2)
|
abstract
void
|
draw(Canvas arg0)
|
int
|
getAlpha()
|
final
Rect
|
getBounds()
|
Drawable.Callback
|
getCallback()
|
int
|
getChangingConfigurations()
|
ColorFilter
|
getColorFilter()
|
Drawable.ConstantState
|
getConstantState()
|
Drawable
|
getCurrent()
|
Rect
|
getDirtyBounds()
|
void
|
getHotspotBounds(Rect arg0)
|
int
|
getIntrinsicHeight()
|
int
|
getIntrinsicWidth()
|
int
|
getLayoutDirection()
|
final
int
|
getLevel()
|
int
|
getMinimumHeight()
|
int
|
getMinimumWidth()
|
abstract
int
|
getOpacity()
|
Insets
|
getOpticalInsets()
|
void
|
getOutline(Outline arg0)
|
boolean
|
getPadding(Rect arg0)
|
int[]
|
getState()
|
Region
|
getTransparentRegion()
|
boolean
|
hasFocusStateSpecified()
|
void
|
inflate(Resources arg0, XmlPullParser arg1, AttributeSet arg2, Resources.Theme arg3)
|
void
|
inflate(Resources arg0, XmlPullParser arg1, AttributeSet arg2)
|
void
|
invalidateSelf()
|
boolean
|
isAutoMirrored()
|
boolean
|
isFilterBitmap()
|
boolean
|
isProjected()
|
boolean
|
isStateful()
|
final
boolean
|
isVisible()
|
void
|
jumpToCurrentState()
|
Drawable
|
mutate()
|
void
|
onBoundsChange(Rect arg0)
|
boolean
|
onLayoutDirectionChanged(int arg0)
|
boolean
|
onLevelChange(int arg0)
|
boolean
|
onStateChange(int[] arg0)
|
static
int
|
resolveOpacity(int arg0, int arg1)
|
void
|
scheduleSelf(Runnable arg0, long arg1)
|
abstract
void
|
setAlpha(int arg0)
|
void
|
setAutoMirrored(boolean arg0)
|
void
|
setBounds(int arg0, int arg1, int arg2, int arg3)
|
void
|
setBounds(Rect arg0)
|
final
void
|
setCallback(Drawable.Callback arg0)
|
void
|
setChangingConfigurations(int arg0)
|
void
|
setColorFilter(int arg0, PorterDuff.Mode arg1)
|
abstract
void
|
setColorFilter(ColorFilter arg0)
|
void
|
setDither(boolean arg0)
|
void
|
setFilterBitmap(boolean arg0)
|
void
|
setHotspot(float arg0, float arg1)
|
void
|
setHotspotBounds(int arg0, int arg1, int arg2, int arg3)
|
final
boolean
|
setLayoutDirection(int arg0)
|
final
boolean
|
setLevel(int arg0)
|
boolean
|
setState(int[] arg0)
|
void
|
setTint(int arg0)
|
void
|
setTintBlendMode(BlendMode arg0)
|
void
|
setTintList(ColorStateList arg0)
|
void
|
setTintMode(PorterDuff.Mode arg0)
|
boolean
|
setVisible(boolean arg0, boolean arg1)
|
void
|
unscheduleSelf(Runnable arg0)
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
androidx.vectordrawable.graphics.drawable.Animatable2Compat
abstract
void
|
clearAnimationCallbacks()
|
abstract
void
|
registerAnimationCallback(Animatable2Compat.AnimationCallback arg0)
|
abstract
boolean
|
unregisterAnimationCallback(Animatable2Compat.AnimationCallback arg0)
|
|
From interface
android.graphics.drawable.Animatable
abstract
boolean
|
isRunning()
|
abstract
void
|
start()
|
abstract
void
|
stop()
|
|
Public methods
addSpringAnimationEndListener
public void addSpringAnimationEndListener (DynamicAnimation.OnAnimationEndListener listener)
Parameters |
listener |
DynamicAnimation.OnAnimationEndListener |
clearAnimationCallbacks
public void clearAnimationCallbacks ()
Unregisters all AnimationCallback
from this drawable.
draw
public void draw (Canvas canvas)
getAlpha
public int getAlpha ()
getIntrinsicHeight
public int getIntrinsicHeight ()
getIntrinsicWidth
public int getIntrinsicWidth ()
getOpacity
public int getOpacity ()
hideNow
public boolean hideNow ()
Hides the drawable immediately without triggering animation callbacks.
isHiding
public boolean isHiding ()
isRunning
public boolean isRunning ()
isShowing
public boolean isShowing ()
jumpToCurrentState
public void jumpToCurrentState ()
Skips the animation of changing indicator length, directly displays the target progress.
registerAnimationCallback
public void registerAnimationCallback (Animatable2Compat.AnimationCallback callback)
Registers a new AnimationCallback
to this drawable. The onAnimationStart()
will
be called at the start of show animation, or at the moment this drawable is shown, if there's
no show animation is used. The onAnimationEnd()
will be called at the end of the hide
animation, or at the moment this drawable is hidden, if there's no hide animation is used.
Parameters |
callback |
Animatable2Compat.AnimationCallback : A new AnimationCallback to register. |
removeSpringAnimationEndListener
public void removeSpringAnimationEndListener (DynamicAnimation.OnAnimationEndListener listener)
Parameters |
listener |
DynamicAnimation.OnAnimationEndListener |
setAlpha
public void setAlpha (int alpha)
setColorFilter
public void setColorFilter (ColorFilter colorFilter)
Parameters |
colorFilter |
ColorFilter |
setVisible
public boolean setVisible (boolean visible,
boolean restart)
Parameters |
visible |
boolean |
restart |
boolean |
setVisible
public boolean setVisible (boolean visible,
boolean restart,
boolean animate)
Changes the visibility with/without triggering the animation callbacks.
Parameters |
visible |
boolean : Whether to make the drawable visible. |
restart |
boolean : Whether to force starting the animation from the beginning. |
animate |
boolean : Whether to change the visibility with animation. |
Returns |
boolean |
true , if the visibility changes or will change after the animation; false , otherwise. |
start
public void start ()
The drawable will start the main animation without show animator.
stop
public void stop ()
The drawable will stop the main animation without hide animator.
unregisterAnimationCallback
public boolean unregisterAnimationCallback (Animatable2Compat.AnimationCallback callback)
Unregisters an AnimationCallback
from this drawable.
Parameters |
callback |
Animatable2Compat.AnimationCallback : AnimationCallback to unregister. |
Returns |
boolean |
true , if callback is successfully registered; false , otherwise.
|
Protected methods
onLevelChange
protected boolean onLevelChange (int level)
When progress is updated, it changes the level of drawable's level and calls this method
afterward. It sets the new progress value to animation and starts the animation.
Parameters |
level |
int : New progress level.
|