how to get the BaseViewHolder helper instance in activity onItemChildClick
See original GitHub issue @Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
super.onItemChildClick(adapter, view, position);
switch (view.getId()) {
case R.id.tweetAvatar:
Toast.makeText(RecyclerClickItemActivity.this, "The " + Integer.toString(position)+" tweetAvatar is clicked", Toast.LENGTH_SHORT).show();
break;
case R.id.tweetName:
Toast.makeText(RecyclerClickItemActivity.this, "The " + Integer.toString(position)+"
// BaseViewHolder helper=(BaseViewHolder) mRecyclerView.getChildViewHolder(view); Toast.LENGTH_SHORT).show();
break;
default:
break;
}
I want BaseViewHolder helper instance to get other the view from item
ex: click on tweet name I should get bitmape drawable of tweetAvatar or any image view form the item !!
or
simply how do this helper.getView(R.id.tweetAvatar)); in activity onItemChildClick?? with position!!!
Tried with BaseViewHolder helper=(BaseViewHolder) mRecyclerView.getChildViewHolder(view);
not working
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How can I get Activity from RecyclerView.ViewHolder ...
Typically you would have one NavHostFragment per activity. Navigation — helper class for obtaining NavController instance and for connecting ...
Read more >com.chad.library.adapter.base.listener.OnItemClickListener
Example 1 with OnItemClickListener. use of com.chad.library.adapter.base.listener.OnItemClickListener in project BaseRecyclerViewAdapterHelper by CymChad.
Read more >com.chad.library.adapter.base.listener.OnItemDragListener
INSTANCE.e(TAG, "view swiped start: " + pos); } @Override public void clearView(RecyclerView. ... case 0: convert((BaseViewHolder) holder, mData.get(holder.
Read more >com.chad.library.adapter.base.BaseQuickAdapter Java Exaples
Example #1 ... getData().get(position); Help help; if (!StringUtil.trim(item. ... @Override public void onItemChildClick(BaseQuickAdapter adapter, ...
Read more >RecycleView的通用适配器BaseQuickAdapter处理item中子 ...
setText(R.id.tv_shopName, (CharSequence) item.get("shopName")) . ... @Override public void onItemChildClick(BaseQuickAdapter adapter, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tysheng Thank you for your answer,Another method by changing the data source to change the view of the item, not directly manipulate the view of the item
Don’t do like this, use
view.getParent()
and cast into ViewGroup, thenfindViewById()