FitWidthBitmapDrawable
class FitWidthBitmapDrawable : Drawable
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 |
|
|---|---|
const Property<FitWidthBitmapDrawable!, Int!>! |
Property for |
Public constructors |
|---|
Public functions |
|
|---|---|
Unit |
|
Int |
getAlpha() |
Bitmap! |
Returns the bitmap. |
Drawable.ConstantState! |
|
Int |
This function is deprecated. |
Rect! |
Returns the |
Int |
Returns the current vertical offset. |
Drawable! |
mutate() |
Unit |
|
Unit |
Sets the bitmap. |
Unit |
setColorFilter(colorFilter: ColorFilter!) |
Unit |
Sets the |
Unit |
setVerticalOffset(offset: Int)Sets the vertical offset which will be used for drawing the bitmap. |
Constants
PROPERTY_VERTICAL_OFFSET
const val PROPERTY_VERTICAL_OFFSET: Property<FitWidthBitmapDrawable!, Int!>!
Property for setVerticalOffset and getVerticalOffset.
Public constructors
Public functions
getVerticalOffset
fun getVerticalOffset(): Int
Returns the current vertical offset.
| See also | |
|---|---|
PROPERTY_VERTICAL_OFFSET |
setSource
fun setSource(source: Rect!): Unit
Sets the Rect used for extracting the bitmap.
setVerticalOffset
fun setVerticalOffset(offset: Int): Unit
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 |