ripe / com.ripe.android.visual / Image

Image

class Image : Visual

Reactively updates the image of an ImageView whenever the state of its owner changes. An Image can be configured with the following options:

fun initialsBuilder(initials: String, engraving: String, view: ImageView): Map<String, Any> {
    return hashMapOf(
        "initials" to initials,
        "profile" to arrayOf(engraving)
    )
}

Constructors

<init>

Image(imageView: ImageView, owner: Ripe, options: Map<String, Any> = HashMap())

Constructs a new Image with the imageView, a Ripe instance as owner and a options map.

Properties

options

val options: Map<String, Any>

A map with options to configure the image.

owner

val owner: Ripe

The Ripe instance to be shown.

Functions

deinit

fun deinit(): Unit

The Image deinitializer, to be called (by the owner) when it should stop responding to updates so that any necessary cleanup operations can be executed.

update

fun update(state: Map<String, Any>): Unit

This function is called (by the owner) whenever its state changes so that the Image can update itself for the new state.