public class BootstrapProgressBar extends View implements ProgressView, BootstrapBrandView, RoundableView, BootstrapSizeView
KEY_ANIMATED, KEY_DRAWN_PROGRESS, KEY_STRIPED, KEY_USER_PROGRESS
KEY
KEY
KEY
Constructor and Description |
---|
BootstrapProgressBar(Context context) |
BootstrapProgressBar(Context context,
AttributeSet attrs) |
BootstrapProgressBar(Context context,
AttributeSet attrs,
int defStyleAttr) |
Modifier and Type | Method and Description |
---|---|
BootstrapBrand |
getBootstrapBrand() |
float |
getBootstrapSize()
Retrieves the scale factor that should be used to scale a view from its baseline size.
|
int |
getProgress() |
boolean |
isAnimated() |
boolean |
isRounded() |
boolean |
isStriped() |
protected void |
onDraw(Canvas canvas) |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onRestoreInstanceState(Parcelable state) |
Parcelable |
onSaveInstanceState() |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
void |
setAnimated(boolean animated)
Sets whether the view should animate itself.
|
void |
setBootstrapBrand(BootstrapBrand bootstrapBrand)
Changes the color of the view to match the given Bootstrap Brand
|
void |
setBootstrapSize(DefaultBootstrapSize bootstrapSize)
Convenience method that sets the scale factor using a default bootstrap size enum value.
|
void |
setBootstrapSize(float bootstrapSize)
Sets the scale factor that should be used to scale a view from its baseline size.
|
void |
setProgress(int progress)
Updates the amount of progress displayed to the user.
|
void |
setRounded(boolean rounded)
Sets whether the view should display rounded corners or not
|
void |
setStriped(boolean striped)
Sets whether the view should display a striped pattern.
|
public BootstrapProgressBar(Context context)
public BootstrapProgressBar(Context context, AttributeSet attrs)
public BootstrapProgressBar(Context context, AttributeSet attrs, int defStyleAttr)
public Parcelable onSaveInstanceState()
public void onRestoreInstanceState(Parcelable state)
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
protected void onSizeChanged(int w, int h, int oldw, int oldh)
protected void onDraw(Canvas canvas)
public void setProgress(int progress)
ProgressView
setProgress
in interface ProgressView
progress
- an integer between 0-100public int getProgress()
getProgress
in interface ProgressView
public void setStriped(boolean striped)
ProgressView
setStriped
in interface ProgressView
striped
- true for a striped pattern, false for a plain patternpublic boolean isStriped()
isStriped
in interface ProgressView
public void setAnimated(boolean animated)
ProgressView
setAnimated
in interface ProgressView
animated
- whether the view should animate its updates or not.public boolean isAnimated()
isAnimated
in interface ProgressView
public void setBootstrapBrand(@NonNull BootstrapBrand bootstrapBrand)
BootstrapBrandView
setBootstrapBrand
in interface BootstrapBrandView
bootstrapBrand
- the Bootstrap Brand@NonNull public BootstrapBrand getBootstrapBrand()
getBootstrapBrand
in interface BootstrapBrandView
public void setRounded(boolean rounded)
RoundableView
setRounded
in interface RoundableView
rounded
- whether the view should be roundedpublic boolean isRounded()
isRounded
in interface RoundableView
public float getBootstrapSize()
BootstrapSizeView
getBootstrapSize
in interface BootstrapSizeView
public void setBootstrapSize(float bootstrapSize)
BootstrapSizeView
setBootstrapSize
in interface BootstrapSizeView
bootstrapSize
- the scale factorpublic void setBootstrapSize(DefaultBootstrapSize bootstrapSize)
BootstrapSizeView
setBootstrapSize
in interface BootstrapSizeView
bootstrapSize
- a default scale factor