title: Making a fragment translucent in android
body: <p>I have a fragment A that covers up the whole screen and another fragment B that is at the bottom of the screen of 50dp.Fragment B overlaps some bottom portion of fragment A.I want to make fragment B translucent so the overlapped portion of fragment A is seen.</p>
  
  <p>I tried using Theme.Translucent,used framelayouts,used setAlpha() method,but didn't get the desired result.Just like we have a translucent actionbar in android,similarly I want to make my fragment B translucent.</p>
  
  <p>I tried referring to these links...
  link1 :
  <a href="https://stackoverflow.com/questions/13086706/making-the-background-translucent">making the background translucent</a></p>
  
  <p>link 2:
  <a href="https://zaman91.wordpress.com/2010/03/22/android-how-to-create-transparent-or-opeque-background/" rel="nofollow noreferrer">https://zaman91.wordpress.com/2010/03/22/android-how-to-create-transparent-or-opeque-background/</a></p>
  
  <p>link3:
  <a href="https://stackoverflow.com/questions/21294782/making-a-android-button-s-background-translucent">Making a android button’s background translucent,</a></p>
  
  <p>some code to help you understand..</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res/com.examples"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@null"
      android:fitsSystemWindows="true" &gt;
  
      &lt;!-- Your normal content view --&gt;
  
      &lt;com.examples.views.SlidingUpPanelLayout
          android:id="@+id/sliding_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:gravity="center|top" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical" &gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/toolbar_header"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:background="@drawable/icn_actionbar_background"
                  android:minHeight="?attr/actionBarSize" &gt;
  
                  &lt;com.examples.views.CustomTextView
                      android:id="@+id/toolbar_title"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center"
                      android:gravity="center"
                      android:singleLine="true"
                      android:text="Toolbar Title"
                      android:textColor="@color/action_bar_text"
                      android:textSize="18sp"
                      android:textStyle="bold"
                      app:font="@string/font_avenirMedium" /&gt;
              &lt;/android.support.v7.widget.Toolbar&gt;
  
              &lt;!-- Say this is Fragment A --&gt;
              &lt;fragment
                  android:id="@+id/frag_fragmentA"
                  android:name="com.examples.fragments.FragmentA"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center" /&gt;
  
              &lt;!-- The rest of your content view --&gt;
  
          &lt;/LinearLayout&gt;
  
                        &lt;!-- this is fragment B --&gt;
          &lt;fragment
              android:id="@+id/fragment B"
              android:name="com.examples.fragments.MyFragmentB"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center|top" /&gt;
      &lt;/com.examples.SlidingUpPanelLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="300dp"
          android:layout_height="match_parent"
          android:layout_gravity="left|start"
          android:fitsSystemWindows="true" &gt;
  
          &lt;!-- Your drawer content --&gt;
  
          &lt;include
              android:id="@+id/left_drawer"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="start"
              layout="@layout/drawer_layout" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>the offset of 50dp is given in the SlidingPanelLayout itself..so only 50 dp of fragment B is visible.</p>
  
  <p>In all these links Theme.Translucent is added to activity theme..but I want to create a theme that makes only that fragment translucent.</p>
  
  <p>Any suggestions or help guys..deeply appreciated.Thanks.</p>