title: Bottom sheet menu bar like whatsapp
body: <p>I tried to implement bottom sheet like whatsapp in my chat app.</p>
  
  <p><a href="https://i.stack.imgur.com/lh2Sd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lh2Sd.jpg" alt="Menu when Keyboard open"></a><a href="https://i.stack.imgur.com/rcEeN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rcEeN.jpg" alt="Menu when Keyboard close"></a><a href="https://i.stack.imgur.com/ftuvf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ftuvf.jpg" alt="Menu closing effect when keyboard closed"></a><a href="https://i.stack.imgur.com/jYCJg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jYCJg.jpg" alt="Menu closing effect when keyboard open"></a></p>
  
  <p>Keyboard close when we tap anywhere on screen and when keyboard opens it override with menu and when we touch anywhere keyboard stayed open and close menu.</p>
  
  <p>I implement bottom sheet in fragment like this</p>
  
  <pre><code>public class Menu_BottomSheet extends BottomSheetDialogFragment implements View.OnClickListener {
  public static final String TAG="###Bottom###";
  BottomSheetBehavior.BottomSheetCallback callback = new BottomSheetBehavior.BottomSheetCallback() {
      @Override
      public void onStateChanged(@NonNull View view, int i) {
          if (i==BottomSheetBehavior.STATE_HIDDEN){
              dismiss();
          }
      }
  
      @Override
      public void onSlide(@NonNull View view, float v) {
  
      }
  };
  
  
  @Override
  public void setupDialog(Dialog dialog, int style) {
      //super.setupDialog(dialog, style);
      View view=View.inflate(getActivity(), R.layout.menu_bottomsheet,null);
      dialog.setContentView(view);
      TextView button1=view.findViewById(R.id.test1);
      TextView button2=view.findViewById(R.id.test2);
      TextView button3=view.findViewById(R.id.test3);
      TextView button4=view.findViewById(R.id.test4);
      TextView button5=view.findViewById(R.id.test5);
      TextView button6=view.findViewById(R.id.test6);
  
      button1.setOnClickListener(this);
      button2.setOnClickListener(this);
      button3.setOnClickListener(this);
      button4.setOnClickListener(this);
      button5.setOnClickListener(this);
      button6.setOnClickListener(this);
  }
  
  @Override
  public void onClick(View view) {
  
      switch (view.getId()){
          // BOTTOM SHEET MENU CLICK HANDLES
          case R.id.test1:
              Log.d(TAG,"Button 1 Clicked");
              break;
  
          case R.id.test2:
              Log.d(TAG,"Button 2 Clicked");
              break;
  
          case R.id.test3:
              Log.d(TAG,"Button 3 Clicked");
              break;
  
          case R.id.test4:
              Log.d(TAG,"Button 4 Clicked");
              break;
  
          case R.id.test5:
              Log.d(TAG,"Button 5 Clicked");
              break;
  
          case R.id.test6:
              Log.d(TAG,"Button 6 Clicked");
              break;
      }
  
  }
  </code></pre>
  
  <p>Showing bottomsheet in activity like this</p>
  
  <pre><code>Menu_BottomSheet bottomSheet=new Menu_BottomSheet();
              bottomSheet.show(getSupportFragmentManager(),bottomSheet.getTag());
  </code></pre>
  
  <p>My bottom sheet close keyboard when pressed with open keyboard also its doesn't have smooth effects when open or close.</p>
  
  <p><a href="https://i.stack.imgur.com/sHJMQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sHJMQ.jpg" alt="My bottom sheets"></a></p>