title: get movement of user in action down in android activity
body: <p>i am working on a app where i need to get . the direction of the user drag his finger  on the screen in Action.Down (before he lift his finger)
  if i coded some code but it tell the values only after user lift his finger from the mobile activity .  but i want the direction of user movement while his finger is placed on the screen </p>
  
  <pre><code>layout.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
  
              switch (event.getAction()) {
  
                  case MotionEvent.ACTION_DOWN: {
                      // store the X value when the user's finger was pressed down
                      downXValue = event.getX();
                      downYValue = event.getY();
                      Log.d("recording", "= " + downYValue);
                      break;
                  }
  
                  case MotionEvent.ACTION_UP: {
                      // Get the X value when the user released his/her finger
                      float currentX = event.getX();
                      float currentY = event.getY();
                      // check if horizontal or vertical movement was bigger
  
                      if (Math.abs(downXValue - currentX) &gt; Math.abs(downYValue
                              - currentY)) {
                          Log.d("recording", "x");
                          // going backwards: pushing stuff to the right
                          if (downXValue &lt; currentX) {
                              Log.d("recording", "right");
  
                          }
  
                          // going forwards: pushing stuff to the left
                          if (downXValue &gt; currentX) {
                              Log.d("recording", "left");
  
                          }
  
                      } else {
                          Log.d("recording", "y ");
  
                          if (downYValue &lt; currentY) {
                              Log.d("recording", "down");
  
  
  
  
                              }
                          }
                          if (downYValue &gt; currentY) {
                              Log.d("recording", "up");
  
  
  
  
                          }
                      }
                      break;
                  }
  
              }
  
              return true;
  
          }
  
  
      });
  </code></pre>