I am trying to use match_parent height for my ViewPager to replace the fragment. But either layout_height="match_parent" or "wrap_content" not working. If i use them then my views become invisible.
Why does it only works when i do specify in dp? How do i make it to match_parent.
My XML Layout code: This is Fragment Layout replaced with FrameLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".Fragments.Frag.MyFragment">
<com.google.android.material.tabs.TabLayout
android:background="#drawable/toolbar"
android:id="#+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.viewpager.widget.ViewPager
android:background="#f1f1f1"
android:id="#+id/Viewpager"
android:layout_width="match_parent"
android:layout_height="600dp"/>
</LinearLayout>
My MainActivity which replaces above XML into FrameLayout
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#color/white_light2"
android:fitsSystemWindows="true">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
app:layout_scrollFlags="scroll|enterAlways"
style="#style/customToolBar"
android:id="#+id/toolbar1"
app:title="Home">
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_marginBottom="?attr/actionBarSize"
android:id="#+id/FragmentHolder"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</androidx.core.widget.NestedScrollView>
</androidx.drawerlayout.widget.DrawerLayout>
Output i am getting as
How can i avoid specifying ViewPager height in dp to take the entire screen space (match_parent)
you need just add android:fillViewport="true" property in your NestedScrollView tag!
You should do
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".Fragments.Frag.MyFragment">
<com.google.android.material.tabs.TabLayout
android:background="#drawable/toolbar"
android:id="#+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.viewpager.widget.ViewPager
android:background="#f1f1f1"
android:id="#+id/Viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/> <!-- here -->
</LinearLayout>
So i have checked that and i am able to see the frame layout with full width and height. Might solve your problem.
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar1"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:title="Home" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:id="#+id/FragmentHolder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/black"
android:backgroundTint="#color/black" />
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.drawerlayout.widget.DrawerLayout>
Related
I'm trying to make my search bar above my tabs but it appears behind it
This my xml file :
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.cloud.services.drmzr.MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.cloud.services.drmzr.MainActivity"
android:layout_above="#+id/topBar">
<include layout="#layout/user_search"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/topBar">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/tabs"
android:background="#drawable/white_grey_border_bottom">
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
</RelativeLayout>
<RelativeLayout
android:layout_below="#+id/topBar"
android:layout_above="#+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/container"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
</android.support.v4.view.ViewPager>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="120px"
android:id="#+id/bottomBar"
android:layout_alignParentBottom="true">
<android.support.design.widget.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/bottomNavView_Bar"
android:background="#drawable/white_grey_border_top"
app:menu="#menu/bottom_navigation_menu">
</android.support.design.widget.BottomNavigationView>
</RelativeLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
Honestly, this is not the best layout. Very expensive to measure all relative layouts wrapped to each other. Your elements appear behind each other because you made your view in relative which is very similar to frame layout. I think a better way to do it in ConstraintLayout. But if you want to make it in relative do it like that.
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/appBarLayout"
>
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/tabs"
android:background="#drawable/white_grey_border_bottom">
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/user_search"
android:id="#+id/user_search"
android:layout_below="#+id/appBarLayout"
android:layout_height="20dp"
android:layout_width="match_parent"
/>
<android.support.v4.view.ViewPager
android:layout_below="#+id/user_search"
android:layout_above="#+id/bottomNavView_Bar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="#+id/container"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
</android.support.v4.view.ViewPager>
<android.support.design.widget.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="120px"
android:id="#+id/bottomNavView_Bar"
android:background="#drawable/white_grey_border_top"
app:menu="#menu/bottom_navigation_menu"
android:layout_alignParentBottom="true">
</android.support.design.widget.BottomNavigationView>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
place your search layout below tab layout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.cloud.services.drmzr.MainActivity"
android:layout_below="#id/tab_layout">
<include layout="#layout/user_search"/>
</RelativeLayout>
check this line : android:layout_below="#id/tab_layout"
I am new to CoordinateLayout. I want my appBar to hide when listView in FrameLayout scroll up and show again when listView scroll down. But there is two problems.
1" FrameLayout getting out of the screen partially from below.
2" AppBar is not scrolling with listView.
In this below image the blue border is FrameLayout and it is out of screen from below.
Below is activity_main.xml;
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="#f9f8f8">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.ActionBar">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/container"
android:paddingRight="16dp"
android:paddingLeft="16dp"
app:layout_behavior="#string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
And below is fragment_main_list.xml to which I am populating in FrameLayout of activity_main.xml;
<FrameLayout 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="com.example.nishant.veuz.FragmentMainList">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/main_progress_bar"
android:layout_gravity="center"
android:visibility="gone"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/list_view_main"
android:dividerHeight="16dp"
android:divider="#null"/>
</FrameLayout>
Try to change your Parent Layout from CoordinatorLayout into LinearLayout, like so
...
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="#f9f8f8"
android:fitsSystemWindows="true">
...
from your NestedScrollView try to enclose it with;
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<!-- MAIN CONTENT-->
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/container"
android:paddingRight="16dp"
android:paddingLeft="16dp" />
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
I am using NestedScrollView which is used to hide toolbar on scroll but when i put
recyclerView inside it ,toolbar is not hiding on scroll and i used evry possible answer in stackoverflow but nothings worsks and specially i used recyclerView.setNestedScrollingEnabled(false);.
Here is my code:
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<RelativeLayout
android:layout_width="match_parent"
android:background="#fff"
android:layout_height="wrap_content"
>
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:background="#fafafa"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
--- EDIT-----------
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/DrawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="7dp">
<include
android:id="#+id/includeAppBar"
layout="#layout/app_bar_navigation_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.v7.widget.RecyclerView
android:id="#+id/RecyclerView"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="left"
android:background="#ffffff"
android:scrollbars="vertical">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.DrawerLayout>
----EDIT 2----
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
app:theme="#style/ToolBarStyle"
app:layout_scrollFlags="scroll|enterAlways"
android:layout_height="?attr/actionBarSize"
/>
<!-- our tablayout to display tabs -->
<android.support.design.widget.TabLayout
android:id="#+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
app:tabTextColor="#a6a2a2"
app:tabSelectedTextColor="#0099ff"
app:tabIndicatorColor="#0099ff"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
</android.support.design.widget.AppBarLayout>
<!-- View pager to swipe views -->
<android.support.v4.view.ViewPager
android:id="#+id/pager"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="fill_parent"/>
</android.support.design.widget.CoordinatorLayout>
You can try this, add this attibute to your AppBarLayout :
app:layout_scrollFlags="scroll|exitUntilCollapsed"
EDIT:
Change your code as below as well :
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/DrawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="7dp">
<include
android:id="#+id/includeAppBar"
layout="#layout/app_bar_navigation_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.v7.widget.RecyclerView
android:id="#+id/RecyclerView"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="left"
app:layout_behavior="#string/appbar_scrolling_view_behavior" // new attibute
android:background="#ffffff"
android:scrollbars="vertical">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.DrawerLayout>
Hope this helps.
Sorry for my english.
Problem: I have a RecyclerView and a Toolbar in a CoordinatorLayout.
The RecyclerView is below the Toolbar but it should not.
Question: How can I achieve that the RecyclerView and the Toolbar have one border?
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.ActionBar">
<include
android:id="#+id/toolbar_main"
layout="#layout/toolbar"></include>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="#+id/maschinelistcontainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.design.widget.CoordinatorLayout>
maschine_fragment.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbars="vertical" />
</LinearLayout>
Just add below lines to your parent layout i.e Linearlayout of maschine_fragment.xml
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
or else add this line to the Framelayout of activity_main.xml
app:layout_behavior="#string/appbar_scrolling_view_behavior"
It will work for you! :)
change your code to this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.ActionBar">
<include
android:id="#+id/toolbar_main"
layout="#layout/toolbar"></include>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior = "#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
Try adding the following line to `maschine_fragment.xmlm below android:layout_height="match_parent"of Linear layout
android:paddingTop="?attr/actionBarSize"
I have coded a simple fragment which couple of text views and a button , all in a RelativeLayout.
<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=".fragments.TutorialFragment">
<TextView
android:id="#+id/tuto_title"
style="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="#string/tutorial_title"/>
<TextView
android:id="#+id/tuto_msg"
style="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/tuto_title"
android:padding="20dp"
android:text="#string/tutorial_txt"/>
<Button
android:id="#+id/nextBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="15dp"
android:text="#string/next"/>
</RelativeLayout>
This fragment displays great on the StudioDesigner , however when executing the code the title is missing
The Activity Layout is
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:id="#+id/coordinatorLayout"
tools:context="com.crocodil.software.a1ccalc.A1CActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
It looks as the fragment calculates its available space before the toolbar is placed...
This is the Screen as I see it in the designer
Thanks for any hints
The problem is that the FrameLayout is behind the toolbar, the main way of adding a view within the coordinator layout that has a toolbar is to either set a margin or add app:layout_behavior="#string/appbar_scrolling_view_behavior" to the Framelayout
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:id="#+id/coordinatorLayout"
tools:context="com.crocodil.software.a1ccalc.A1CActivity">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/fragment_container"
android:layout_width="match_parent"
android:layout_marginTop="?attr/actionBarSize"
android:layout_height="match_parent" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
Take this attribute
app:layout_behavior="#string/appbar_scrolling_view_behavior"
and put it on the FrameLayout fragment_container.