title: How to set FloatingActionButton Over the screen in Tabs Layout?
body: <p>In my application i want to set FloatingActionButton Over the screen in Tab's Layout.</p>
  
  <p><a href="https://i.stack.imgur.com/R5041.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R5041.png" alt="The FloatingActionButton want to set like this"></a></p>
  
  <p>In my project i have created firstly TabLayout and ViewPager and in last FloatingActionButton as like image</p>
  
  <p><strong>visit_tab.xml</strong></p>
  
  <pre><code>    &lt;LinearLayout 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="com.Weal.sachin.omcom.TabFragment"
      android:orientation="vertical"&gt;
  
  
      &lt;android.support.design.widget.TabLayout
          android:id="@+id/sliding_tabs_visit"
          android:layout_width="match_parent"
          android:layout_height="60dp"
          app:tabTextColor="#000"
          style="@style/Base.TextAppearance.AppCompat.Light.Widget.PopupMenu.Large"
          app:tabSelectedTextColor="#fff"
          android:background="#c64c24"/&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/viewpager_visit"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"
          android:background="@color/white"/&gt;
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fab111"
          android:layout_width="75dp"
          android:layout_height="75dp"
          android:layout_gravity="bottom|end"
          android:backgroundTint="@color/cardview_dark_background"
          android:layout_margin="@dimen/fab_margin"
          android:src="@android:drawable/ic_input_add"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>Visit_tab.java</strong></p>
  
  <pre><code>    package com.Weal.sachin.omcom;
  
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.TabLayout;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentPagerAdapter;
  import android.support.v4.app.FragmentTransaction;
  import android.support.v4.view.ViewPager;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  
  public class VisitTab extends Fragment {
      public static TabLayout tabLayout;
      public static ViewPager viewPager;
      public static int int_items = 3 ;
      android.support.v4.app.FragmentManager mFragmentManager;
  
      View view;
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          getActivity().setTitle("Visit");
  
          GetCurrentGPSLocation gps = new GetCurrentGPSLocation(getActivity());
          if (gps.canGetLocation()) {
  
              // \n is for new line
  
          }else {
              // can't get location
              // GPS or Network is not enabled
              // Ask user to enable GPS/network in settings
              gps.showSettingsAlert();
          }
          View x =  inflater.inflate(com.Weal.sachin.omcom.R.layout.activity_visit_tab,null);
          tabLayout = (TabLayout) x.findViewById(com.Weal.sachin.omcom.R.id.sliding_tabs_visit);
          viewPager = (ViewPager) x.findViewById(com.Weal.sachin.omcom.R.id.viewpager_visit);
          viewPager. setOffscreenPageLimit(3);
  
  
          viewPager.setAdapter(new MyAdapter(getChildFragmentManager()));
  
          FloatingActionButton fab = (FloatingActionButton)x.findViewById(R.id.fab111);
          fab.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  FragmentTransaction t = getFragmentManager().beginTransaction();
                  Add_Visit mFrag = new Add_Visit();
                  t.replace(R.id.framelayout, mFrag);
                  t.commit();
              }
          });
  
          tabLayout.setupWithViewPager(viewPager);
  
  
          return x;
  
      }
      class MyAdapter extends FragmentPagerAdapter {
          com.Weal.sachin.omcom.TodayVisit TodayVisit;
          Home home;
          UpdatesFragment UpdatesFragment;
          public MyAdapter(FragmentManager fm) {
              super(fm);
          }
  
          /**
           * Return fragment with respect to Position .
           */
  
          @Override
          public Fragment getItem(int position)
          {
              switch (position){
                  case 0 : return new TodayVisit();
                  case 1 : return new YesterdayVisit();
                  case 2 : return new AllVisit();
              }
              return null;
          }
  
          @Override
          public int getCount() {
  
              return int_items;
  
          }
  
          /**
           * This method returns the title of the tab according to the position.
           */
  
          @Override
          public CharSequence getPageTitle(int position) {
  
              switch (position){
                  case 0 :
                      return "Today";
                  case 1 :
                      return "Yesterday";
                  case 2 :
                      return "Visit All";
              }
              return null;
          }
      }
  
  }
  </code></pre>
  
  <p>In this xml file floatinActionButton is displaying perfectly but it is taking place of the ViewPager but i want to set floatinActionButton Over the ViewPager.</p>