Place a FAB in a Fragment - android

Good afternoon,
I am trying to put a FAB at the bottom|end of a fragment, but I do not know where I can place it.
Here is the Fragment's xml code :
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/cars_list_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/scrollable_layout">
<include layout="#layout/write_comment"/>
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>
And the FAB :
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="#dimen/fab_margin"
android:src="#drawable/ic_plus" />
Thanks for your help !
An answer helped me to have a first "solution" with this code :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/cars_list_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/scrollable_layout">
<include layout="#layout/write_comment"/>
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="#dimen/fab_margin"
android:src="#drawable/ic_plus"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
</RelativeLayout>
But it does not work correctly :

Try this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/cars_list_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/scrollable_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_margin="#dimen/fab_margin"
android:src="#drawable/ic_photo_camera_white"
app:backgroundTint="#color/colorFabButton" />
</RelativeLayout>

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/image12"
android:layout_width="match_parent"
android:layout_height="250dp"
android:alpha="0.5"
android:src="#drawable/lawbook"
android:scaleType="fitXY"/>
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/profile_image"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="#drawable/aliyar"
android:layout_above="#+id/text121"
android:layout_centerHorizontal="true"
android:layout_marginBottom="71dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/image12"
android:textSize="14sp"
android:layout_marginTop="40dp"
android:id="#+id/text121"
android:text="#string/aliyar1"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/text121"
android:layout_marginTop="5dp"
android:textSize="14sp"
android:text="#string/aliyar2"
android:id="#+id/text122"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/text122"
android:layout_marginTop="5dp"
android:text="#string/aliyar3"
android:textSize="14sp"
android:id="#+id/text123"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/text123"
android:layout_marginTop="5dp"
android:text="#string/aliyar4"
android:id="#+id/text124"
android:textSize="14sp"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/text124"
android:layout_marginTop="5dp"
android:text="#string/aliyar5"
android:id="#+id/text125"
android:textSize="14sp"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/text125"
android:layout_marginTop="5dp"
android:text="#string/aliyar6"
android:textSize="14sp"
android:id="#+id/text126"
android:gravity="center_horizontal"
/>
</RelativeLayout>
</ScrollView>
</RelativeLayout>

Check below Layout :
<?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:id="#+id/contactnew">
<include
layout="#layout/contentcontact"/>
<android.support.design.widget.FloatingActionButton
android:id="#+id/facebookfab"
android:layout_gravity="bottom|right"
android:layout_width="299dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
app:backgroundTint="#fff"
android:src="#mipmap/facebook" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/callfab"
android:layout_gravity="bottom|left"
android:layout_width="299dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
app:backgroundTint="#color/Color_Blue"
android:src="#drawable/ic_local_phone_black_24dp" />
</android.support.design.widget.CoordinatorLayout>

Related

Make NavigationDrawer above SlidingUpPanel

