The problem is the following: There is the first layout1, on top of it, below layout2, when I click on the button I change layout2.setVisibility (VISIBLE), thereby showing layout2 only it covers the part of the list which is not visible at the bottom and elements that are at the bottom simply not visible no. How to make layout1 shrink when layout2 appears or how to cram it into a SnackBar ?? Thank you in advance
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fab="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.kombo.eplog.fragments.FragmentMusic"> <LinearLayout android:id="@+id/main" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipeController" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:id="@+id/musiclist" android:layout_width="match_parent" android:layout_height="wrap_content" ></android.support.v7.widget.RecyclerView> </android.support.v4.widget.SwipeRefreshLayout> </LinearLayout> <LinearLayout android:id="@+id/info_panel" android:layout_width="match_parent" android:layout_height="65dp" android:layout_alignParentBottom="true" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:background="@color/colorDevider"></LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:weightSum="13"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="2.6" android:background="?android:colorBackground"> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerInParent="true" android:layout_marginBottom="5dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="5dp" android:background="@drawable/corners_background" android:scaleType="center" android:src="@drawable/note_48x48" /> </RelativeLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1.85" android:background="?android:colorBackground" android:orientation="vertical"> <TextView android:id="@+id/bottom_name_of_composition" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:layout_marginTop="5dp" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true" android:text="Любов і сон" android:textColor="#000000" android:textSize="21sp" /> <TextView android:id="@+id/bottom_name_of_artist" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:layout_marginTop="5dp" android:text="Авет Макарян" android:textSize="15sp" /> </LinearLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="2.85"> <ImageButton android:id="@+id/skip_prev" android:layout_width="match_parent" android:layout_height="match_parent" android:background="?android:colorBackground" android:src="@drawable/ic_skip_previous_40dp" /> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="2.85"> <ImageButton android:id="@+id/pl_pause" android:layout_width="match_parent" android:layout_height="match_parent" android:background="?android:colorBackground" android:src="@drawable/ic_play_arrow_40dp" /> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="2.85"> <ImageButton android:id="@+id/skip_nxt" android:layout_width="match_parent" android:layout_height="match_parent" android:background="?android:colorBackground" android:src="@drawable/ic_skip_next_40dp" /> </RelativeLayout> </LinearLayout> </LinearLayout> </LinearLayout> 