Example #1
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Pass the event to ActionBarDrawerToggle, if it returns
    // true, then it has handled the app icon touch event
    if (mDrawerToggle != null && mDrawerToggle.onOptionsItemSelected(item)) {
      return true;
    }

    switch (item.getItemId()) {
      case R.id.action_left:
        onKeyPressed(mApplication.getNativeHandle(), KeyEvent.KEYCODE_SOFT_LEFT);
        return true;
      case R.id.action_right:
        onKeyPressed(mApplication.getNativeHandle(), KeyEvent.KEYCODE_SOFT_RIGHT);
        return true;
      default:
        return super.onOptionsItemSelected(item);
    }
  }
Example #2
0
 @Override
 public boolean onTouch(View v, MotionEvent event) {
   int count = event.getPointerCount();
   for (int i = 0; i < count; i++) {
     final float x = event.getX(i);
     final float y = event.getY(i);
     final int owner = event.getPointerId(i);
     int action = event.getAction() & MotionEvent.ACTION_MASK;
     onTouched(mApplication.getNativeHandle(), owner, action, x, y);
   }
   return true;
 }
Example #3
0
 public void onStateChanged(String stateName, String stateValue) {
   onUIStateChanged(mApplication.getNativeHandle(), stateName, stateValue);
 }
Example #4
0
 @Override
 public void surfaceDestroyed(SurfaceHolder holder) {
   if (mApplication.getNativeHandle() != 0) {
     onSurfaceDestroyed(mApplication.getNativeHandle());
   }
 }
Example #5
0
 @Override
 public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
   if (mApplication.getNativeHandle() != 0) {
     onSurfaceChanged(mApplication.getNativeHandle(), holder.getSurface());
   }
 }
Example #6
0
 @Override
 public void surfaceCreated(SurfaceHolder holder) {
   if (mApplication.getNativeHandle() != 0) {
     onSurfaceCreated(mApplication.getNativeHandle(), holder.getSurface());
   }
 }