summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2011-12-05 22:55:28 -0600
committerAndy Doan <andy.doan@linaro.org>2011-12-05 22:55:28 -0600
commite189ca2ea40d4314489c6d2af11147abd128a102 (patch)
tree65cbbd488032d9358690092dd6ee3e279a42f53f
parentd30f15f2120c92d1f4bc6ea5115c1dabff817220 (diff)
downloadLinaroWallpaper-e189ca2ea40d4314489c6d2af11147abd128a102.tar.gz
refactor LogoWallpaper initialization
we need to break this up so that it can be initialized by a change listener
-rw-r--r--src/org/linaro/wallpaper/LogoWallpaper.java13
1 files changed, 8 insertions, 5 deletions
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 @@ public class LogoWallpaper extends WallpaperService {
}
}
- @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 @@ public class LogoWallpaper extends WallpaperService {
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();
}