本文整理汇总了Java中com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder类的典型用法代码示例。如果您正苦于以下问题:Java EasyRecyclerViewHolder类的具体用法?Java EasyRecyclerViewHolder怎么用?Java EasyRecyclerViewHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EasyRecyclerViewHolder类属于com.camnter.easyrecyclerview.holder包,在下文中一共展示了EasyRecyclerViewHolder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
/**
* butt joint the onBindViewHolder and
* If you want to write logic in onBindViewHolder, you can write here
* 对接了onBindViewHolder
* onBindViewHolder里的逻辑写在这
*
* @param viewHolder viewHolder
* @param position position
*/
@Override public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) {
Contacts contacts = this.getItem(position);
if (contacts == null) return;
TextView headerTv = viewHolder.findViewById(R.id.section_header_tv);
ImageView sectionIv = viewHolder.findViewById(R.id.section_iv);
TextView nameTv = viewHolder.findViewById(R.id.section_name_tv);
if (!TextUtils.isEmpty(contacts.name)) {
nameTv.setText(contacts.name);
} else {
nameTv.setText("");
}
if (contacts.resId != 0) {
GlideUtils.displayNative(sectionIv, contacts.resId);
} else {
GlideUtils.displayNative(sectionIv, R.drawable.img_default_head);
}
this.setHeaderLogic(contacts, headerTv, viewHolder, position);
}
开发者ID:CaMnter,项目名称:EasyRecyclerViewSidebar,代码行数:30,代码来源:SectionAdapter.java
示例2: loadingWelfare
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
/**
* 加载 福利
*
* @param easyRecyclerViewHolder easyRecyclerViewHolder
* @param position position
*/
private void loadingWelfare(EasyRecyclerViewHolder easyRecyclerViewHolder, int position) {
BaseGankData baseGankData = this.getItem(position);
if (baseGankData == null) return;
RatioImageView welfareIV = easyRecyclerViewHolder.findViewById(R.id.welfare_iv);
if (position % 2 == 0) {
welfareIV.setImageRatio(0.7f);
} else {
welfareIV.setImageRatio(0.6f);
}
// 图片
if (TextUtils.isEmpty(baseGankData.url)) {
GlideUtils.displayNative(welfareIV, R.mipmap.img_default_gray);
} else {
GlideUtils.display(welfareIV, baseGankData.url);
}
}
开发者ID:CaMnter,项目名称:EasyGank,代码行数:25,代码来源:MainAdapter.java
示例3: onCreateViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType < 0) return null;
if (this.getItemLayouts() == null) return null;
int[] layoutIds = this.getItemLayouts();
if (layoutIds.length < 1) return null;
int itemLayoutId;
if (layoutIds.length == 1) {
itemLayoutId = layoutIds[0];
} else {
itemLayoutId = layoutIds[viewType];
}
View view = LayoutInflater.from(parent.getContext()).inflate(itemLayoutId, null);
view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
return new EasyRecyclerViewHolder(view);
}
开发者ID:CaMnter,项目名称:EasyRecyclerView,代码行数:18,代码来源:EasyRecyclerViewAdapter.java
示例4: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
/**
* butt joint the onBindViewHolder and
* If you want to write logic in onBindViewHolder, you can write here
* 对接了onBindViewHolder
* onBindViewHolder里的逻辑写在这
*
* @param viewHolder viewHolder
* @param position position
*/
@Override public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) {
int itemType = this.getRecycleViewItemType(position);
EasyRecyclerViewData data = this.getItem(position);
switch (itemType) {
case MULTIPLE_ITEM_TYPE: {
TextView multipleTV = viewHolder.findViewById(R.id.recycler_view_mul_tv);
ImageView multipleIV = viewHolder.findViewById(R.id.recycler_view_mul_iv);
multipleTV.setText(data.content);
multipleIV.setImageResource(data.imageResId);
break;
}
case SINGLE_ITEM_TYPE: {
ImageView singleIV = viewHolder.findViewById(R.id.recycler_view_single_iv);
singleIV.setImageResource(data.imageResId);
break;
}
}
}
开发者ID:CaMnter,项目名称:EasyRecyclerView,代码行数:28,代码来源:EasyDividerItemDecorationAdapter.java
示例5: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
/**
* 对接了 onBindViewHolder
* onBindViewHolder 里的逻辑写在这
*
* @param viewHolder viewHolder
* @param position position
*/
@Override public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) {
int itemType = this.getRecycleViewItemType(position);
RecyclerViewData data = this.getItem(position);
switch (itemType) {
case MULTIPLE_ITEM_TYPE: {
TextView multipleTV = viewHolder.findViewById(R.id.recycler_view_mul_tv);
ImageView multipleIV = viewHolder.findViewById(R.id.recycler_view_mul_iv);
multipleTV.setText(data.content);
multipleIV.setImageResource(data.imageResId);
break;
}
case SINGLE_ITEM_TYPE: {
ImageView singleIV = viewHolder.findViewById(R.id.recycler_view_single_iv);
singleIV.setImageResource(data.imageResId);
break;
}
}
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:26,代码来源:MyRecyclerViewAdapter.java
示例6: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@Override
public void onBindRecycleViewHolder(EasyRecyclerViewHolder easyRecyclerViewHolder, int i) {
SpanData spanData = this.getItem(i);
if (spanData == null) return;
int itemType = this.getRecycleViewItemType(i);
switch (itemType) {
case SpanData.CONTENT: {
TextView labelTV = easyRecyclerViewHolder.findViewById(R.id.span_label_tv);
TextView contentTV = easyRecyclerViewHolder.findViewById(R.id.span_content_tv);
if (spanData.getContent() != null) {
this.setSpanContent(labelTV, contentTV, spanData.getContent(), i);
} else {
contentTV.setText("??????");
labelTV.setText("??????");
}
break;
}
}
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:20,代码来源:SpanRecyclerAdapter.java
示例7: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@SuppressLint("SetTextI18n") @Override
public void onBindRecycleViewHolder(EasyRecyclerViewHolder easyRecyclerViewHolder, int position) {
int itemType = this.getRecycleViewItemType(position);
switch (itemType) {
case ITEM_SQL_LITE_OPERATION:
easyRecyclerViewHolder.findViewById(R.id.data_base_add_bt).setOnClickListener(this);
easyRecyclerViewHolder.findViewById(R.id.data_base_del_bt).setOnClickListener(this);
easyRecyclerViewHolder.findViewById(R.id.data_base_mod_bt).setOnClickListener(this);
easyRecyclerViewHolder.findViewById(R.id.data_base_query_bt)
.setOnClickListener(this);
break;
case ITEM_SQL_LITE_DATA:
SQLiteData data = (SQLiteData) this.getList().get(position);
TextView idTV = easyRecyclerViewHolder.findViewById(R.id.data_base_id_tv);
TextView contentTV = easyRecyclerViewHolder.findViewById(R.id.data_base_content_tv);
idTV.setText(data.id + "");
contentTV.setText(data.content + "");
break;
}
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:21,代码来源:SQLiteRecyclerViewAdapter.java
示例8: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@SuppressLint("SetTextI18n")
@Override
public void onBindRecycleViewHolder(EasyRecyclerViewHolder easyRecyclerViewHolder, int i) {
Class c = (Class) this.getList().get(i);
if (c == null) return;
TextView content = easyRecyclerViewHolder.findViewById(R.id.main_item_tv);
TextView type = easyRecyclerViewHolder.findViewById(R.id.main_item_type);
content.setText(c.getSimpleName());
if (showTag) {
type.setVisibility(View.VISIBLE);
if (c.getName().contains("drakeet")) {
type.setText("drakeet");
type.setTextColor(drakeetColor);
type.setBackgroundResource(R.drawable.bg_main_item_type_drakeet);
} else {
type.setText("CaMnter");
type.setTextColor(camnterColor);
type.setBackgroundResource(R.drawable.bg_main_item_type_camnter);
}
} else {
type.setVisibility(View.GONE);
}
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:26,代码来源:MainActivity.java
示例9: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@Override
public void onBindRecycleViewHolder(EasyRecyclerViewHolder easyRecyclerViewHolder, int position) {
int itemType = this.getRecycleViewItemType(position);
switch (itemType) {
case ITEM_PROVIDER_OPERATION:
easyRecyclerViewHolder.findViewById(R.id.provider_add_bt)
.setOnClickListener(this);
easyRecyclerViewHolder.findViewById(R.id.provider_del_bt)
.setOnClickListener(this);
easyRecyclerViewHolder.findViewById(R.id.provider_mod_bt)
.setOnClickListener(this);
easyRecyclerViewHolder.findViewById(R.id.provider_query_bt)
.setOnClickListener(this);
break;
case ITEM_PROVIDER_DATA:
ProviderData data = (ProviderData) this.getList().get(position);
TextView idTV = easyRecyclerViewHolder.findViewById(R.id.provider_id_tv);
TextView contentTV = easyRecyclerViewHolder.findViewById(
R.id.provider_content_tv);
idTV.setText(data.id + "");
contentTV.setText(data.content + "");
break;
}
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:25,代码来源:CustomContentProviderActivity.java
示例10: initListeners
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
private void initListeners() {
this.mainAdapter.setOnItemClickListener(new EasyRecyclerViewHolder.OnItemClickListener() {
@Override public void onItemClick(View view, int i) {
Class c = MainActivity.this.classes.get(i);
MainActivity.this.startActivity(new Intent(MainActivity.this, c));
}
});
}
开发者ID:CaMnter,项目名称:EasyLikeArea,代码行数:9,代码来源:MainActivity.java
示例11: setHeaderLogic
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
/**
* Set header logic
*
* @param contacts contacts
* @param headerTv headerTv
* @param viewHolder viewHolder
* @param position position
*/
@Override
public void setHeaderLogic(Contacts contacts, TextView headerTv, EasyRecyclerViewHolder viewHolder, int position) {
if (position != 0 && !contacts.top) {
Contacts pre = this.getItem(position - 1);
if (pre.top || !contacts.getHeader().equals(pre.getHeader())) {
this.setHeader(true, headerTv, contacts.getHeader());
} else {
this.setHeader(false, headerTv, null);
}
} else {
this.setHeader(false, headerTv, null);
}
}
开发者ID:CaMnter,项目名称:EasyRecyclerViewSidebar,代码行数:22,代码来源:RoundImageSectionAdapter.java
示例12: setHeaderLogic
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
/**
* Set header logic
*
* @param contacts contacts
* @param headerTv headerTv
* @param viewHolder viewHolder
* @param position position
*/
@Override
public void setHeaderLogic(Contacts contacts, TextView headerTv, EasyRecyclerViewHolder viewHolder, int position) {
if (position == 0) {
this.setHeader(true, headerTv, contacts.getHeader());
} else {
Contacts pre = this.getItem(position - 1);
if (!contacts.getHeader().equals(pre.getHeader())) {
this.setHeader(true, headerTv, contacts.getHeader());
} else {
this.setHeader(false, headerTv, null);
}
}
}
开发者ID:CaMnter,项目名称:EasyRecyclerViewSidebar,代码行数:22,代码来源:LetterSectionAdapter.java
示例13: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@Override
public void onBindRecycleViewHolder(EasyRecyclerViewHolder easyRecyclerViewHolder, int position) {
int layoutType = this.getRecycleViewItemType(position);
switch (layoutType) {
case LAYOUT_TYPE_DAILY:
this.loadingDaily(easyRecyclerViewHolder, position);
break;
case LAYOUT_TYPE_TECHNOLOGY:
this.loadingTechnology(easyRecyclerViewHolder, position);
break;
case LAYOUT_TYPE_WELFARE:
this.loadingWelfare(easyRecyclerViewHolder, position);
break;
}
}
开发者ID:CaMnter,项目名称:EasyGank,代码行数:16,代码来源:MainAdapter.java
示例14: loadingTechnology
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
/**
* 加载技术类型数据 ( Android、iOS、前端、拓展资源、App )
*
* @param easyRecyclerViewHolder easyRecyclerViewHolder
* @param position position
*/
private void loadingTechnology(EasyRecyclerViewHolder easyRecyclerViewHolder, int position) {
BaseGankData baseGankData = this.getItem(position);
if (baseGankData == null) return;
TextView dataDateTV = easyRecyclerViewHolder.findViewById(R.id.data_date_tv);
TextView dataTitleTV = easyRecyclerViewHolder.findViewById(R.id.data_title_tv);
TextView dataViaTV = easyRecyclerViewHolder.findViewById(R.id.data_via_tv);
TextView dataTagTV = easyRecyclerViewHolder.findViewById(R.id.data_tag_tv);
// 标题
if (TextUtils.isEmpty(baseGankData.desc)) {
dataTitleTV.setText("");
} else {
dataTitleTV.setText(baseGankData.desc.trim());
}
// 时间
if (baseGankData.publishedAt == null) {
dataDateTV.setText("");
} else {
dataDateTV.setText(DateUtils.getTimestampString(baseGankData.publishedAt));
}
// 小编
if (TextUtils.isEmpty(baseGankData.who)) {
dataViaTV.setText("");
} else {
dataViaTV.setText(this.context.getString(R.string.common_via, baseGankData.who));
}
if (TextUtils.isEmpty(baseGankData.url)) {
dataTagTV.setVisibility(View.GONE);
} else {
this.setTag(dataTagTV, baseGankData.url);
}
}
开发者ID:CaMnter,项目名称:EasyGank,代码行数:42,代码来源:MainAdapter.java
示例15: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@Override
public void onBindRecycleViewHolder(EasyRecyclerViewHolder easyRecyclerViewHolder, int position) {
List<BaseGankData> categoryData = this.getItem(position);
if (categoryData == null || categoryData.size() <= 0) return;
LinearLayout detailLL = easyRecyclerViewHolder.findViewById(R.id.daily_detail_ll);
detailLL.removeAllViews();
for (int i = 0; i < categoryData.size(); i++) {
final BaseGankData baseGankData = categoryData.get(i);
if (i == 0) {
TextView categoryTV = this.createCardCategory(baseGankData.type);
detailLL.addView(categoryTV);
detailLL.addView(this.createDivider());
}
if (GankTypeDict.urlType2TypeDict.get(baseGankData.type) == GankType.welfare) {
RatioImageView welfareIV = this.createRatioImageView();
GlideUtils.display(welfareIV, baseGankData.url);
welfareIV.setOnClickListener(v -> {
if (DailyDetailAdapter.this.onCardItemClickListener != null) {
DailyDetailAdapter.this.onCardItemClickListener.onWelfareOnClick(
baseGankData.url, baseGankData.desc, v);
}
});
detailLL.addView(welfareIV);
} else {
TextView itemText = this.createCardItemText(baseGankData);
detailLL.addView(itemText);
}
}
}
开发者ID:CaMnter,项目名称:EasyGank,代码行数:31,代码来源:DailyDetailAdapter.java
示例16: onBindViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
try {
EasyRecyclerViewHolder easyRecyclerViewHolder = (EasyRecyclerViewHolder) holder;
this.onBindRecycleViewHolder(easyRecyclerViewHolder, position);
easyRecyclerViewHolder.setOnItemClickListener(this.onItemClickListener, position);
easyRecyclerViewHolder.setOnItemLongClickListener(this.onItemLongClickListener,
position);
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:CaMnter,项目名称:EasyRecyclerView,代码行数:12,代码来源:EasyRecyclerViewAdapter.java
示例17: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
/**
* butt joint the onBindViewHolder and
* If you want to write logic in onBindViewHolder, you can write here
* 对接了onBindViewHolder
* onBindViewHolder里的逻辑写在这
*
* @param viewHolder viewHolder
* @param position position
*/
@Override public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) {
EasyRecyclerViewData data = this.getItem(position);
if (data == null) return;
ImageView borderIv = viewHolder.findViewById(R.id.border_item_iv);
TextView borderTv = viewHolder.findViewById(R.id.border_item_tv);
borderIv.setImageResource(data.imageResId);
borderTv.setText(data.content);
}
开发者ID:CaMnter,项目名称:EasyRecyclerView,代码行数:20,代码来源:EasyBorderDividerItemDecorationAdapter.java
示例18: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@SuppressLint("SetTextI18n")
@Override
public void onBindRecycleViewHolder(EasyRecyclerViewHolder easyRecyclerViewHolder, int i) {
Class c = (Class) this.getList().get(i);
if (c == null) return;
TextView content = easyRecyclerViewHolder.findViewById(R.id.main_item_tv);
TextView type = easyRecyclerViewHolder.findViewById(R.id.main_item_type);
content.setText(c.getSimpleName());
type.setVisibility(View.INVISIBLE);
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:12,代码来源:SmartRouterActivity.java
示例19: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@Override
public void onBindRecycleViewHolder(EasyRecyclerViewHolder easyRecyclerViewHolder, int i) {
int resId = (int) this.getList().get(i);
ImageView fourthRV = easyRecyclerViewHolder.findViewById(R.id.fourth_recycler_iv);
fourthRV.setImageResource(resId);
ViewGroup.LayoutParams params = fourthRV.getLayoutParams();
params.height = (int) Math.round(Math.random() * (MAX - MIN) + MIN);
fourthRV.setLayoutParams(params);
}
开发者ID:CaMnter,项目名称:Robotlegs4Android,代码行数:10,代码来源:TabLayoutFourthFragmentMediator.java
示例20: onBindRecycleViewHolder
import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; //导入依赖的package包/类
@Override public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) {
Class c = (Class) this.getList().get(position);
if (c == null) return;
TextView textView = viewHolder.findViewById(R.id.main_item_tv);
textView.setText(c.getSimpleName());
}
开发者ID:CaMnter,项目名称:EasyLikeArea,代码行数:7,代码来源:MainAdapter.java
注:本文中的com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论