Android APIs
public abstract class

OnRebindCallback

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

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public OnRebindCallback ()

Public Methods

public 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 The ViewDataBinding that is reevaluating its bound values.

public 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 The ViewDataBinding that is reevaluating its bound values.

public 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 The ViewDataBinding that is reevaluating its bound values.
Returns
  • true to indicate that the reevaluation should continue or false to halt evaluation.