use of com.chad.baserecyclerviewadapterhelper.entity.Status in project BaseRecyclerViewAdapterHelper by CymChad.
the class DefAdpater method onBindViewHolder.
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
Status status = sampleData.get(position);
holder.name.setText(status.getUserName());
holder.text.setText(status.getText());
holder.date.setText(status.getCreatedAt());
}
use of com.chad.baserecyclerviewadapterhelper.entity.Status in project BaseRecyclerViewAdapterHelper by CymChad.
the class DataServer method addData.
public static List<Status> addData(List list, int dataSize) {
for (int i = 0; i < dataSize; i++) {
Status status = new Status();
status.setUserName("Chad" + i);
status.setCreatedAt("04/05/" + i);
status.setRetweet(i % 2 == 0);
status.setUserAvatar("https://avatars1.githubusercontent.com/u/7698209?v=3&s=460");
status.setText("Powerful and flexible RecyclerAdapter https://github.com/CymChad/BaseRecyclerViewAdapterHelper");
list.add(status);
}
return list;
}
use of com.chad.baserecyclerviewadapterhelper.entity.Status in project BaseRecyclerViewAdapterHelper by CymChad.
the class AnimationUseActivity method initAdapter.
private void initAdapter() {
mAnimationAdapter = new AnimationAdapter();
mAnimationAdapter.openLoadAnimation();
mAnimationAdapter.setNotDoAnimationCount(mFirstPageItemCount);
mRecyclerView.addOnItemTouchListener(new OnItemChildClickListener() {
@Override
public void onSimpleItemChildClick(BaseQuickAdapter adapter, View view, int position) {
String content = null;
Status status = (Status) adapter.getItem(position);
switch(view.getId()) {
case R.id.img:
content = "img:" + status.getUserAvatar();
Toast.makeText(AnimationUseActivity.this, content, Toast.LENGTH_LONG).show();
break;
case R.id.tweetName:
content = "name:" + status.getUserName();
Toast.makeText(AnimationUseActivity.this, content, Toast.LENGTH_LONG).show();
break;
case R.id.tweetText:
// you have set clickspan .so there should not solve any click event ,just empty
break;
}
}
});
mRecyclerView.setAdapter(mAnimationAdapter);
}
use of com.chad.baserecyclerviewadapterhelper.entity.Status in project BaseRecyclerViewAdapterHelper by CymChad.
the class DataServer method getSampleData.
public static List<Status> getSampleData(int lenth) {
List<Status> list = new ArrayList<>();
for (int i = 0; i < lenth; i++) {
Status status = new Status();
status.setUserName("Chad" + i);
status.setCreatedAt("04/05/" + i);
status.setRetweet(i % 2 == 0);
status.setUserAvatar("https://avatars1.githubusercontent.com/u/7698209?v=3&s=460");
status.setText("BaseRecyclerViewAdpaterHelper https://www.recyclerview.org");
list.add(status);
}
return list;
}
Aggregations