# ViewStubProxy

Summary:[Ctors](https://developer.android.com/reference/android/databinding/ViewStubProxy#pubctors)\|[Methods](https://developer.android.com/reference/android/databinding/ViewStubProxy#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/databinding/ViewStubProxy#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/databinding/ViewStubProxy#)  

# ViewStubProxy

`
public


class
ViewStubProxy
`  
`

extends `[Object](http://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|-----------------------------------|
| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.databinding.ViewStubProxy |

<br />

*** ** * ** ***

This class represents a ViewStub before and after inflation. Before inflation, the ViewStub is accessible. After inflation, the root View of the inflated layout will be available. If the inflated layout has data binding, the ViewDataBinding for the inflated View is accessible.

## Summary

|                                                                                                      ### Public constructors                                                                                                       ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ViewStubProxy](https://developer.android.com/reference/android/databinding/ViewStubProxy#ViewStubProxy(android.view.ViewStub))`(`[ViewStub](http://developer.android.com/reference/android/view/ViewStub.html)` viewStub) ` |

|                                                                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                                                                            ||
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[ViewDataBinding](https://developer.android.com/reference/android/databinding/ViewDataBinding) | ` `[getBinding](https://developer.android.com/reference/android/databinding/ViewStubProxy#getBinding())`() ` Returns the data binding associated with the inflated layout once it has been inflated.                                                                                                                                                                                                                                                                  |
| ` `[View](http://developer.android.com/reference/android/view/View.html)                          | ` `[getRoot](https://developer.android.com/reference/android/databinding/ViewStubProxy#getRoot())`() ` Returns the root View of the layout replacing the ViewStub once it has been inflated.                                                                                                                                                                                                                                                                          |
| ` `[ViewStub](http://developer.android.com/reference/android/view/ViewStub.html)                  | ` `[getViewStub](https://developer.android.com/reference/android/databinding/ViewStubProxy#getViewStub())`() ` Returns the ViewStub in the layout or`null`if the ViewStub has been inflated.                                                                                                                                                                                                                                                                          |
| ` boolean`                                                                                        | ` `[isInflated](https://developer.android.com/reference/android/databinding/ViewStubProxy#isInflated())`() ` Returns`true`if the ViewStub has replaced itself with the inflated layout or`false`if not.                                                                                                                                                                                                                                                               |
| ` void`                                                                                           | ` `[setContainingBinding](https://developer.android.com/reference/android/databinding/ViewStubProxy#setContainingBinding(android.databinding.ViewDataBinding))`(`[ViewDataBinding](https://developer.android.com/reference/android/databinding/ViewDataBinding)` containingBinding) `                                                                                                                                                                                 |
| ` void`                                                                                           | ` `[setOnInflateListener](https://developer.android.com/reference/android/databinding/ViewStubProxy#setOnInflateListener(android.view.ViewStub.OnInflateListener))`(`[ViewStub.OnInflateListener](http://developer.android.com/reference/android/view/ViewStub.OnInflateListener.html)` listener) ` Sets the[ViewStub.OnInflateListener](http://developer.android.com/reference/android/view/ViewStub.OnInflateListener.html)to be called when the ViewStub inflates. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/databinding/ViewStubProxy#)From class` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                               | | ` boolean`                                                                         | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                            | ` finalize() `                                                                            | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                            | | ` int`                                                                             | ` hashCode() `                                                                            | | ` final void`                                                                      | ` notify() `                                                                              | | ` final void`                                                                      | ` notifyAll() `                                                                           | | ` `[String](http://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                            | | ` final void`                                                                      | ` wait(long arg0, int arg1) `                                                             | | ` final void`                                                                      | ` wait(long arg0) `                                                                       | | ` final void`                                                                      | ` wait() `                                                                                | ||

## Public constructors

### ViewStubProxy

```
ViewStubProxy (ViewStub viewStub)
```

<br />

<br />

|          Parameters           ||
|------------|-------------------|
| `viewStub` | `ViewStub` <br /> |

## Public methods

### getBinding

```
ViewDataBinding getBinding ()
```

Returns 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.

<br />

|                                                                                                                               Returns                                                                                                                               ||
|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ViewDataBinding](https://developer.android.com/reference/android/databinding/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 <br /> |

### getRoot

```
View getRoot ()
```

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

<br />

|                                                                                             Returns                                                                                             ||
|-----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| [View](http://developer.android.com/reference/android/view/View.html) | the root View of the layout replacing the ViewStub once it has been inflated.`null`is returned prior to inflation <br /> |

### getViewStub

```
ViewStub getViewStub ()
```

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

<br />

|                                                                           Returns                                                                           ||
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| [ViewStub](http://developer.android.com/reference/android/view/ViewStub.html) | the ViewStub in the layout or`null`if the ViewStub has been inflated. <br /> |

### isInflated

```
boolean isInflated ()
```

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

<br />

|                                               Returns                                                ||
|-----------|-------------------------------------------------------------------------------------------|
| `boolean` | `true`if the ViewStub has replaced itself with the inflated layout or`false`if not <br /> |

### setContainingBinding

```
void setContainingBinding (ViewDataBinding containingBinding)
```

<br />

<br />

|                  Parameters                   ||
|---------------------|--------------------------|
| `containingBinding` | `ViewDataBinding` <br /> |

### setOnInflateListener

```
void setOnInflateListener (ViewStub.OnInflateListener listener)
```

Sets the[ViewStub.OnInflateListener](http://developer.android.com/reference/android/view/ViewStub.OnInflateListener.html)to be called when the ViewStub inflates. The proxy must have an OnInflateListener, so`listener`will be called immediately after the proxy's listener is called.

<br />

|                                                Parameters                                                ||
|------------|----------------------------------------------------------------------------------------------|
| `listener` | `ViewStub.OnInflateListener`: The OnInflateListener to notify of successful inflation <br /> |

-

  ## Annotations

  - [Bindable](https://developer.android.com/reference/android/databinding/Bindable)
  - [BindingAdapter](https://developer.android.com/reference/android/databinding/BindingAdapter)
  - [BindingConversion](https://developer.android.com/reference/android/databinding/BindingConversion)
  - [BindingMethod](https://developer.android.com/reference/android/databinding/BindingMethod)
  - [BindingMethods](https://developer.android.com/reference/android/databinding/BindingMethods)
  - [InverseBindingAdapter](https://developer.android.com/reference/android/databinding/InverseBindingAdapter)
  - [InverseBindingMethod](https://developer.android.com/reference/android/databinding/InverseBindingMethod)
  - [InverseBindingMethods](https://developer.android.com/reference/android/databinding/InverseBindingMethods)
  - [InverseMethod](https://developer.android.com/reference/android/databinding/InverseMethod)
-

  ## Interfaces

  - [DataBindingComponent](https://developer.android.com/reference/android/databinding/DataBindingComponent)
  - [InverseBindingListener](https://developer.android.com/reference/android/databinding/InverseBindingListener)
  - [Observable](https://developer.android.com/reference/android/databinding/Observable)
  - [ObservableList](https://developer.android.com/reference/android/databinding/ObservableList)
  - [ObservableMap](https://developer.android.com/reference/android/databinding/ObservableMap)
-

  ## Classes

  - [BaseObservable](https://developer.android.com/reference/android/databinding/BaseObservable)
  - [CallbackRegistry](https://developer.android.com/reference/android/databinding/CallbackRegistry)
  - [CallbackRegistry.NotifierCallback](https://developer.android.com/reference/android/databinding/CallbackRegistry.NotifierCallback)
  - [DataBindingUtil](https://developer.android.com/reference/android/databinding/DataBindingUtil)
  - [ListChangeRegistry](https://developer.android.com/reference/android/databinding/ListChangeRegistry)
  - [MapChangeRegistry](https://developer.android.com/reference/android/databinding/MapChangeRegistry)
  - [MergedDataBinderMapper](https://developer.android.com/reference/android/databinding/MergedDataBinderMapper)
  - [Observable.OnPropertyChangedCallback](https://developer.android.com/reference/android/databinding/Observable.OnPropertyChangedCallback)
  - [ObservableArrayList](https://developer.android.com/reference/android/databinding/ObservableArrayList)
  - [ObservableArrayMap](https://developer.android.com/reference/android/databinding/ObservableArrayMap)
  - [ObservableBoolean](https://developer.android.com/reference/android/databinding/ObservableBoolean)
  - [ObservableByte](https://developer.android.com/reference/android/databinding/ObservableByte)
  - [ObservableChar](https://developer.android.com/reference/android/databinding/ObservableChar)
  - [ObservableDouble](https://developer.android.com/reference/android/databinding/ObservableDouble)
  - [ObservableField](https://developer.android.com/reference/android/databinding/ObservableField)
  - [ObservableFloat](https://developer.android.com/reference/android/databinding/ObservableFloat)
  - [ObservableInt](https://developer.android.com/reference/android/databinding/ObservableInt)
  - [ObservableList.OnListChangedCallback](https://developer.android.com/reference/android/databinding/ObservableList.OnListChangedCallback)
  - [ObservableLong](https://developer.android.com/reference/android/databinding/ObservableLong)
  - [ObservableMap.OnMapChangedCallback](https://developer.android.com/reference/android/databinding/ObservableMap.OnMapChangedCallback)
  - [ObservableParcelable](https://developer.android.com/reference/android/databinding/ObservableParcelable)
  - [ObservableShort](https://developer.android.com/reference/android/databinding/ObservableShort)
  - [OnRebindCallback](https://developer.android.com/reference/android/databinding/OnRebindCallback)
  - [PropertyChangeRegistry](https://developer.android.com/reference/android/databinding/PropertyChangeRegistry)
  - [ViewDataBinding](https://developer.android.com/reference/android/databinding/ViewDataBinding)
  - [ViewStubProxy](https://developer.android.com/reference/android/databinding/ViewStubProxy)