My child LinearLayout has a dynamic height, it can change at runtime, it can contain images and consists of a different number of child views (which can also have children).
This LinearLayout child is inside a CardView. Now I want this type of card to be collapsible. In other words, when it crashes, it should have a lower height (e.g. 150dp). In this mode, the map should only display the top 150dp (minus fill) of the LinearLayout child content. But LinearLayout should have a maximum size (although the lower border below the CardView border is not shown, cropped), setting its height as wrap_content. This is similar to what would happen if I placed a ScrollView (when scrolling up) instead of CardView. But when I do it using CardView. LinearLayout does not take the maximum height to wrap the growth of its children, instead, it occupies the height limited by its parent card.
This results in lower image scaling and can lead to many unexpected errors.
Is there a way to achieve functionality? Is there a different type of layout, other than card cards, that directly supports kruping and displays only part of its contents, while the child feels that it can expand unlimitedly.
source
share