refactor LogoWallpaper initialization
we need to break this up so that it can be initialized
by a change listener
diff --git a/src/org/linaro/wallpaper/LogoWallpaper.java b/src/org/linaro/wallpaper/LogoWallpaper.java
index 05e7a87..2e57ea0 100644
--- a/src/org/linaro/wallpaper/LogoWallpaper.java
+++ b/src/org/linaro/wallpaper/LogoWallpaper.java
@@ -99,11 +99,7 @@
}
}
- @Override
- public void onSurfaceChanged(SurfaceHolder holder, int format,
- int width, int height) {
- super.onSurfaceChanged(holder, format, width, height);
-
+ private void initAnimation(int width, int height) {
float density = getResources().getDisplayMetrics().density;
mLogoX = (width/2.0f) - (mLogo.getWidth()/2.0f);
@@ -142,7 +138,14 @@
mBox[4] = new MovingDrawable(d, start, end, NUM_FRAMES);
mNumFrameDelays = NUM_FRAMES / mBox.length;
+ }
+ @Override
+ public void onSurfaceChanged(SurfaceHolder holder, int format,
+ int width, int height) {
+ super.onSurfaceChanged(holder, format, width, height);
+
+ initAnimation(width, height);
drawFrame();
}