Skip to content

Instantly share code, notes, and snippets.

@patrick-elmquist
Last active July 11, 2017 19:51
Show Gist options
  • Save patrick-elmquist/553d882e4b2fa0b5737a50d1c32c4de9 to your computer and use it in GitHub Desktop.
Save patrick-elmquist/553d882e4b2fa0b5737a50d1c32c4de9 to your computer and use it in GitHub Desktop.
Frame by frame #1
public class SpinnerLoaderView extends View {
private final Paint mPaint = new Paint();
/** @see View#View(Context) */
public SpinnerLoaderView(Context context) {
super(context);
init();
}
/** @see View#View(Context, AttributeSet) */
public SpinnerLoaderView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
/** @see View#View(Context, AttributeSet, int) */
public SpinnerLoaderView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
private void init() {
// Sets the color of the progress bar
mPaint.setColor(Color.LTGRAY);
// Only the outline of a shape will be drawn
mPaint.setStyle(Paint.Style.STROKE);
// The start and end of the progress bar will have rounded edges
mPaint.setStrokeCap(Paint.Cap.ROUND);
// To get smoother shapes
mPaint.setAntiAlias(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment