summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2011-12-05 23:56:14 -0600
committerAndy Doan <andy.doan@linaro.org>2011-12-06 15:14:29 -0600
commite8143557f58ed1e6508aa38944cdb331a6addf9f (patch)
treed0507bd9535b427c3c15a4e7a5d70b4ceceef572
parentb683e03999c7bf74e570d236bdae9385dc3bf9c8 (diff)
downloadLinaroWallpaper-e8143557f58ed1e6508aa38944cdb331a6addf9f.tar.gz
animation for top-left
-rw-r--r--src/org/linaro/wallpaper/LogoWallpaper.java31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/org/linaro/wallpaper/LogoWallpaper.java b/src/org/linaro/wallpaper/LogoWallpaper.java
index 97664b2..f0e7e0c 100644
--- a/src/org/linaro/wallpaper/LogoWallpaper.java
+++ b/src/org/linaro/wallpaper/LogoWallpaper.java
@@ -138,7 +138,7 @@ public class LogoWallpaper extends WallpaperService {
mBox[1] = new MovingDrawable(d, start, p[1], NUM_FRAMES);
//box 3 from the top
- start = new Point(boxX + (2*w), 0);
+ start = new Point(boxX + (2*boxSpacing), 0);
mBox[2] = new MovingDrawable(d, start, p[2], NUM_FRAMES);
//box 4 from the bottom,right
@@ -150,6 +150,33 @@ public class LogoWallpaper extends WallpaperService {
mBox[4] = new MovingDrawable(d, start, p[4], NUM_FRAMES);
}
+ private void initAnimationTL(int width, int height, float density,
+ Drawable d, int boxSpacing) {
+ mLogoX = 40; //offset just a bit
+ mLogoY = 40;
+
+ int boxX = Math.round(mLogoX + (BOX_XOFFSET*density));
+ int boxY = Math.round(mLogoY + (BOX_YOFFSET*density));
+
+ Point p[] = new Point[mBox.length];
+ getEndingPoints(boxX, boxY, boxSpacing, p);
+
+ Point start = new Point(0, height); //bottom left
+ mBox[0] = new MovingDrawable(d, start, p[0], NUM_FRAMES);
+
+ start = new Point(width/2, height); //bottom, middle
+ mBox[1] = new MovingDrawable(d, start, p[1], NUM_FRAMES);
+
+ start = new Point(width, height); //bottom right
+ mBox[2] = new MovingDrawable(d, start, p[2], NUM_FRAMES);
+
+ start = new Point(width, height/2); //middle right
+ mBox[3] = new MovingDrawable(d, start, p[3], NUM_FRAMES);
+
+ start = new Point(width, boxY); //box level, right
+ mBox[4] = new MovingDrawable(d, start, p[4], NUM_FRAMES);
+ }
+
private void initAnimation(int width, int height) {
float density = getResources().getDisplayMetrics().density;
@@ -161,6 +188,8 @@ public class LogoWallpaper extends WallpaperService {
if("Center".equals(mLocation))
initAnimationCenter(width, height, density, d, w);
+ else if("Top-Left".equals(mLocation))
+ initAnimationTL(width, height, density, d, w);
}
@Override