title: How to make Focus to FloatingActionButton Even if the Navigation drawer is open in Android
body: <p>I want to make focus on <code>FloatingActionButton</code> Even if my Navigation Drawer is open.
  I know when the navigation Drawer is open then rest of the screen is <code>unfocusable</code> by using <a href="https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html#setScrimColor%28int%29" rel="nofollow noreferrer"><code>setScrimColor</code></a> this we can reduce the focus on Navigation Drawer. But I want to make <code>FloatingActionButton</code> is focusable. </p>
  
  <p>Library is below for <code>ActionButton</code></p>
  
  <p><a href="https://github.com/shell-software/fab" rel="nofollow noreferrer">https://github.com/shell-software/fab</a></p>
  
  <p>see the below screenshot for my problem.</p>
  
  <p><strong>Normal Screen :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/1JKF0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1JKF0.png" alt="enter image description here"></a></p>
  
  <p><strong>Click on FloatingButton :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/johIb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/johIb.png" alt="enter image description here"></a></p>
  
  <p><strong>What I want like this Focusable :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/nB6ev.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nB6ev.png" alt="enter image description here"></a></p>
  
  <p><strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:fab="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:layout_gravity="end"
      android:fitsSystemWindows="true"&gt;
  
      &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          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=".MainActivity"&gt;
  
          &lt;com.example.softeng.animationf.fabdirectory.ActionButton
              android:id="@+id/fab_activity_action_button"
              style="@style/fab_action_button_style"
              fab:type="MINI"/&gt;
  
  
      &lt;/RelativeLayout&gt;
  
      &lt;android.support.design.widget.NavigationView
          android:id="@+id/navigation_view"
          android:layout_width="200dp"
          android:layout_height="match_parent"
          android:layout_gravity="end"&gt;
  
          &lt;RelativeLayout
              android:id="@+id/right_navigation"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:background="#4D4D4D"&gt;
  
          &lt;/RelativeLayout&gt;
  
      &lt;/android.support.design.widget.NavigationView&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      DrawerLayout drawerLayout;
      NavigationView navigation_view;
  
      int count = 1;
  
      private boolean isOutSideClicked = false;
  
  
      RelativeLayout relativeLayout;
      private ActionButton actionButton;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          assert getSupportActionBar() != null;
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
          getSupportActionBar().setDisplayShowHomeEnabled(true);
  
          drawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
         /* drawerLayout.setScrimColor(Color.parseColor("#00000000"));*/
          navigation_view = (NavigationView)findViewById(R.id.navigation_view);
          relativeLayout = (RelativeLayout)findViewById(R.id.right_navigation);
  
          actionButton = (ActionButton) findViewById(R.id.fab_activity_action_button);
  
          actionButton.setImageResource(R.drawable.fab_plus_icon);
          actionButton.setRippleEffectEnabled(true);
          actionButton.setShadowRadius(0);
          actionButton.setShadowXOffset(0);
          actionButton.setShadowYOffset(0);
          actionButton.setButtonColor(Color.parseColor("#0072BA"));
          actionButton.setButtonColorPressed(Color.parseColor("#004F80"));
          actionButton.setShadowRadius(10);
  
          actionButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  if(count == 1) {
                      actionButton.moveLeft(200);
                      actionButton.setImageResource(R.drawable.close);
                      drawerLayout.openDrawer(Gravity.RIGHT);
                     count = count - 1;
                  }else if(count == 0){
  
                      closeFab();
  
  
                  }
                  else {
  
                  }
              }
          });
  
      }
  
      private void closeFab(){
          actionButton.move(new MovingParams(MainActivity.this, 200 , 0));
          actionButton.setImageResource(R.drawable.fab_plus_icon);
          count = count + 1;
          drawerLayout.closeDrawer(Gravity.RIGHT);
      }
  
      @Override
      public boolean dispatchTouchEvent(MotionEvent event) {
          if (event.getAction() == MotionEvent.ACTION_UP) {
              if (drawerLayout.isDrawerOpen(navigation_view)) {
  
                  View content = findViewById(R.id.drawer_layout);
                  int[] contentLocation = new int[2];
                  content.getLocationOnScreen(contentLocation);
                  Rect rect = new Rect(contentLocation[0],
                          contentLocation[1],
                          contentLocation[0] + content.getWidth(),
                          contentLocation[1] + content.getHeight());
  
  
  
                  if (!(rect.contains((int) event.getX(), (int) event.getY()))) {
                      isOutSideClicked = true;
                  } else {
                      isOutSideClicked = false;
                      this.closeFab();
                  }
  
              }
          }
  
          return super.dispatchTouchEvent(event);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>The Rounded Image means FloatingActionButton i want to focusable. Any Help be Appreciated.</p>