CardStackView icon indicating copy to clipboard operation
CardStackView copied to clipboard

View element with the wrong size if the CardView contains padding.

Open extmkv opened this issue 7 years ago • 1 comments

After I added padding to the CardStackView and clipToPading=false the elements start to have the wrong width.

The only solution I founded to solve the problem is to calculate the element size inside of the update function:

private void update(RecyclerView.Recycler recycler) {
...
 for (int i = state.topPosition; i < state.topPosition + setting.visibleCount && i < getItemCount(); i++) {
            View child = recycler.getViewForPosition(i);

            ViewGroup.LayoutParams params = child.getLayoutParams();
            params.width = parentRight - parentLeft;
            params.height = parentBottom - parentTop;
            child.setLayoutParams(params);

            addView(child, 0);
...

Do you known any solution to this problem?

extmkv avatar Mar 21 '19 21:03 extmkv

same problem

lxxself avatar Sep 09 '20 07:09 lxxself