当前位置: 首页>>代码示例>>Java>>正文


Java DataBindingUtil.getBinding方法代码示例

本文整理汇总了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);
            }
        }
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:15,代码来源:MovieDetailPersonAdapter.java

示例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);
        }
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:8,代码来源:BookAdapter.java

示例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);
    }
}
 
开发者ID:zxmmmmmm,项目名称:Mvvm,代码行数:10,代码来源:MvvmAdapter.java

示例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);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:7,代码来源:BaseRecyclerViewHolder.java

示例5: HeaderViewHolder

import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
HeaderViewHolder(View view) {
    super(view);
    mBindBook = DataBindingUtil.getBinding(view);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:5,代码来源:BookAdapter.java

示例6: BookViewHolder

import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
BookViewHolder(View view) {
    super(view);
    mBindBook = DataBindingUtil.getBinding(view);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:5,代码来源:BookAdapter.java

示例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);

}
 
开发者ID:monkeywiiu,项目名称:Discover,代码行数:6,代码来源:BaseViewHolder.java

示例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);
}
 
开发者ID:wutongke,项目名称:AndroidSkinAnimator,代码行数:5,代码来源:BaseRecyclerViewHolder.java

示例9: initInputView

import android.databinding.DataBindingUtil; //导入方法依赖的package包/类
@Override
protected void initInputView(BaseViewHolder holder) {
    ViewDataBinding dataBinding = DataBindingUtil.getBinding(holder.itemView);
    initInputView(dataBinding);
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:6,代码来源:DataBindItemInput.java

示例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();
    }
 
开发者ID:free46000,项目名称:MultiItem,代码行数:7,代码来源:BindViewHolderManager.java

示例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);
}
 
开发者ID:aa352160,项目名称:BindingRecyclerAdapter,代码行数:6,代码来源:BindingRecyclerAdapter.java

示例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);
}
 
开发者ID:zxmmmmmm,项目名称:Mvvm,代码行数:7,代码来源:MvvmActivity.java


注:本文中的android.databinding.DataBindingUtil.getBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。