I want to make navigation drawer above sliding up panel.
I use this https://github.com/umano/AndroidSlidingUpPanel
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="#+id/suplSurveys"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoScrollableView="#+id/vpPlace"
sothree:umanoPanelHeight="68dp"
sothree:umanoParallaxOffset="100dp"
sothree:umanoDragView="#+id/dragView"
sothree:umanoOverlay="true">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#006df0"
app:titleTextColor="#color/colorBackGrey"
android:elevation="20dp"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:layout_marginTop="65dp"
android:orientation="vertical">
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_my_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
app:backgroundTint="#color/jet"
app:fabSize="normal"
app:srcCompat="#drawable/ic_my_location" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="65dp"
android:paddingLeft="80dp"
android:paddingRight="80dp"
android:layout_gravity="center">
<com.dd.morphingbutton.impl.IndeterminateProgressButton
android:id="#+id/add_new_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:fontFamily="#font/pt_mono"
android:layout_gravity="center_horizontal"
android:textSize="18sp"
android:textColor="#color/colorBackGrey"
android:text="ADD"/>
</FrameLayout>
</LinearLayout>
</FrameLayout>
<android.support.design.widget.NavigationView
android:id="#+id/nvView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="#layout/navdraw_header"
app:menu="#menu/drawer_view" />
</android.support.v4.widget.DrawerLayout>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:background="#drawable/border"
android:orientation="vertical"
android:focusable="false"
android:id="#+id/dragView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:orientation="vertical">
<TextView
android:layout_width="48dp"
android:layout_height="2dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:layout_gravity="center"
android:background="#dddddd" />
<TextView
android:layout_width="48dp"
android:layout_marginTop="5dp"
android:layout_height="2dp"
android:gravity="center"
android:layout_gravity="center"
android:background="#dddddd" />
<TextView android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="14sp"
android:fontFamily="#font/pt_mono"
android:textStyle="bold"
android:text="DAFTAR LOKASI SURVEY"
android:textColor="#color/colorAccent"
android:gravity="center_vertical"
android:paddingLeft="10dp"/>
</LinearLayout>
<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="#+id/pbLoad"
android:gravity="center"
android:layout_margin="15dp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/vpPlace"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout></com.sothree.slidinguppanel.SlidingUpPanelLayout>
That's my layout code
So I dont understand what does it mean to make second child
So I dont understand what does it mean to make second child
So I dont understand what does it mean to make second child
So I dont understand what does it mean to make second child
So I dont understand what does it mean to make second child
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:sothree="http://schemas.android.com/apk/res-auto">
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="#+id/suplSurveys"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoScrollableView="#+id/vpPlace"
sothree:umanoPanelHeight="68dp"
sothree:umanoParallaxOffset="100dp"
sothree:umanoDragView="#+id/dragView"
sothree:umanoOverlay="true">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#006df0"
app:titleTextColor="#color/colorBackGrey"
android:elevation="20dp"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:layout_marginTop="65dp"
android:orientation="vertical">
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_my_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
app:backgroundTint="#color/jet"
app:fabSize="normal"
app:srcCompat="#drawable/ic_my_location" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="65dp"
android:paddingLeft="80dp"
android:paddingRight="80dp"
android:layout_gravity="center">
<com.dd.morphingbutton.impl.IndeterminateProgressButton
android:id="#+id/add_new_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:fontFamily="#font/pt_mono"
android:layout_gravity="center_horizontal"
android:textSize="18sp"
android:textColor="#color/colorBackGrey"
android:text="ADD"/>
</FrameLayout>
</LinearLayout>
</FrameLayout>
<!--</android.support.v4.widget.DrawerLayout>-->
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:background="#drawable/border"
android:orientation="vertical"
android:focusable="false"
android:id="#+id/dragView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:orientation="vertical">
<TextView
android:layout_width="48dp"
android:layout_height="2dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:layout_gravity="center"
android:background="#dddddd" />
<TextView
android:layout_width="48dp"
android:layout_marginTop="5dp"
android:layout_height="2dp"
android:gravity="center"
android:layout_gravity="center"
android:background="#dddddd" />
<TextView android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="14sp"
android:fontFamily="#font/pt_mono"
android:textStyle="bold"
android:text="DAFTAR LOKASI SURVEY"
android:textColor="#color/colorAccent"
android:gravity="center_vertical"
android:paddingLeft="10dp"/>
</LinearLayout>
<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="#+id/pbLoad"
android:gravity="center"
android:layout_margin="15dp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/vpPlace"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
<android.support.design.widget.NavigationView
android:id="#+id/nvView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="#layout/navdraw_header"
app:menu="#menu/drawer_view" />
</android.support.v4.widget.DrawerLayout>
This should be a simple fix, I can't see your layout xml with your drawer style (feel free to share the code).
Using a standard navigation view as an example to give the same layout you have now would look something like this:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<android.support.design.widget.CoordinatorLayout
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/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>
<LinearLayout
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"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="#layout/app_bar_main">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="#menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
Which displays something like this (similar to yours):
You will need to wrap the whole screen in another layout (likely linear layout in vertical). You will want to extract the toolbar and bring it out to the outer/top most position like so:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<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>
<android.support.v4.widget.DrawerLayout 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:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<android.support.design.widget.CoordinatorLayout
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">
<LinearLayout
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"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="#layout/app_bar_main">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="#menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
</LinearLayout>
This gives you what you desire - the toolbar will now stay on top and appear like:
Let me know if that does help - please bare in mind that I have made a few assumptions since I have not seen any code yet.

