Most visited

Recently visited

OnRebindCallback

public abstract class OnRebindCallback
extends Object

java.lang.Object
   ↳ android.databinding.OnRebindCallback<T extends android.databinding.ViewDataBinding>


Listener set on addOnRebindCallback(OnRebindCallback) that is called when bound values must be reevaluated in executePendingBindings().

Summary

Public constructors

OnRebindCallback()

Public methods

void onBound(T binding)

Called after values have been reevaluated in executePendingBindings().

void onCanceled(T binding)

Called after all callbacks have completed onPreBind(ViewDataBinding) when one or more of the calls has returned false.

boolean onPreBind(T binding)

Called when values in a ViewDataBinding should be reevaluated.

Inherited methods

From class java.lang.Object

Public constructors

OnRebindCallback

OnRebindCallback ()

Public methods

onBound

void onBound (T binding)

Called after values have been reevaluated in executePendingBindings(). This is only called if all listeners have returned true from onPreBind(ViewDataBinding).

The default implementation does nothing.

Parameters
binding T: The ViewDataBinding that is reevaluating its bound values.

onCanceled

void onCanceled (T binding)

Called after all callbacks have completed onPreBind(ViewDataBinding) when one or more of the calls has returned false.

The default implementation does nothing.

Parameters
binding T: The ViewDataBinding that is reevaluating its bound values.

onPreBind

boolean onPreBind (T binding)

Called when values in a ViewDataBinding should be reevaluated. This does not mean that values will actually change, but only that something in the data model that affects the bindings has been perturbed.

Return true to allow the reevaluation to happen or false if the reevaluation should be stopped. If false is returned, it is the responsibility of the OnRebindListener implementer to explicitly call executePendingBindings().

The default implementation only returns true.

Parameters
binding T: The ViewDataBinding that is reevaluating its bound values.
Returns
boolean true to indicate that the reevaluation should continue or false to halt evaluation.

Hooray!