Binding

class Binding<V : Any, W : Any>

Binds a UI-managed view to model-managed content.

While view is bound to content, that content can change:

  • A placeholder can be swapped for loaded content. This happens when the model's loaded window moves to include the view.

  • Symmetrically, loaded content can be swapped for placeholder content, if the loaded window moves to exclude the view.

If it currently holds placeholder content, that placeholder content must be released to the processor's placeholder queue when it is no longer needed. This will occur if view is reused (due to view recycling), or because it is discarded (due to the view discarding it). This class assumes that a view that is discarded will never be bound again.

Properties

Link copied to clipboard
Link copied to clipboard
var view: V?

The currently-bound view. Null if this is not on-screen.

Functions

Link copied to clipboard
fun bind(view: V)
Link copied to clipboard
fun detach()
Link copied to clipboard
fun unbind()