Add floating button on a CardView and RecyclerView

I have this problem to accommodate my floating button, and I do not understand why it does not work.
I would appreciate your response since I can not find the reason why this is happening, one more detail when scrolling or reloading the fragment some of the floating buttons will be accommodated.
And sorry for my English.
<android.support.design.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="wrap_content"
android:background="#color/colorBackground"
android:orientation="vertical">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v7.widget.CardView
android:id="#+id/mRequestCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:elevation="100dp"
android:orientation="horizontal"
app:cardBackgroundColor="#color/colorWhite"
app:cardCornerRadius="3dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="#+id/vDivisor"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/colorGreen" />
...
</RelativeLayout>
</android.support.v7.widget.CardView>
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="#dimen/fab_margin"
android:backgroundTint="#color/colorPurple"
android:scaleType="centerCrop"
android:src="#drawable/ic_route_direction"
app:layout_anchor="#id/mRequestCard"
app:layout_anchorGravity="right|end|bottom" />
</android.support.design.widget.CoordinatorLayout>
And this is my RecyclerView Which is inflated in a fragment
<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.test.HistorialFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/mRecyclerRequest"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</FrameLayout>
And this is my fragment, where I show the RecyclerView
<FrameLayout 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:id="#+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.test.MainActivity"
tools:showIn="#layout/app_bar_main">
</FrameLayout>
you should try RelativeLayout like this
<RelativeLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="#color/colorBlack"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="#dimen/activity_corner"
android:layout_marginBottom="#dimen/activity_margin">
<!--your cardview item here-->
</android.support.v7.widget.CardView>
</RelativeLayout>
for your RecyclerView item
Check if this helps you:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content"
android:background="#color/colorPrimary"
android:orientation="vertical">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v7.widget.CardView
android:id="#+id/mRequestCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:elevation="100dp"
android:orientation="horizontal"
app:cardBackgroundColor="#color/colorWhite"
app:cardCornerRadius="3dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="#+id/vDivisor"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/colorGreen" />
...
</RelativeLayout>
</android.support.v7.widget.CardView>
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:backgroundTint="#color/colorAccent"
android:scaleType="centerCrop"
android:src="#drawable/ic_launcher"
app:layout_anchor="#id/mRequestCard"
app:layout_anchorGravity="right|end|bottom" />
</RelativeLayout>
try this use RelativeLayout and make your FloatingActionButton property android:layout_alignParentBottom="true" and
android:layout_alignParentRight="true" like below code
<RelativeLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="#color/colorBlack"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="#dimen/activity_corner"
android:layout_marginBottom="#dimen/activity_margin">
</android.support.v7.widget.CardView>
</RelativeLayout>

How to use NestedScrollView

