Scalable view inside RecyclerView

Viewed 70

I have a scalable view inside ViewHolder, scale works like this:

private void applyScaleAndTranslation() {
     child().setScaleX(scale);
     child().setScaleY(scale);
     child().setTranslationX(dx);
     child().setTranslationY(dy);
}

If the view is placed in XML everything works fine, but in RecyclerView I can see that the view is outside the container.

I know about RecyclerView.ChildDrawingOrderCallback, I can change the order, but I can't disable it.

Is it possible to disable drawing outside container or maybe I can scale view with another way?

Things like android:clipChildren="false" didn't help.

Here's a screenshot of the problem:

The views overlap and clip into each other.

0 Answers
Related