當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewDataBinding.getRoot方法代碼示例

本文整理匯總了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;
}
 
開發者ID:alidili,項目名稱:Demos,代碼行數:17,代碼來源:MultiRecyclerViewAdapter.java

示例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);
    }
}
 
開發者ID:wongcain,項目名稱:okuki,代碼行數:12,代碼來源:ViewGroupBindings.java

示例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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:DataBindingUseAdapter.java

示例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;
}
 
開發者ID:conghaonet,項目名稱:recyclerview-ext,代碼行數:10,代碼來源:MyExtAdapter.java

示例5: SwordsmanViewHolder

import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public SwordsmanViewHolder(ViewDataBinding binding) {
    super(binding.getRoot());
    this.binding = (ItemSwordsmanBinding) binding;
}
 
開發者ID:henrymorgen,項目名稱:android-advanced-light,代碼行數:5,代碼來源:SwordsmanAdapter.java

示例6: BookViewHolder

import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public BookViewHolder(ViewDataBinding binding, int variableId) {
  super(binding.getRoot());
  mBinding = binding;
  mVariableId = variableId;
}
 
開發者ID:douo,項目名稱:ActivityBuilder,代碼行數:6,代碼來源:BookListAdapter.java

示例7: BaseViewHolder

import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
BaseViewHolder(ViewDataBinding binding) {
    super(binding.getRoot());
    mBinding = binding;
}
 
開發者ID:JarvanMo,項目名稱:MarsBootProject,代碼行數:5,代碼來源:RecyclerViewAdapter.java

示例8: ViewHolder

import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
ViewHolder(ViewDataBinding binding, FileAdapter filesListAdapter) {
    super(binding.getRoot());
    mBinding = binding;
    mAdapter = filesListAdapter;
    binding.getRoot().setOnClickListener(this);
}
 
開發者ID:Applandeo,項目名稱:Material-File-Picker,代碼行數:7,代碼來源:FileAdapter.java

示例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();
}
 
開發者ID:Mindjet,項目名稱:LiteReader,代碼行數:6,代碼來源:ReviewViewPagerAdapter.java

示例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);
}
 
開發者ID:PacktPublishing,項目名稱:Hands-On-Android-UI-Development,代碼行數:6,代碼來源:DataBoundViewHolder.java

示例11: BindableViewHolder

import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public BindableViewHolder(ViewDataBinding binding) {
    super(binding.getRoot());
    this.dataBinding = binding;

}
 
開發者ID:neurospeech,項目名稱:ui-atoms-android,代碼行數:6,代碼來源:AtomListView.java

示例12: DataBindingViewHolder

import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public DataBindingViewHolder(ViewDataBinding binding) {
    super(binding.getRoot());
    mBinding = binding;
}
 
開發者ID:nicholasrout,項目名稱:shortstories,代碼行數:5,代碼來源:DataBindingViewHolder.java

示例13: BindingViewHolder

import android.databinding.ViewDataBinding; //導入方法依賴的package包/類
public BindingViewHolder(ViewDataBinding binding) {
    super(binding.getRoot());
}
 
開發者ID:zxmmmmmm,項目名稱:Mvvm,代碼行數:4,代碼來源:MvvmAdapter.java


注:本文中的android.databinding.ViewDataBinding.getRoot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。