In my application I want use NestedScrollView into DrawerLayout.
And for this I write below code.
I want show FAB in bottom of layout, but show me below of card!
I don't want show in below of card, I want show bottom of layout!
Please see below image to understand what I mean:
My codes:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/toNightDrawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="end">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="#+id/reviewSerialFrag_newsCommentsLay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
<android.support.v7.widget.CardView
android:id="#+id/reviewSerialFrag_newsCommentsCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/padding8"
ads:cardBackgroundColor="#android:color/white"
ads:cardElevation="#dimen/size2"
app:contentPadding="#dimen/padding8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="#+id/reviewSerialFrag_newsCommentsHeaderLay"
android:layout_width="match_parent"
android:layout_height="#dimen/size50">
<ImageView
android:id="#+id/reviewSerialFrag_newsCommentsHeaderImage"
android:layout_width="#dimen/size35"
android:layout_height="#dimen/size35"
android:layout_centerVertical="true"
android:alpha="0.8"
android:src="#drawable/ic_comments"
android:tint="#color/darkBlueGrey" />
<TextView
android:id="#+id/reviewSerialFrag_newsCommentsUserTypeText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="#dimen/padding10"
android:layout_toRightOf="#+id/reviewSerialFrag_newsCommentsHeaderImage"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:textColor="#color/darkBlueGrey"
android:textSize="#dimen/font16" />
<TextView
android:id="#+id/reviewSerialFrag_newsCommentsReviewTypeText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="#dimen/padding10"
android:layout_toRightOf="#+id/reviewSerialFrag_newsCommentsUserTypeText"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:textColor="#color/darkBlueGrey"
android:textSize="#dimen/font14" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/reviewSerialFrag_newsCommentsRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/reviewSerialFrag_newsCommentsHeaderLay"
android:layout_marginTop="#dimen/padding5" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
<!--EmptyList-->
<RelativeLayout
android:id="#+id/reviewSerialFrag_EmptyLsy"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<include layout="#layout/empty_list" />
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/reviewSerialFrag_FilterBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="#dimen/padding15"
android:src="#drawable/ic_filter"
app:fabSize="normal" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.DrawerLayout>
How can I fix this problem?
Hey man try this code :
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/toNightDrawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="end">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="#+id/reviewSerialFrag_newsCommentsLay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
<android.support.v7.widget.CardView
android:id="#+id/reviewSerialFrag_newsCommentsCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/padding8"
ads:cardBackgroundColor="#android:color/white"
ads:cardElevation="#dimen/size2"
app:contentPadding="#dimen/padding8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="#+id/reviewSerialFrag_newsCommentsHeaderLay"
android:layout_width="match_parent"
android:layout_height="#dimen/size50">
<ImageView
android:id="#+id/reviewSerialFrag_newsCommentsHeaderImage"
android:layout_width="#dimen/size35"
android:layout_height="#dimen/size35"
android:layout_centerVertical="true"
android:alpha="0.8"
android:src="#drawable/ic_comments"
android:tint="#color/darkBlueGrey" />
<TextView
android:id="#+id/reviewSerialFrag_newsCommentsUserTypeText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="#dimen/padding10"
android:layout_toRightOf="#+id/reviewSerialFrag_newsCommentsHeaderImage"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:textColor="#color/darkBlueGrey"
android:textSize="#dimen/font16" />
<TextView
android:id="#+id/reviewSerialFrag_newsCommentsReviewTypeText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="#dimen/padding10"
android:layout_toRightOf="#+id/reviewSerialFrag_newsCommentsUserTypeText"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:textColor="#color/darkBlueGrey"
android:textSize="#dimen/font14" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/reviewSerialFrag_newsCommentsRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/reviewSerialFrag_newsCommentsHeaderLay"
android:layout_marginTop="#dimen/padding5" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
<!--EmptyList-->
<RelativeLayout
android:id="#+id/reviewSerialFrag_EmptyLsy"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<include layout="#layout/empty_list" />
</RelativeLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/reviewSerialFrag_FilterBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="#dimen/padding15"
android:src="#drawable/ic_filter"
app:fabSize="normal" />
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
So try do that:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/toNightDrawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="end">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="#+id/reviewSerialFrag_newsCommentsLay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
<android.support.v7.widget.CardView
android:id="#+id/reviewSerialFrag_newsCommentsCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/padding8"
ads:cardBackgroundColor="#android:color/white"
ads:cardElevation="#dimen/size2"
app:contentPadding="#dimen/padding8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="#+id/reviewSerialFrag_newsCommentsHeaderLay"
android:layout_width="match_parent"
android:layout_height="#dimen/size50">
<ImageView
android:id="#+id/reviewSerialFrag_newsCommentsHeaderImage"
android:layout_width="#dimen/size35"
android:layout_height="#dimen/size35"
android:layout_centerVertical="true"
android:alpha="0.8"
android:src="#drawable/ic_comments"
android:tint="#color/darkBlueGrey" />
<TextView
android:id="#+id/reviewSerialFrag_newsCommentsUserTypeText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="#dimen/padding10"
android:layout_toRightOf="#+id/reviewSerialFrag_newsCommentsHeaderImage"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:textColor="#color/darkBlueGrey"
android:textSize="#dimen/font16" />
<TextView
android:id="#+id/reviewSerialFrag_newsCommentsReviewTypeText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="#dimen/padding10"
android:layout_toRightOf="#+id/reviewSerialFrag_newsCommentsUserTypeText"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:textColor="#color/darkBlueGrey"
android:textSize="#dimen/font14" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/reviewSerialFrag_newsCommentsRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/reviewSerialFrag_newsCommentsHeaderLay"
android:layout_marginTop="#dimen/padding5" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
<!--EmptyList-->
<RelativeLayout
android:id="#+id/reviewSerialFrag_EmptyLsy"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<include layout="#layout/empty_list" />
</RelativeLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/reviewSerialFrag_FilterBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="#dimen/padding15"
android:src="#drawable/ic_filter"
app:fabSize="normal" />
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.DrawerLayout>
Set all contect inside a coordinator layout and fab outside the nestedscrollview .If not work ask me to send other possible way.
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/Widget.AppTheme.AppBarOverlay">
<include
layout="#layout/include_layout_toolbar_scroll"/>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/include_layout_content_with_nestedscroll"/>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_task_accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="#dimen/fab_margin"
android:src="#drawable/ic_accepted"
app:layout_behavior="pass.to.FabScrollBehavior.Class"
app:theme="#style/Widget.AppTheme.Fab"/>
< /android.support.design.widget.CoordinatorLayout>
use coordinatorlayout
use this link

