本文整理匯總了Java中android.databinding.ViewDataBinding.getRoot方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewDataBinding.getRoot方法的具體用法?Java ViewDataBinding.getRoot怎麽用?Java ViewDataBinding.getRoot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.databinding.ViewDataBinding
的用法示例。
在下文中一共展示了ViewDataBinding.getRoot方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreateViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
@Override
public MultiRecyclerViewAdapter.BindingHolder onCreateViewHolder(ViewGroup parent, int viewType) {
ViewDataBinding binding;
if (viewType == 0) {
binding = DataBindingUtil.inflate(
LayoutInflater.from(parent.getContext()), R.layout.adapter_recycler_view_other, parent, false);
} else {
binding = DataBindingUtil.inflate(
LayoutInflater.from(parent.getContext()), R.layout.adapter_recycler_view, parent, false);
}
BindingHolder holder = new BindingHolder(binding.getRoot());
holder.setBinding(binding);
return holder;
}
示例2: loadComponent
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
@BindingAdapter("component")
public static void loadComponent(ViewGroup viewGroup, MvvmComponent component) {
if (component != null) {
ViewDataBinding binding = DataBindingUtil.inflate(LayoutInflater.from(viewGroup.getContext()), component.getLayoutResId(), viewGroup, false);
View view = binding.getRoot();
binding.setVariable(BR.vm, component.getViewModel());
binding.executePendingBindings();
viewGroup.removeAllViews();
viewGroup.addView(view);
}
}
示例3: getItemView
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
@Override
protected View getItemView(int layoutResId, ViewGroup parent) {
ViewDataBinding binding = DataBindingUtil.inflate(mLayoutInflater, layoutResId, parent, false);
if (binding == null) {
return super.getItemView(layoutResId, parent);
}
View view = binding.getRoot();
view.setTag(R.id.BaseQuickAdapter_databinding_support, binding);
return view;
}
示例4: onCreateRealViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
@Override
public RecyclerView.ViewHolder onCreateRealViewHolder(ViewGroup parent, int viewType) {
ViewDataBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.ext_adapter_item, parent, false);
//添加監聽器
binding.setVariable(BR.adapter, this);
ItemViewHolder holder = new ItemViewHolder(binding.getRoot());
holder.setBinding(binding);
return holder;
}
示例5: SwordsmanViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public SwordsmanViewHolder(ViewDataBinding binding) {
super(binding.getRoot());
this.binding = (ItemSwordsmanBinding) binding;
}
示例6: BookViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public BookViewHolder(ViewDataBinding binding, int variableId) {
super(binding.getRoot());
mBinding = binding;
mVariableId = variableId;
}
示例7: BaseViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
BaseViewHolder(ViewDataBinding binding) {
super(binding.getRoot());
mBinding = binding;
}
示例8: ViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
ViewHolder(ViewDataBinding binding, FileAdapter filesListAdapter) {
super(binding.getRoot());
mBinding = binding;
mAdapter = filesListAdapter;
binding.getRoot().setOnClickListener(this);
}
示例9: initItem
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
@Override
protected Object initItem(ViewGroup container, SwipeRecyclerViewModel item, String title, int position) {
ViewDataBinding binding = ViewModelBinder.bind(container, item);
return binding.getRoot();
}
示例10: DataBoundViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public DataBoundViewHolder(final ViewDataBinding binding, final P presenter) {
super(binding.getRoot());
this.binding = binding;
this.binding.setVariable(BR.presenter, presenter);
}
示例11: BindableViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public BindableViewHolder(ViewDataBinding binding) {
super(binding.getRoot());
this.dataBinding = binding;
}
示例12: DataBindingViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public DataBindingViewHolder(ViewDataBinding binding) {
super(binding.getRoot());
mBinding = binding;
}
示例13: BindingViewHolder
import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public BindingViewHolder(ViewDataBinding binding) {
super(binding.getRoot());
}