Most visited

Recently visited

ViewStubProxy

public class ViewStubProxy
extends Object

java.lang.Object
   ↳ android.databinding.ViewStubProxy


此类表示通货膨胀前后的ViewStub。 在通货膨胀之前,可以访问ViewStub。 通货膨胀后,充气布局的根视图将可用。 如果充气布局具有数据绑定,则可以访问充气视图的ViewDataBinding。

Summary

Public constructors

ViewStubProxy(ViewStub viewStub)

Public methods

ViewDataBinding getBinding()

一旦膨胀,返回与充气布局相关的数据绑定。

View getRoot()

一旦已经充气,返回替换ViewStub的布局的根视图。

ViewStub getViewStub()

如果ViewStub已被夸大,则返回布局中的ViewStub或 null

boolean isInflated()

返回 true如果ViewStub已经取代自身与膨胀的布局或 false如果不是。

void setContainingBinding(ViewDataBinding containingBinding)
void setOnInflateListener(ViewStub.OnInflateListener listener)

设置 ViewStub.OnInflateListener当ViewStub充气时被调用。

Inherited methods

From class java.lang.Object

Public constructors

ViewStubProxy

ViewStubProxy (ViewStub viewStub)

Parameters
viewStub ViewStub

Public methods

getBinding

ViewDataBinding getBinding ()

一旦膨胀,返回与充气布局相关的数据绑定。 null在通货膨胀之前或者如果没有与布局相关联的绑定。

Returns
ViewDataBinding the data binding associated with the inflated layout once it has been inflated. null prior to inflation or if there is no binding associated with the layout

getRoot

View getRoot ()

一旦已经充气,返回替换ViewStub的布局的根视图。 在通货膨胀前返回null

Returns
View the root View of the layout replacing the ViewStub once it has been inflated. null is returned prior to inflation

getViewStub

ViewStub getViewStub ()

如果ViewStub已膨胀,则返回布局中的ViewStub或 null

Returns
ViewStub the ViewStub in the layout or null if the ViewStub has been inflated.

isInflated

boolean isInflated ()

返回 true如果ViewStub已经取代自身与膨胀的布局或 false如果不是。

Returns
boolean true if the ViewStub has replaced itself with the inflated layout or false if not

setContainingBinding

void setContainingBinding (ViewDataBinding containingBinding)

Parameters
containingBinding ViewDataBinding

setOnInflateListener

void setOnInflateListener (ViewStub.OnInflateListener listener)

设置ViewStub.OnInflateListener当ViewStub充气时被调用。 该代理必须具有OnInflateListener,因此将在调用代理的侦听器后立即调用listener

Parameters
listener ViewStub.OnInflateListener: The OnInflateListener to notify of successful inflation

Hooray!