summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2013-10-14 21:49:31 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-14 21:49:31 -0700
commit61cab9d3ff87278ca58cf7a8956fba6e845a4714 (patch)
treeb0a50d65b9d55d5515e8231a7a2979246d80b234 /packages/SystemUI
parenta0ce8c92cfd06af14962bfba120bd176c936d4f0 (diff)
parent334e3d7c3c8ca9042a57f287d82a3460ab496806 (diff)
downloadframeworks_base-61cab9d3ff87278ca58cf7a8956fba6e845a4714.zip
frameworks_base-61cab9d3ff87278ca58cf7a8956fba6e845a4714.tar.gz
frameworks_base-61cab9d3ff87278ca58cf7a8956fba6e845a4714.tar.bz2
am 334e3d7c: am ee8ee0ee: Merge "Put DessertCase on a diet." into klp-dev
* commit '334e3d7c3c8ca9042a57f287d82a3460ab496806': Put DessertCase on a diet.
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/AndroidManifest.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/DessertCaseView.java27
2 files changed, 24 insertions, 7 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 260a3be..09ac2da 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -200,7 +200,8 @@
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:hardwareAccelerated="true"
android:launchMode="singleInstance"
- android:configChanges="orientation|screenSize"
+ android:screenOrientation="locked"
+ android:process=":sweetsweetdesserts"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -215,6 +216,7 @@
android:exported="true"
android:label="@string/dessert_case"
android:enabled="false"
+ android:process=":sweetsweetdesserts"
>
<intent-filter>
<action android:name="android.service.dreams.DreamService" />
diff --git a/packages/SystemUI/src/com/android/systemui/DessertCaseView.java b/packages/SystemUI/src/com/android/systemui/DessertCaseView.java
index 99c59d5..90de65e 100644
--- a/packages/SystemUI/src/com/android/systemui/DessertCaseView.java
+++ b/packages/SystemUI/src/com/android/systemui/DessertCaseView.java
@@ -96,6 +96,13 @@ public class DessertCaseView extends FrameLayout {
1f, 0f, 0f, 0f, 0f
};
+ private static final float[] ALPHA_MASK = {
+ 0f, 0f, 0f, 0f, 255f,
+ 0f, 0f, 0f, 0f, 255f,
+ 0f, 0f, 0f, 0f, 255f,
+ 0f, 0f, 0f, 1f, 0f
+ };
+
private static final float[] WHITE_MASK = {
0f, 0f, 0f, 0f, 255f,
0f, 0f, 0f, 0f, 255f,
@@ -162,8 +169,8 @@ public class DessertCaseView extends FrameLayout {
for (int[] list : new int[][] { PASTRIES, RARE_PASTRIES, XRARE_PASTRIES, XXRARE_PASTRIES }) {
for (int resid : list) {
final BitmapDrawable d = new BitmapDrawable(res,
- BitmapFactory.decodeResource(res, resid, opts));
- d.setColorFilter(new ColorMatrixColorFilter(MASK));
+ convertToAlphaMask(BitmapFactory.decodeResource(res, resid, opts)));
+ d.setColorFilter(new ColorMatrixColorFilter(ALPHA_MASK));
d.setBounds(0, 0, mCellSize, mCellSize);
mDrawables.append(resid, d);
}
@@ -171,6 +178,15 @@ public class DessertCaseView extends FrameLayout {
if (DEBUG) setWillNotDraw(false);
}
+ private static Bitmap convertToAlphaMask(Bitmap b) {
+ Bitmap a = Bitmap.createBitmap(b.getWidth(), b.getHeight(), Bitmap.Config.ALPHA_8);
+ Canvas c = new Canvas(a);
+ Paint pt = new Paint();
+ pt.setColorFilter(new ColorMatrixColorFilter(MASK));
+ c.drawBitmap(b, 0.0f, 0.0f, pt);
+ return a;
+ }
+
public void start() {
if (!mStarted) {
mStarted = true;
@@ -273,9 +289,9 @@ public class DessertCaseView extends FrameLayout {
final float which = frand();
final Drawable d;
- if (which < 0.001f) {
+ if (which < 0.0005f) {
d = mDrawables.get(pick(XXRARE_PASTRIES));
- } else if (which < 0.01f) {
+ } else if (which < 0.005f) {
d = mDrawables.get(pick(XRARE_PASTRIES));
} else if (which < 0.5f) {
d = mDrawables.get(pick(RARE_PASTRIES));
@@ -288,8 +304,7 @@ public class DessertCaseView extends FrameLayout {
v.getOverlay().add(d);
}
- final Paint paint = new Paint();
- v.setLayerType(View.LAYER_TYPE_HARDWARE, paint);
+ v.setLayerType(View.LAYER_TYPE_HARDWARE, null);
lp.width = lp.height = mCellSize;
addView(v, lp);