diff --git a/res/drawable/selecao.png b/res/drawable/selecao.png index 281d6b2..b54a03d 100644 Binary files a/res/drawable/selecao.png and b/res/drawable/selecao.png differ diff --git a/src/net/phoenixinquis/android/juiz/JuizWallpaper.java b/src/net/phoenixinquis/android/juiz/JuizWallpaper.java index 348f417..74283c1 100644 --- a/src/net/phoenixinquis/android/juiz/JuizWallpaper.java +++ b/src/net/phoenixinquis/android/juiz/JuizWallpaper.java @@ -1,5 +1,6 @@ package net.phoenixinquis.android.juiz; +import java.util.Calendar; import android.os.Handler; import android.os.SystemClock; import android.content.Context; @@ -118,7 +119,7 @@ public class JuizWallpaper extends WallpaperService { int w = mNoblesse.getWidth(); int h = mHeight - y; long now = SystemClock.elapsedRealtime(); - long offset = mNoblesse.getHeight() - (((now - mStartTime) / 10) % mNoblesse.getHeight()); + long offset = mNoblesse.getHeight() - (((now - mStartTime) / 7) % mNoblesse.getHeight()); mPaint.setStyle(Paint.Style.FILL); Rect clip = new Rect(x, y, x + w, y + h); c.clipRect(clip); @@ -142,12 +143,36 @@ public class JuizWallpaper extends WallpaperService { } } void DrawSelecao(Canvas c) { + int iconHeight = mSelecao.getHeight() / 4; + int iconWidth = mSelecao.getWidth() / 6; mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(2); mPaint.setAlpha(0xaa); - c.drawBitmap(mSelecao, 10, mStatusBarHeight, mPaint); + Calendar cal = Calendar.getInstance(); + for (int i = 0; i < 12; i++) { + /* The Selecao icons will be lit to display the current hour of the day. + * + * In the AM, an additional icon will be lit each hour until all are lit at noon. + * In the PM, each icon will darken each hour until all are out at midnight. + */ + + int hour = cal.get(cal.HOUR_OF_DAY); + boolean offline = !((hour % 12) > i); + if (hour > 12) offline = !offline; + int x = (i % 6) * iconWidth; + int y = (i / 6) * iconHeight; + Rect src = new Rect(x, y, x + iconWidth, y + iconHeight); + if (offline) { + src.top += 236; + src.bottom += 236; + src.left += 2; + src.right += 2; + } + Rect dst = new Rect(x + 11, y + mStatusBarHeight, x + iconWidth + 11, y + iconHeight + mStatusBarHeight); + c.drawBitmap(mSelecao, src, dst, mPaint); + } mPaint.setAlpha(0xff); - c.drawRect(10, mStatusBarHeight + 2, mSelecao.getWidth() + 10, mSelecao.getHeight() + mStatusBarHeight, mPaint); + c.drawRect(10, mStatusBarHeight + 2, mSelecao.getWidth() + 10, (iconHeight * 2) + mStatusBarHeight, mPaint); } } }