FitWidthBitmapDrawable
open class FitWidthBitmapDrawable : Drawable
kotlin.Any | ||
↳ | 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(Canvas)
call. Top position of the bitmap can be controlled by setVerticalOffset(int)
call or PROPERTY_VERTICAL_OFFSET
.
Summary
Public constructors | |
---|---|
<init>() |
Public methods | |
---|---|
open Unit | |
open Int |
getAlpha() |
open Bitmap! |
Returns the bitmap. |
open ConstantState? | |
open Int | |
open Rect! |
Returns the |
open Int |
Returns the current vertical offset. |
open Drawable |
mutate() |
open Unit | |
open Unit |
Sets the bitmap. |
open Unit |
setColorFilter(colorFilter: ColorFilter?) |
open Unit |
Sets the |
open Unit |
setVerticalOffset(offset: Int) Sets the vertical offset which will be used for drawing the bitmap. |
Properties | |
---|---|
static Property<FitWidthBitmapDrawable!, Int!>! |
Property for |
Public constructors
<init>
FitWidthBitmapDrawable()
Public methods
getConstantState
open fun getConstantState(): ConstantState?
getOpacity
open fun getOpacity(): Int
mutate
open fun mutate(): Drawable
setColorFilter
open fun setColorFilter(colorFilter: ColorFilter?): Unit
setVerticalOffset
open 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
Properties
PROPERTY_VERTICAL_OFFSET
static val PROPERTY_VERTICAL_OFFSET: Property<FitWidthBitmapDrawable!, Int!>!
Property for setVerticalOffset(int)
and getVerticalOffset()
.