First of all I am struggling with this issue for a long time. I don't know how to figure out things, so I followed these steps and tutorials with no luck.
and a bunch of questions on StackOverflow. I wrote my own code also. May be I am doing something silly but am not able to figure it out.
mRecyclerView.setOnTouchListener((v, event) -> {
RectF rectf = new RectF((int) event.getX(),
(int) event.getY(),
0, 0);
boolean contains = getCenter(mHeaderPopUp).contains(rectf);
if (contains) {
Toast.makeText(mContext, "Clicked", Toast.LENGTH_SHORT).show();
}
return false;
});
private RectF getCenter(View view) {
Rect rect = new Rect();
view.getLocalVisibleRect(rect);
RectF dimens = new RectF((rect.left + rect.width() / 2),
(int) (rect.top + rect.height() / 2),
0, 0);
return dimens;
}
So now I have tried all of these things but I am not able to click through recyclerview to the view which is below recyclerview which you can see in the below image. recyclerview overlays all the views on the screen and I need to pass the click to below recyclerview I don't want to put those views above the recyclerview as when you scroll recyclerview it will be animatated and would cover all the views with its items. Thanks in advance. This is the image