use of com.chad.library.adapter.base.listener.OnItemChildClickListener 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);
}
Aggregations