本文整理汇总了Java中com.zhy.base.adapter.recyclerview.CommonAdapter类的典型用法代码示例。如果您正苦于以下问题:Java CommonAdapter类的具体用法?Java CommonAdapter怎么用?Java CommonAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommonAdapter类属于com.zhy.base.adapter.recyclerview包,在下文中一共展示了CommonAdapter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.zhy.base.adapter.recyclerview.CommonAdapter; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.fragment_tab, container, false);
mRecyclerView = (RecyclerView) view
.findViewById(R.id.id_stickynavlayout_innerscrollview);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
// mTextView = (TextView) view.findViewById(R.id.id_info);
// mTextView.setText(mTitle);
for (int i = 0; i < 50; i++)
{
mDatas.add(mTitle + " -> " + i);
}
mRecyclerView.setAdapter(new CommonAdapter<String>(getActivity(), R.layout.item, mDatas)
{
@Override
public void convert(ViewHolder holder, String o)
{
holder.setText(R.id.id_info, o);
}
});
return view;
}
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:27,代码来源:TabFragment.java
示例2: onCreateView
import com.zhy.base.adapter.recyclerview.CommonAdapter; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_tab, container, false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.id_stickynavlayout_innerscrollview);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
for (int i = 0; i < 50; i++) {
mDatas.add(mTitle + " -> " + i);
}
mRecyclerView.setAdapter(new CommonAdapter<String>(getActivity(), R.layout.item, mDatas) {
@Override
public void convert(ViewHolder holder, String o) {
holder.setText(R.id.id_info, o);
}
});
return view;
}
开发者ID:wuhighway,项目名称:DailyStudy,代码行数:18,代码来源:TabFragment.java
示例3: onCreate
import com.zhy.base.adapter.recyclerview.CommonAdapter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recyclerview);
initDatas();
mRecyclerView = (RecyclerView) findViewById(R.id.id_recyclerview);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST));
// mRecyclerView.setAdapter(new CommonAdapter<String>(this, R.layout.item_list, mDatas)
// {
// @Override
// public void convert(ViewHolder holder, String s)
// {
// holder.setText(R.id.id_item_list_title, s);
//
// }
// });
mRecyclerView.setAdapter(new CommonAdapter<User>(this,R.layout.item_list,mDatas) {
@Override
public void convert(ViewHolder holder, User user) {
holder.setText(R.id.id_item_list_title,user.getName());
holder.setImageUrl(R.id.iv,user.getUrl());
}
});
}
开发者ID:Dreamer206602,项目名称:baseAdapter-master,代码行数:34,代码来源:RecyclerViewActivity.java
注:本文中的com.zhy.base.adapter.recyclerview.CommonAdapter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论