当前位置: 首页>>代码示例>>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;未经允许,请勿转载。