public class RingRefresh
extends java.lang.Object
| 构造器和说明 |
|---|
RingRefresh(android.graphics.drawable.Drawable.Callback callback) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
draw(android.graphics.Canvas c,
android.graphics.RectF bounds)
Draw the progress spinner
|
int |
getAlpha() |
double |
getCenterRadius() |
float |
getEndTrim() |
float |
getInsets() |
int |
getNextColor() |
float |
getRotation() |
int |
getStartingColor() |
float |
getStartingEndTrim() |
float |
getStartingRotation() |
float |
getStartingStartTrim() |
float |
getStartTrim() |
float |
getStrokeWidth() |
void |
goToNextColor()
Proceed to the next available ring color.
|
void |
resetOriginals()
Reset the progress spinner to default rotation, start and end angles.
|
void |
setAlpha(int alpha) |
void |
setArrowDimensions(float width,
float height)
Set the dimensions of the arrowhead.
|
void |
setArrowScale(float scale) |
void |
setBackgroundColor(int color) |
void |
setCenterRadius(double centerRadius) |
void |
setColor(int color)
Set the absolute color of the progress spinner.
|
void |
setColorFilter(android.graphics.ColorFilter filter) |
void |
setColorIndex(int index) |
void |
setColors(int[] colors)
Set the colors the progress spinner alternates between.
|
void |
setEndTrim(float endTrim) |
void |
setInsets(int width,
int height) |
void |
setRotation(float rotation) |
void |
setShowArrow(boolean show) |
void |
setStartTrim(float startTrim) |
void |
setStrokeWidth(float strokeWidth) |
void |
storeOriginals()
If the start / end trim are offset to begin with, store them so that
animation starts from that offset.
|
public void setBackgroundColor(int color)
public void setArrowDimensions(float width,
float height)
width - Width of the hypotenuse of the arrow headheight - Height of the arrow pointpublic void draw(android.graphics.Canvas c,
android.graphics.RectF bounds)
public void setColors(@NonNull
int[] colors)
colors - Array of integers describing the colors. Must be non-null.public void setColor(int color)
color - int describing the color.public void setColorIndex(int index)
index - Index into the color array of the color to display in
the progress spinner.public int getNextColor()
public void goToNextColor()
public void setColorFilter(android.graphics.ColorFilter filter)
public void setAlpha(int alpha)
alpha - Set the alpha of the progress spinner and associated arrowhead.public int getAlpha()
public void setStrokeWidth(float strokeWidth)
strokeWidth - Set the stroke width of the progress spinner in pixels.public float getStrokeWidth()
public void setStartTrim(float startTrim)
public float getStartTrim()
public float getStartingStartTrim()
public float getStartingEndTrim()
public int getStartingColor()
public void setEndTrim(float endTrim)
public float getEndTrim()
public void setRotation(float rotation)
public float getRotation()
public void setInsets(int width,
int height)
public float getInsets()
public void setCenterRadius(double centerRadius)
centerRadius - Inner radius in px of the circle the progress
spinner arc traces.public double getCenterRadius()
public void setShowArrow(boolean show)
show - Set to true to show the arrow head on the progress spinner.public void setArrowScale(float scale)
scale - Set the scale of the arrowhead for the spinner.public float getStartingRotation()
public void storeOriginals()
public void resetOriginals()