Skip to content

GearLoadingRenderer

dinus_developer edited this page Aug 5, 2016 · 7 revisions

Builder class for GearLoadingRenderer objects. Provides a convenient way to set the various fields of a GearLoadingRenderer.
Example:

LoadingRenderer loadingRenderer = new GearLoadingRenderer.Builder(this)
        .setWidth((int) DensityUtil.dip2px(this, 50))
        .setHeight((int) DensityUtil.dip2px(this, 50))
        .setCenterRadius((int) DensityUtil.dip2px(this, 10))
        .setStrokeWidth((int) DensityUtil.dip2px(this, 4))
        .setDuration(1333)
        .setColor(Color.GREEN)
        .build();   

setWidth

public Builder setWidth(int width)

Sets the width in px of the LoadingDrawable which apply this LoadingRenderer. If this value is negative or zero will be ignored.

setHeight

public Builder setHeight(int height)

Sets the height in px of the LoadingDrawable which apply this LoadingRenderer. If this value is negative or zero will be ignored.

setStrokeWidth

public Builder setStrokeWidth(int strokeWidth)

Sets the stroke width of the progress spinner in pixels. If this value is negative or zero will be ignored.

setCenterRadius

public Builder setCenterRadius(int centerRadius)

Sets the inner radius in px of the circle the progress spinner arc traces. If this value is negative or zero will be ignored.

setDuration

public Builder setDuration(int duration)

The length of the animation, in milliseconds. If this value is negative or zero will be ignored.

setColor

public Builder setColor(int color)

Sets the color of the progress spinner. If this value is zero will be ignored.

setGearCount

public Builder setGearCount(int gearCount)

Sets the count of the progress spinner. If this value is negative or zero will be ignored

setGearSwipeDegrees

public Builder setGearSwipeDegrees(int gearSwipeDegrees)

Sets the max swipe angles of the progress spinner. If this value is negative or zero will be ignored