Esempio n. 1
0
 @Override
 public void surfaceDestroyed(SurfaceHolder holder) {
   mHandler.removeCallbacks(mDrawFrames);
   if (mThread != null) {
     mThread.alive = false;
   }
 }
Esempio n. 2
0
  @Override
  public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
    mHandler.removeCallbacks(mDrawFrames);
    mWidth = width;
    mHeight = height;
    mbgIn = null;
    calculatedItemSpacing(credits, mHeight);

    mThread.alive = false;
    while (mThread.isAlive()) {
      try {
        Thread.sleep(5);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }
    mThread = new CreditsThread();
    mThread.start();
  }
Esempio n. 3
0
  private synchronized void drawFrame() {
    if (mThread != null) {
      mThread.cont = false;
    }

    Canvas canvas = null;
    try {
      canvas = mHolder.lockCanvas(null);
      if (canvas != null) {
        drawBackground(canvas);

        for (CreditsItem item : credits) {
          item.draw(canvas);
        }
      }

    } finally {
      if (canvas != null) {
        mHolder.unlockCanvasAndPost(canvas);
      }
    }
  }
Esempio n. 4
0
 @Override
 public void surfaceCreated(SurfaceHolder holder) {
   mThread = new CreditsThread();
   mThread.start();
 }