title: Make BottomSheetDialog Open on Swipe Up and on any touch movement
body: <p>I want to make BottomSheetDialog open when I touch anywhere on screen or just swipe up,  and want to close it when touched anywhere on screen by the user or just swiped down. I am doing it with onTouchEvent Method, but unable to do so.</p>
  
  <p>My code:</p>
  
  <pre><code>    public class MainActivity extends AppCompatActivity {
          private Button btn1;
  
  
          @Override
          public boolean onTouchEvent(MotionEvent event) {
            /*  float eventX = event.getX();
              float eventY = event.getY();*/
  
              switch (event.getAction()) {
                  case MotionEvent.ACTION_DOWN:
                      BottomSheet bottom= new BottomSheet();
                      bottom.dismiss();
                      return true;
  
                  case MotionEvent.ACTION_MOVE:
                      BottomSheet bottoms= new BottomSheet();
                      bottoms.show(getSupportFragmentManager(),bottoms.getTag());
                      return true;
  
                  case MotionEvent.ACTION_UP:
  
                      break;
                  default:
                      return false;
              }
  
  
              return true;
  
          }
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
              btn1= findViewById(R.id.btn1);
              btn1.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View view) {
                     /* BottomSheet bottom= new BottomSheet();
                      bottom.show(getSupportFragmentManager(),bottom.getTag());*/
                  }
              });
  
  
  
          }
      }
  </code></pre>