diff --git a/core/java/com/android/internal/app/PlatLogoActivity.java b/core/java/com/android/internal/app/PlatLogoActivity.java index 3a2b647cdc8e0..bac8e213a4282 100644 --- a/core/java/com/android/internal/app/PlatLogoActivity.java +++ b/core/java/com/android/internal/app/PlatLogoActivity.java @@ -84,7 +84,7 @@ private View makeView() { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + final boolean isCid = getIntent().hasExtra("is_cid"); mToast = Toast.makeText(this, "", Toast.LENGTH_LONG); mToast.setView(makeView()); @@ -92,7 +92,8 @@ protected void onCreate(Bundle savedInstanceState) { getWindowManager().getDefaultDisplay().getMetrics(metrics); mContent = new ImageView(this); - mContent.setImageResource(com.android.internal.R.drawable.platlogo_alt); + mContent.setImageResource(isCid ? com.android.internal.R.drawable.cidlogo + : com.android.internal.R.drawable.platlogo_alt); mContent.setScaleType(ImageView.ScaleType.CENTER_INSIDE); final int p = (int)(32 * metrics.density); @@ -102,7 +103,8 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onClick(View v) { mToast.show(); - mContent.setImageResource(com.android.internal.R.drawable.platlogo); + mContent.setImageResource(isCid ? com.android.internal.R.drawable.cidlogo_alt + : com.android.internal.R.drawable.platlogo); } }); @@ -114,6 +116,7 @@ public boolean onLongClick(View v) { .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) + .putExtra("is_cid", isCid) .addCategory("com.android.internal.category.PLATLOGO")); //.setClassName("com.android.systemui","com.android.systemui.BeanBag")); } catch (ActivityNotFoundException ex) { diff --git a/core/res/res/drawable-nodpi/cidlogo.png b/core/res/res/drawable-nodpi/cidlogo.png new file mode 100644 index 0000000000000..ceb2246a7aa92 Binary files /dev/null and b/core/res/res/drawable-nodpi/cidlogo.png differ diff --git a/core/res/res/drawable-nodpi/cidlogo_alt.png b/core/res/res/drawable-nodpi/cidlogo_alt.png new file mode 100644 index 0000000000000..e5c03ed1c388d Binary files /dev/null and b/core/res/res/drawable-nodpi/cidlogo_alt.png differ diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 66e1b40c1bd9b..7faa65c12786e 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -974,6 +974,8 @@ + + diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index b5902922f5656..9bf15c1a7314a 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -217,8 +217,20 @@ + + + + + + + BeanFlinger + Use CID head + Use CID head instead of jellybean inside the dream Daydream diff --git a/packages/SystemUI/res/xml/dream_info.xml b/packages/SystemUI/res/xml/dream_info.xml new file mode 100644 index 0000000000000..df51bc426c780 --- /dev/null +++ b/packages/SystemUI/res/xml/dream_info.xml @@ -0,0 +1,4 @@ + + diff --git a/packages/SystemUI/res/xml/dream_settings.xml b/packages/SystemUI/res/xml/dream_settings.xml new file mode 100644 index 0000000000000..43fdc7f80d850 --- /dev/null +++ b/packages/SystemUI/res/xml/dream_settings.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/packages/SystemUI/src/com/android/systemui/BeanBag.java b/packages/SystemUI/src/com/android/systemui/BeanBag.java index f5a90ca4a7601..73136f3905271 100644 --- a/packages/SystemUI/src/com/android/systemui/BeanBag.java +++ b/packages/SystemUI/src/com/android/systemui/BeanBag.java @@ -137,6 +137,28 @@ static int pickInt(int[] array) { 0xFF333333, }; + static int CIDS[] = { + R.drawable.cid_angry, + R.drawable.cid_angry, + R.drawable.cid_angry, + R.drawable.cid_angry, + R.drawable.cid_normal, + R.drawable.cid_normal, + R.drawable.cid_confused, + }; + + static int CIDCOLORS[] = { + 0xFF0099CC, + 0xFF33B5E5, + 0xFF669900, + 0xFF99CC00, + 0xFFCC0000, + 0xFFFF8800, + 0xFFFFBB33, + 0xFF9933CC, + 0xFFAA66CC, + }; + public class Bean extends ImageView { public static final float VMAX = 1000.0f; public static final float VMIN = 100.0f; @@ -167,7 +189,7 @@ public String toString() { } private void pickBean() { - int beanId = pickInt(BEANS); + int beanId = pickInt(mIsCid ? CIDS : BEANS); if (randfrange(0,1) <= LUCKY) { beanId = R.drawable.jandycane; } @@ -182,7 +204,7 @@ private void pickBean() { this.setImageDrawable(bean); Paint pt = new Paint(); - final int color = pickInt(COLORS); + final int color = pickInt(mIsCid ? CIDCOLORS : COLORS); ColorMatrix CM = new ColorMatrix(); float[] M = CM.getArray(); // we assume the color information is in the red channel @@ -266,10 +288,11 @@ public boolean onTouchEvent(MotionEvent e) { TimeAnimator mAnim; private int boardWidth; private int boardHeight; + private boolean mIsCid; - public Board(Context context, AttributeSet as) { + public Board(Context context, AttributeSet as, boolean isCid) { super(context, as); - + mIsCid = isCid; setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); setWillNotDraw(!DEBUG); @@ -413,7 +436,7 @@ public void onStart() { WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED ); - mBoard = new Board(this, null); + mBoard = new Board(this, null, getIntent().getBooleanExtra("is_cid", false)); setContentView(mBoard); } diff --git a/packages/SystemUI/src/com/android/systemui/BeanBagDream.java b/packages/SystemUI/src/com/android/systemui/BeanBagDream.java index 39e472711cd8d..85c42d27b63d8 100644 --- a/packages/SystemUI/src/com/android/systemui/BeanBagDream.java +++ b/packages/SystemUI/src/com/android/systemui/BeanBagDream.java @@ -16,6 +16,8 @@ package com.android.systemui; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; import android.service.dreams.DreamService; import com.android.systemui.BeanBag.Board; @@ -29,7 +31,8 @@ public void onAttachedToWindow() { super.onAttachedToWindow(); setInteractive(true); setFullscreen(true); - mBoard = new Board(this, null); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); + mBoard = new Board(this, null, prefs.getBoolean("beanbag_dream_cid", false)); setContentView(mBoard); } diff --git a/packages/SystemUI/src/com/android/systemui/BeanBagDreamSettings.java b/packages/SystemUI/src/com/android/systemui/BeanBagDreamSettings.java new file mode 100644 index 0000000000000..171e8f42805ab --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/BeanBagDreamSettings.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui; + +import android.os.Bundle; +import android.preference.PreferenceActivity; + +import com.android.systemui.R; + +public class BeanBagDreamSettings extends PreferenceActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.dream_settings); + } +}