ImageViewStyle.Builder

class ImageViewStyle.Builder


Builder for the ImageViewStyle.

Summary

Public constructors

Public functions

ImageViewStyle

Returns a subclass of BundledStyle built by this builder.

B

Sets the background.

B

Sets the background color, it will always override the setBackground, regardless of which set method is call first.

B
setLayoutMargin(start: Int, top: Int, end: Int, bottom: Int)

Sets the layout margin through the view's layout param.

ImageViewStyle.Builder
setMaxHeight(maxHeight: Int)

Sets a maximum height for the image view.

ImageViewStyle.Builder
setMaxWidth(maxWidth: Int)

Sets a maximum width for the image view.

B
setPadding(start: Int, top: Int, end: Int, bottom: Int)

Sets the padding.

ImageViewStyle.Builder

Sets the scale type of the image view.

ImageViewStyle.Builder
setTintList(imageTintList: ColorStateList)

Sets a tint color to the image view.

Protected properties

Bundle

Public constructors

Builder

Added in 1.1.0
Builder()

Public functions

build

Added in 1.1.0
fun build(): ImageViewStyle

Returns a subclass of BundledStyle built by this builder.

setBackground

Added in 1.1.0
fun setBackground(icon: Icon): B

Sets the background.

Parameters
icon: Icon

The icon to use as the background

setBackgroundColor

Added in 1.1.0
fun setBackgroundColor(color: @ColorInt Int): B

Sets the background color, it will always override the setBackground, regardless of which set method is call first.

Parameters
color: @ColorInt Int

the color of the background

setLayoutMargin

Added in 1.1.0
fun setLayoutMargin(start: Int, top: Int, end: Int, bottom: Int): B

Sets the layout margin through the view's layout param.

Note that the method takes start/end rather than left/right, respecting the layout direction.

Parameters
start: Int

the start margin size

top: Int

the top margin size

end: Int

the end margin size

bottom: Int

the bottom margin size

setMaxHeight

Added in 1.1.0
fun setMaxHeight(maxHeight: Int): ImageViewStyle.Builder

Sets a maximum height for the image view.

Parameters
maxHeight: Int

maximum height for this view

See also
setMaxHeight

setMaxWidth

Added in 1.1.0
fun setMaxWidth(maxWidth: Int): ImageViewStyle.Builder

Sets a maximum width for the image view.

Parameters
maxWidth: Int

maximum width for this view

See also
setMaxWidth

setPadding

Added in 1.1.0
fun setPadding(start: Int, top: Int, end: Int, bottom: Int): B

Sets the padding.

Note that the method takes start/end rather than left/right, respecting the layout direction.

Parameters
start: Int

the start padding in pixels

top: Int

the top padding in pixels

end: Int

the end padding in pixels

bottom: Int

the bottom padding in pixels

See also
setPadding

setScaleType

Added in 1.1.0
fun setScaleType(scaleType: ImageView.ScaleType): ImageViewStyle.Builder

Sets the scale type of the image view.

Parameters
scaleType: ImageView.ScaleType

The desired scaling mode.

See also
setScaleType

setTintList

Added in 1.1.0
fun setTintList(imageTintList: ColorStateList): ImageViewStyle.Builder

Sets a tint color to the image view.

Parameters
imageTintList: ColorStateList

the tint color to apply to the image

See also
setImageTintList

Protected properties

mBundle

protected val mBundleBundle