當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。