本文整理汇总了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());
}