Insets

class Insets(var start: Float = 0.0f, var top: Float = 0.0f, var end: Float = 0.0f, var bottom: Float = 0.0f) : HorizontalInsets

Used to store the insets requested by ChartInsetters.

Parameters

start

the start inset.

top

the top inset.

end

the end inset.

bottom

the bottom inset.

See also

Constructors

Link copied to clipboard
constructor(start: Float = 0.0f, top: Float = 0.0f, end: Float = 0.0f, bottom: Float = 0.0f)

Properties

Link copied to clipboard
Link copied to clipboard
var end: Float
Link copied to clipboard

The sum of the sizes of the start inset and the end inset.

Link copied to clipboard
Link copied to clipboard
var top: Float
Link copied to clipboard

The sum of the sizes of the top inset and the bottom inset.

Functions

Link copied to clipboard
fun clear()

Sets the size of each of the four insets to zero.

Link copied to clipboard
fun getLeft(isLtr: Boolean): Float

Returns the size of the left inset, taking into account the layout direction.

Link copied to clipboard
fun getRight(isLtr: Boolean): Float

Returns the size of the right inset, taking into account the layout direction.

Link copied to clipboard
fun set(other: Insets): Insets

Updates the size of each of the four insets to match the size of its corresponding inset from the provided Insets instance.

fun set(all: Float): Insets

Sets a common size for all four insets.

open override fun set(start: Float, end: Float)

Updates the sizes of the start inset and the end inset.

fun set(start: Float = 0.0f, top: Float = 0.0f, end: Float = 0.0f, bottom: Float = 0.0f): Insets

Updates the size of each of the four insets individually.

Link copied to clipboard
fun setAllIfGreater(start: Float = this.start, top: Float = this.top, end: Float = this.end, bottom: Float = this.bottom)

For each of the four insets, updates the size of the inset to the corresponding provided value if the corresponding provided value is greater.

Link copied to clipboard

Sets the sizes of the start inset and the end inset. value represents the sum of the two insets’ sizes, meaning the size of either inset will be half of value.

Link copied to clipboard

For each of the four insets, updates the size of the inset to the size of the corresponding inset from the provided Insets instance if the size of the corresponding inset from the provided Insets instance is greater.

open override fun setValuesIfGreater(start: Float, end: Float)

For the start and end insets, updates the value of the inset to the corresponding provided value if the provided value is greater than the current value.

Link copied to clipboard
fun setVertical(value: Float): Insets

Sets the sizes of the top inset and the bottom inset. value represents the sum of the two insets’ sizes, meaning the size of either inset will be half of value.