I have this layout:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:orientation="vertical">
<include
android:id="@+id/holder"
layout="@layout/live_result"/>
<RelativeLayout
android:id="@+id/stream_holder"
android:layout_width="match_parent"
android:layout_height="233dp">
<WebView
android:id="@+id/stream"
android:layout_width="317dp"
android:layout_height="233dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/offer"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
When holder view and stream holder view are shown periodically depending on state. Method setVisibility works fine on stream holder view, and it is appearing and disappearing properly. Problem is with included layout which is shown properly, but when I set visibility to GONE, it just leaves empty placeholder where it was. (It is gone but space is still there, just like if I called INIVSIBLE) Btw included layout is complex layout in which root hierarchy is LinearLayout.
Can anyone help me to configure this to hide this view?