Last active
July 11, 2017 19:51
-
-
Save patrick-elmquist/553d882e4b2fa0b5737a50d1c32c4de9 to your computer and use it in GitHub Desktop.
Frame by frame #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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