-
Notifications
You must be signed in to change notification settings - Fork 635
SwapLoadingRenderer
Builder
class for SwapLoadingRenderer
objects. Provides a convenient way to set the various fields of a SwapLoadingRenderer
.
Example:
LoadingRenderer loadingRenderer = new SwapLoadingRenderer.Builder(this)
.setWidth((int) DensityUtil.dip2px(this, 150))
.setHeight((int) DensityUtil.dip2px(this, 40))
.setBallRadius((int) DensityUtil.dip2px(this, 10))
.setBallInterval((int) DensityUtil.dip2px(this, 3))
.setStrokeWidth((int) DensityUtil.dip2px(this, 1))
.setColor(Color.CYAN)
.setDuration(4000)
.setBallCount(3)
.build();
public Builder
setWidth(int width)
Sets the width in px of the LoadingDrawable
which apply this LoadingRenderer
.
public Builder
setHeight(int height)
Sets the height in px of the LoadingDrawable
which apply this LoadingRenderer
.
public Builder
setDuration(int duration)
The length of the animation, in milliseconds. If this value is negative or zero will be ignored.
public Builder
setStrokeWidth(int strokeWidth)
Sets the stroke width in px of these hollow rings. If this value is negative or zero will be ignored.
public Builder
setBallRadius(int ballRadius)
Sets the radius in px of these balls. If this value is negative or zero will be ignored.
public Builder
setBallInterval(int ballInterval)
Sets the distance in px of between these balls. If this value is negative or zero will be ignored.
public Builder
setBallCount(int ballCount)
Sets the count of these balls. If this value is negative or zero will be ignored.
public Builder
setColor(int color)
Sets the color of these balls. If this value is zero will be ignored.