Ejemplo n.º 1
0
 public void startStopMovementEngine(final View view) {
   Toast.makeText(
           SquashActivity.getInstance(),
           "MovementEngine " + (MovementEngine.isRunning() ? "stopped" : "started"),
           Toast.LENGTH_SHORT)
       .show();
   MovementEngine.toggleRunning();
 }
Ejemplo n.º 2
0
  @Override
  public boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) {
    final float dx = event2.getX() - event1.getX();
    final float dy = event2.getY() - event1.getY();

    if (Math.abs(dy) > 0.2f * SquashView.getInstance().getHeight()) {
      Log.d(TAG, "SwipeUp/Down");
      SquashActivity.getInstance().toggleUi();
    }

    Log.d(TAG, "onFling: dx=" + dx + ", dy=" + dy); // +
    // event1.toString()+event2.toString());
    return true;
  }