本文整理汇总了Java中android.databinding.DataBindingUtil.getBinding方法的典型用法代码示例。如果您正苦于以下问题:Java DataBindingUtil.getBinding方法的具体用法?Java DataBindingUtil.getBinding怎么用?Java DataBindingUtil.getBinding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.databinding.DataBindingUtil
的用法示例。
在下文中一共展示了DataBindingUtil.getBinding方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HeaderViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
HeaderViewHolder(View itemView) {
super(itemView);
ActivityMovieHeaderBinding binding = DataBindingUtil.getBinding(itemView);
// 绑定数据
binding.setSubjectsBean(subjectsBean);
// ImgLoadUtil.displayGaussian(itemView.getContext(), subjectsBean.getImages().getLarge(), binding.imgItemBg);
// ImgLoadUtil.getInstance().displayEspImage(itemView.getContext(), subjectsBean.getImages().getLarge(), binding.ivOnePhoto);
// 删掉图片的下面三个状态栏的高度
if (binding.imgItemBg != null) {
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) binding.imgItemBg.getLayoutParams();
layoutParams.setMargins(0, -3 * StatusBarUtil.getStatusBarHeight(itemView.getContext()), 0, 0);
}
}
示例2: FooterViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
FooterViewHolder(View itemView) {
super(itemView);
mBindFooter = DataBindingUtil.getBinding(itemView);
mBindFooter.rlMore.setGravity(Gravity.CENTER);
// LinearLayoutCompat.LayoutParams params = new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ScreenUtils.dipToPx(context, 40));
// itemView.setLayoutParams(params);
}
示例3: onBindViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
@Override
public final void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads) {
if (isForDataBinding(payloads)) {
ViewDataBinding binding = DataBindingUtil.getBinding(holder.itemView);
binding.executePendingBindings();
} else {
super.onBindViewHolder(holder, position, payloads);
}
}
示例4: BaseRecyclerViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
public BaseRecyclerViewHolder(ViewGroup viewGroup, int layoutId) {
// 注意要依附 viewGroup,不然显示item不全!!
super(DataBindingUtil.inflate(LayoutInflater.from(viewGroup.getContext()), layoutId, viewGroup, false).getRoot());
// 得到这个View绑定的Binding
binding = DataBindingUtil.getBinding(this.itemView);
}
示例5: HeaderViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
HeaderViewHolder(View view) {
super(view);
mBindBook = DataBindingUtil.getBinding(view);
}
示例6: BookViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
BookViewHolder(View view) {
super(view);
mBindBook = DataBindingUtil.getBinding(view);
}
示例7: BaseViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
public BaseViewHolder(ViewGroup parent, int layoutId) {
super(DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()),layoutId, parent, false).getRoot());
itemViewBinding = DataBindingUtil.getBinding(itemView);
}
示例8: BaseRecyclerViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
public BaseRecyclerViewHolder(ViewGroup viewGroup, int layoutId) {
super(DataBindingUtil.inflate(LayoutInflater.from(viewGroup.getContext()), layoutId, viewGroup, false).getRoot());
mBinding = DataBindingUtil.getBinding(this.itemView);
}
示例9: initInputView
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
@Override
protected void initInputView(BaseViewHolder holder) {
ViewDataBinding dataBinding = DataBindingUtil.getBinding(holder.itemView);
initInputView(dataBinding);
}
示例10: onBindViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(BaseViewHolder holder, T data) {
ViewDataBinding dataBinding = DataBindingUtil.getBinding(holder.itemView);
onBindViewHolder(dataBinding, data);
// dataBinding.executePendingBindings();
}
示例11: BaseRecyclerViewHolder
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
BaseRecyclerViewHolder(ViewGroup viewGroup, int layoutId) {
super(DataBindingUtil.inflate(LayoutInflater.from(
viewGroup.getContext()), layoutId, viewGroup, false).getRoot());
binding = DataBindingUtil.getBinding(this.itemView);
}
示例12: getBinding
import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
protected final <T extends ViewDataBinding> T getBinding() {
if (null == binding && null == (binding = DataBindingUtil.getBinding(rootView))) {
binding = DataBindingUtil.bind(rootView);
}
return Utils.cast(binding);
}