-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Recyclerview 嵌套时, item点击事件处理,子Recyclerview不响应父Recyclerview的点击 #2516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
我也遇到这个问题 ,我认为这个demo里面的写法 解决不了这个问题 |
@18810867174 你好,问题解决了吗 |
你好! 因为工作原因,已经离开当时的公司了,项目代码没有,拷到现在所在的公司环境里,晚上下班后看看代码才知道,等我晚上回复你.
…------------------ 原始邮件 ------------------
发件人: "Plain"<notifications@github.com>;
发送时间: 2020年4月10日(星期五) 上午10:50
收件人: "CymChad/BaseRecyclerViewAdapterHelper"<BaseRecyclerViewAdapterHelper@noreply.github.com>;
抄送: "小十三"<894670253@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [CymChad/BaseRecyclerViewAdapterHelper] Recyclerview 嵌套时, item点击事件处理,子Recyclerview不响应父Recyclerview的点击 (#2516)
@18810867174 你好,问题解决了吗
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@18810867174 谢谢,期待你的好消息 |
你好!不好意思,这两天事情较多一直没时间查看之前的代码, 刚刚看来之前写的代码, 是这么处理的,没有使用一级RecyclerView的 子控件点击监听,而是在二级RecyclerView 里面直接使用item点击监听实现的.因为这份代码是2018年的了,不知道现在有没有好的解决方法.
|
我遇到的情况是这样的,内部的 然后内部 当我为外层的 针对这个问题,我最后是这么处理的。 childAdapter.setOnItemClickListener((adapter, view, position) -> {
// 查看大图
}
});
// 将子RecyclerView的点击事件传给外层itemView进行处理
childRV.setOnTouchListener((v, event) -> itemView.onTouchEvent(event)); 🙏 最后感谢你的回复 ❤️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//Activity里面的监听
orderListAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@OverRide
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
switch (view.getId()){
case R.id.recycler_view://不走
Log.e("--11111111111--->>",position+"");
break;
case R.id.btn2://走
Log.e("--22222222222--->>",position+"");
break;
}
}
The text was updated successfully, but these errors were encountered: