27 Ağustos 2018 Pazartesi

MotionEvent Sınıfı

MotionEvent.ACTION_UP Alanı
Açıklaması şöyle.
A pressed gesture has finished, the motion contains the final release location as well as any intermediate points since the last down or move event.
getAction metodu
Şöyle yaparız.
ivProductImage.setOnTouchListener(new View.OnTouchListener() {

  @Override
  public boolean onTouch(View v, MotionEvent event) {


    switch (event.getAction()) {
      case MotionEvent.ACTION_DOWN: {

        //press event
        imageDialog.show();

        return true;
      }
      case MotionEvent.ACTION_UP: {

        //release event
        imageDialog.dismiss();


        return true;
      }
      default:
        return false;

      }
  }

});

Hiç yorum yok:

Yorum Gönder