Hide additional ui elements from element view first by calling
(some_ui_element).setVisibility(View.GONE);
In an element, click, select the elements by calling
(some_ui_element).setVisibility(View.VISIBLE);
and make sure that the element’s layout in xml is set to wrap-content for its layout height. The cardview (or listview) element has been modified to display ui elements.