本文整理匯總了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);
}