summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2011-12-06 00:11:25 -0600
committerAndy Doan <andy.doan@linaro.org>2011-12-06 15:14:31 -0600
commit4be1e8b6625147f5a43af366ecbd58a98ab75ab8 (patch)
tree094c0ba6faaae5ab540cd14bdcf2a244c206c684
parent054781aa83d061a98c9d6e64a23438040c5e7a12 (diff)
downloadLinaroWallpaper-4be1e8b6625147f5a43af366ecbd58a98ab75ab8.tar.gz
animation for bottom-left
-rw-r--r--src/org/linaro/wallpaper/LogoWallpaper.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/org/linaro/wallpaper/LogoWallpaper.java b/src/org/linaro/wallpaper/LogoWallpaper.java
index f0e7e0c..b951447 100644
--- a/src/org/linaro/wallpaper/LogoWallpaper.java
+++ b/src/org/linaro/wallpaper/LogoWallpaper.java
@@ -177,6 +177,60 @@ public class LogoWallpaper extends WallpaperService {
mBox[4] = new MovingDrawable(d, start, p[4], NUM_FRAMES);
}
+ private void initAnimationTR(int width, int height, float density,
+ Drawable d, int boxSpacing) {
+ mLogoX = width - mLogo.getWidth() - 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/2); //middle left
+ mBox[0] = new MovingDrawable(d, start, p[0], NUM_FRAMES);
+
+ start = new Point(0, height); //bottom, left
+ mBox[1] = new MovingDrawable(d, start, p[1], NUM_FRAMES);
+
+ start = new Point(width/2, height); //bottom middle
+ mBox[2] = new MovingDrawable(d, start, p[2], NUM_FRAMES);
+
+ start = new Point(boxX+(3*boxSpacing), height); //bottom boxX
+ mBox[3] = new MovingDrawable(d, start, p[3], NUM_FRAMES);
+
+ start = new Point(0, boxY); //box level, left
+ mBox[4] = new MovingDrawable(d, start, p[4], NUM_FRAMES);
+ }
+
+ private void initAnimationBL(int width, int height, float density,
+ Drawable d, int boxSpacing) {
+ mLogoX = 40; //offset just a bit
+ mLogoY = height - mLogo.getHeight() - 80;
+
+ 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(boxX, 0); //top boxX
+ mBox[0] = new MovingDrawable(d, start, p[0], NUM_FRAMES);
+
+ start = new Point(width/2, 0); //top middle
+ mBox[1] = new MovingDrawable(d, start, p[1], NUM_FRAMES);
+
+ start = new Point(width, 0); //top 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;
@@ -190,6 +244,10 @@ public class LogoWallpaper extends WallpaperService {
initAnimationCenter(width, height, density, d, w);
else if("Top-Left".equals(mLocation))
initAnimationTL(width, height, density, d, w);
+ else if("Top-Right".equals(mLocation))
+ initAnimationTR(width, height, density, d, w);
+ else if("Bottom-Left".equals(mLocation))
+ initAnimationBL(width, height, density, d, w);
}
@Override