'Cropping at the bottom of the Expand/Collapse MotionLayout

I have used this article to create an expand/collapse cardview component with my own changes. Right now, whats happening is that when I expand the view, the botom part of the view is getting cropped. And, I am not able to find out why it is happening. Could anyone help me.? Here is the video of the behaviour: https://drive.google.com/file/d/1LCfhJFzstKyjIAJFvNP0JyQLdwXaBXad/view?usp=sharing

Thanks very much.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source