FitWidthBitmapDrawable
public class FitWidthBitmapDrawable extends Drawable
| java.lang.Object | ||
| ↳ | android.graphics.drawable.Drawable | |
| ↳ | androidx.leanback.graphics.FitWidthBitmapDrawable |
Subclass of Drawable that can be used to draw a bitmap into a region. Bitmap will be scaled to fit the full width of the region and will be aligned to the top left corner. Any region outside the bounds will be clipped during draw call. Top position of the bitmap can be controlled by setVerticalOffset call or PROPERTY_VERTICAL_OFFSET.
Summary
Constants |
|
|---|---|
static final Property<FitWidthBitmapDrawable, Integer> |
Property for |
Public constructors |
|---|
Public methods |
|
|---|---|
void |
|
int |
getAlpha() |
Bitmap |
Returns the bitmap. |
Drawable.ConstantState |
|
int |
This method is deprecated. |
Rect |
Returns the |
int |
Returns the current vertical offset. |
Drawable |
mutate() |
void |
setAlpha(int alpha) |
void |
Sets the bitmap. |
void |
setColorFilter(ColorFilter colorFilter) |
void |
Sets the |
void |
setVerticalOffset(int offset)Sets the vertical offset which will be used for drawing the bitmap. |
Inherited methods |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Constants
PROPERTY_VERTICAL_OFFSET
public static final Property<FitWidthBitmapDrawable, Integer> PROPERTY_VERTICAL_OFFSET
Property for setVerticalOffset and getVerticalOffset.
Public constructors
Public methods
getVerticalOffset
public int getVerticalOffset()
Returns the current vertical offset.
| See also | |
|---|---|
PROPERTY_VERTICAL_OFFSET |
setSource
public void setSource(Rect source)
Sets the Rect used for extracting the bitmap.
setVerticalOffset
public void setVerticalOffset(int offset)
Sets the vertical offset which will be used for drawing the bitmap. The bitmap drawing will start the provided vertical offset.
| See also | |
|---|---|
PROPERTY_VERTICAL_OFFSET |