public class BootstrapThumbnail extends ImageView implements RoundableView
Modifier and Type | Field and Description |
---|---|
protected float |
baselineBorderWidth |
protected float |
baselineOuterBorderWidth |
protected BootstrapBrand |
bootstrapBrand |
protected float |
bootstrapSize |
protected Paint |
borderPaint |
protected boolean |
hasBorder |
protected Paint |
imagePaint |
protected Bitmap |
sourceBitmap |
KEY
KEY
KEY_DISPLAYED
KEY
Constructor and Description |
---|
BootstrapThumbnail(Context context) |
BootstrapThumbnail(Context context,
AttributeSet attrs) |
BootstrapThumbnail(Context context,
AttributeSet attrs,
int defStyle) |
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.
|
ScaleType |
getScaleType() |
protected void |
initialise(AttributeSet attrs) |
boolean |
isBorderDisplayed() |
boolean |
isRounded() |
protected void |
onDraw(Canvas canvas) |
void |
onRestoreInstanceState(Parcelable state) |
Parcelable |
onSaveInstanceState() |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
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 |
setBorderDisplayed(boolean displayed)
Sets whether a border should be displayed or not
|
void |
setImageBitmap(Bitmap bm) |
void |
setImageDrawable(Drawable drawable) |
void |
setImageResource(int resId) |
void |
setImageURI(Uri uri) |
void |
setRounded(boolean rounded)
Sets whether the view should display rounded corners or not
|
void |
setScaleType(ScaleType scaleType) |
protected void |
updateImageState()
Called when the ImageView should alter its source bitmap, then invalidate itself.
|
protected BootstrapBrand bootstrapBrand
protected boolean hasBorder
protected float baselineBorderWidth
protected float baselineOuterBorderWidth
protected float bootstrapSize
protected Bitmap sourceBitmap
protected final Paint borderPaint
protected final Paint imagePaint
public BootstrapThumbnail(Context context)
public BootstrapThumbnail(Context context, AttributeSet attrs)
public BootstrapThumbnail(Context context, AttributeSet attrs, int defStyle)
public Parcelable onSaveInstanceState()
public void onRestoreInstanceState(Parcelable state)
protected void initialise(AttributeSet attrs)
protected void updateImageState()
protected void onDraw(Canvas canvas)
public void setRounded(boolean rounded)
RoundableView
setRounded
in interface RoundableView
rounded
- whether the view should be roundedpublic boolean isRounded()
isRounded
in interface RoundableView
protected void onSizeChanged(int w, int h, int oldw, int oldh)
public void setScaleType(ScaleType scaleType)
public ScaleType getScaleType()
public void setImageBitmap(Bitmap bm)
public void setImageDrawable(Drawable drawable)
public void setImageResource(int resId)
public void setImageURI(Uri uri)
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 setBorderDisplayed(boolean displayed)
BorderView
setBorderDisplayed
in interface BorderView
displayed
- whether a border should be displayed or notpublic boolean isBorderDisplayed()
isBorderDisplayed
in interface BorderView
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