Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void DrawStaticFrame()
- {
- System.out.println("Getting Surafe Holder");
- final SurfaceHolder holder = getSurfaceHolder();
- System.out.println("Surafe Holder: " + holder + ". Getting Canvas");
- Canvas c = null;
- try
- {
- System.out.println("Trying to lock canvas: " + c);
- c = holder.lockCanvas();
- System.out.println("Canvas Locked");
- if (c != null)
- {
- System.out.println("Painting Static background");
- PaintStaticBackground(c);
- System.out.println("Static Background Painted");
- }
- }
- catch(Exception e)
- {
- System.out.println("Exception: " + e.getMessage());
- }
- finally
- {
- if (c != null) holder.unlockCanvasAndPost(c);
- }
- }
- void DrawAnimatedFrames()
- {
- final SurfaceHolder holder = getSurfaceHolder();
- Canvas c = null;
- try
- {
- c = holder.lockCanvas();
- if (c != null)
- {
- PaintBatteryBackground(c);
- PaintBatteryForeground(c);
- PaintDateTimeBackground(c);
- PaintDateTimeForeground(c);
- }
- }
- finally
- {
- if (c != null) holder.unlockCanvasAndPost(c);
- }
- // Reschedule the next redraw
- mHandler.removeCallbacks(mDrawCube);
- if (mVisible)
- {
- mHandler.postDelayed(mDrawCube, 100);
- }
- }
Add Comment
Please, Sign In to add comment