Exemple #1
0
  @Override
  protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);

    XoLib.initXo(getCacheDir().getAbsolutePath(), metrics.scaledDensity);

    mView = new XoView(getApplication(), metrics.scaledDensity);
    setContentView(mView);
  }
Exemple #2
0
 @Override
 public boolean onTouchEvent(MotionEvent event) {
   // Log.w( "a", "touch me " + Float.toString( event.getX() ) + ", " + Float.toString(
   // event.getY() ) );
   float[] x = new float[event.getPointerCount()];
   float[] y = new float[event.getPointerCount()];
   for (int i = 0; i < event.getPointerCount(); i++) {
     x[i] = event.getX(i);
     y[i] = event.getY(i);
   }
   XoLib.input(1, x, y);
   mView.requestRender();
   return true;
 }
Exemple #3
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   XoLib.destroy();
 }