Updated Selecao icon set and behaviour

The selecao icons now more closely resemble the design used on the
phones in the anime. Also, they will light up and dim to reflect the
current hour of day.
This commit is contained in:
Correl Roush 2012-01-01 02:04:34 -05:00
parent bb361d8b68
commit 0bc90c532b
2 changed files with 28 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View file

@ -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);
}
}
}