Tell me how to make this socket below
enter image description here

This is how it looks on the layout.
enter image description here

So with the device running
enter image description here

activity_main.xml

<android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMode="fixed" app:tabGravity="fill"/> </android.support.design.widget.AppBarLayout> <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </android.support.design.widget.CoordinatorLayout> 

fragment_best.xml

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <android.support.v4.view.ViewPager android:id="@+id/pager1" android:layout_width="fill_parent" android:layout_height="fill_parent"> </android.support.v4.view.ViewPager> <include layout="@layout/toolbar_bottom"> </include> </RelativeLayout> 

toolbar_bottom.xml

 <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar_btm" android:layout_width="match_parent" android:layout_height="90dp" android:layout_alignParentBottom="true" android:background="?attr/colorPrimary" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> </android.support.v7.widget.Toolbar> 
  • Attach the markup - Android Android

1 answer 1

  1. Using ViewPager in a fragment leads to nesting of fragments, which is fraught with big problems.
  2. Using RelativeLayout in fragment_best.xml is not justified. Replace it with LinearLayout and set the weight for the ViewPager to 1
  3. Making the bottom pane through the Toolbar is a weird idea. Do this also simply via LinearLayout

In general, the problem can be in many places, incl. because of the CoordinatorLayout , which can be confused in such an abundance of nested entities.

  • Thanks a lot , really the main problem was in CoordinatorLayout - kalugin1912