I have a Bottomsheet (with a recyclerview) with collapsed peekheight = 35 px where a small imageview is placed. After dismissing in the recyclerivew the position of this imageview is changed (from 42 px -> 80 px) and I didn't found the reason and any solution for this move.
Interessting aspect: Changing App-Theme to fullscreen, the problem doesn't appear. So it could also be a bug.
So i catch the Imageview position (getTop() -> 42) and set the catched position after the dismiss - code.
Unfortunately this does not work.
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) bottomSheet.getChildAt(0).getLayoutParams();
params.setMargins(0,8,0,0);
bottomSheet.getChildAt(0).setLayoutParams(params);
bottomSheet.getChildAt(0).requestLayout();
The code works, but after dismiss the Imageview changes its position and that wrong position is not changeable.
Seems, that the Snackbar ist the reason for my (dismiss) problem.
RecyclerView recyclerView = findViewById(R.id.recycler_view);
Snackbar snackbar = Snackbar
.make(recyclerView, "remove", Snackbar.LENGTH_SHORT);
I think the RecyclerView is the correct view for the snackbar, I tried also the bottomsheet-view. But the problem still exists.
Thanks for helping me GGK