@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); } }
@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; }
public void onStateChanged(String stateName, String stateValue) { onUIStateChanged(mApplication.getNativeHandle(), stateName, stateValue); }
@Override public void surfaceDestroyed(SurfaceHolder holder) { if (mApplication.getNativeHandle() != 0) { onSurfaceDestroyed(mApplication.getNativeHandle()); } }
@Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { if (mApplication.getNativeHandle() != 0) { onSurfaceChanged(mApplication.getNativeHandle(), holder.getSurface()); } }
@Override public void surfaceCreated(SurfaceHolder holder) { if (mApplication.getNativeHandle() != 0) { onSurfaceCreated(mApplication.getNativeHandle(), holder.getSurface()); } }