Fragment in TabbedActivity is cropped

So I have this fragment_list.xml inside a TabbedActivity. It has a ListView and a FloatingActionButton. But I don't know why, the fragment is a little bit cropped, so the ListView cannot be scrolled down until the bottom, and the FAB only shows a little bit.
Here's the picture of it. It is on the bottom of the scroll:
fragment_list.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.garudamaya.dennydap.lookingood.BlankFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="#+id/listProgress"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"/>
<ListView
android:id="#+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#null"
android:dividerHeight="0dp">
</ListView>
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right|end"
android:layout_margin="#dimen/fab_margin"
android:background="#color/colorPrimaryDark"
app:srcCompat="#drawable/ic_sort_by_alpha_white_24px"
app:rippleColor="#FFF"/>
</FrameLayout>
fragment_tabbed.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"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.garudamaya.dennydap.lookingood.MainActivity$PlaceholderFragment">
<TextView
android:id="#+id/section_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
activity_tabbed.xml
<?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:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.garudamaya.dennydap.lookingood.MainActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="#dimen/appbar_padding_top"
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:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="#style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
Any ideas?
Try this,
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="fill_parent"
android:layout_height="fill_parent">
<ProgressBar
android:id="#+id/listProgress"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone" />
<android.support.v7.widget.RecyclerView
android:id="#+id/mRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:dividerHeight="0dp" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_gravity="bottom|right|end"
android:layout_marginBottom="60dp"
android:layout_marginRight="8dp"
android:background="#color/colorPrimaryDark"
app:rippleColor="#FFF"
app:srcCompat="#drawable/ic_home_blue" />
</RelativeLayout>
Answer Is :- Solve Different Layout and waeight sum use to solver this problem
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="2">
<ListView
android:id="#+id/listView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.6"
android:divider="#null"
android:dividerHeight="0dp"></ListView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.4">
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="bottom|right"
android:background="#color/colorPrimaryDark"
app:rippleColor="#FFF"
app:srcCompat="#drawable/ic_sort_by_alpha_white_24px" />
</RelativeLayout>
</LinearLayout>
I hop this layout is perfect and solve this probolem

UI Changes made in fragment layout is not reflected in emulator.(using page Viewers to create Fragment)

I am using pageviewers to create fragments.
I have defined a pageviewer in MainActivity Layout.
MainActivity.xml
<?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"
tools:context="com.rakesh_kr.fullclass.BranchFeed">
<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>
<include layout="#layout/content_branch_feed" />
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="300dp"
android:id="#+id/pager"
android:layout_marginTop="50dp">
</android.support.v4.view.ViewPager>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
android:src="#android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
I made some changes to my FragmentLayout.xml which are not being reflected in the emulator.
FragmentLayout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:padding="5dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/imageView"
android:layout_gravity="center_horizontal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="#+id/titleText"
android:layout_gravity="center_horizontal"
android:layout_below="#+id/imageView"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="#+id/descText"
android:layout_gravity="center_horizontal"
android:layout_below="#+id/titleText"/>
</LinearLayout>
My emulator is currently showing

Categories

Resources