Rabbit-R1/android (non root)/java/sources/androidx/databinding/ViewStubProxy.java

62 lines
2.2 KiB
Java
Raw Normal View History

2024-05-21 16:08:36 -05:00
package androidx.databinding;
import android.view.View;
import android.view.ViewStub;
/* loaded from: classes.dex */
public class ViewStubProxy {
private ViewDataBinding mContainingBinding;
private ViewStub.OnInflateListener mOnInflateListener;
private ViewStub.OnInflateListener mProxyListener;
private View mRoot;
private ViewDataBinding mViewDataBinding;
private ViewStub mViewStub;
public ViewDataBinding getBinding() {
return this.mViewDataBinding;
}
public View getRoot() {
return this.mRoot;
}
public ViewStub getViewStub() {
return this.mViewStub;
}
public boolean isInflated() {
return this.mRoot != null;
}
public void setContainingBinding(ViewDataBinding viewDataBinding) {
this.mContainingBinding = viewDataBinding;
}
public void setOnInflateListener(ViewStub.OnInflateListener onInflateListener) {
if (this.mViewStub != null) {
this.mOnInflateListener = onInflateListener;
}
}
public ViewStubProxy(ViewStub viewStub) {
ViewStub.OnInflateListener onInflateListener = new ViewStub.OnInflateListener() { // from class: androidx.databinding.ViewStubProxy.1
@Override // android.view.ViewStub.OnInflateListener
public void onInflate(ViewStub viewStub2, View view) {
ViewStubProxy.this.mRoot = view;
ViewStubProxy viewStubProxy = ViewStubProxy.this;
viewStubProxy.mViewDataBinding = DataBindingUtil.bind(viewStubProxy.mContainingBinding.mBindingComponent, view, viewStub2.getLayoutResource());
ViewStubProxy.this.mViewStub = null;
if (ViewStubProxy.this.mOnInflateListener != null) {
ViewStubProxy.this.mOnInflateListener.onInflate(viewStub2, view);
ViewStubProxy.this.mOnInflateListener = null;
}
ViewStubProxy.this.mContainingBinding.invalidateAll();
ViewStubProxy.this.mContainingBinding.forceExecuteBindings();
}
};
this.mProxyListener = onInflateListener;
this.mViewStub = viewStub;
viewStub.setOnInflateListener(onInflateListener);
}
}