O'Reilly logo

Learn ARCore - Fundamentals of Google ARCore by Micheal Lanham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Touch for gesture detection

So, that covers simple interactions. How about we add another gesture to allow the user to clear all the attachment points and thus remove the Andy robot from the scene. Follow along the given steps to add another touch gesture:

  1. Scroll to the following section of code:
// Set up tap listener.gestureDetector =    new GestureDetector(        this,        new GestureDetector.SimpleOnGestureListener() {          @Override          public boolean onSingleTapUp(MotionEvent e) {            onSingleTap(e);            return true;          }          @Override          public boolean onDown(MotionEvent e) {            return true;          }        });surfaceView.setOnTouchListener(    new View.OnTouchListener() {      @Override      public boolean onTouch(View v, MotionEvent event) {        return gestureDetector.onTouchEvent(event);      }    });
  1. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required