Skip to content

Commit 648342f

Browse files
author
Romain Guy
committed
Tale of status bar on crespo, part 2
Bug #6541079 In which a flood destroys flatland. Change-Id: Ifd1913b645c08531b221b3e010c133f14bcfb0c2
1 parent f7f16f7 commit 648342f

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@
3333
import android.content.IntentFilter;
3434
import android.content.res.Configuration;
3535
import android.content.res.Resources;
36+
import android.graphics.Canvas;
37+
import android.graphics.ColorFilter;
3638
import android.graphics.PixelFormat;
39+
import android.graphics.PorterDuff;
3740
import android.graphics.Rect;
41+
import android.graphics.drawable.Drawable;
3842
import android.inputmethodservice.InputMethodService;
3943
import android.os.IBinder;
4044
import android.os.Message;
@@ -313,8 +317,8 @@ public boolean onTouch(View v, MotionEvent event) {
313317

314318
if (!ActivityManager.isHighEndGfx(mDisplay)) {
315319
mStatusBarWindow.setBackground(null);
316-
mNotificationPanel.setBackgroundColor(context.getResources().getColor(
317-
R.color.notification_panel_solid_background));
320+
mNotificationPanel.setBackground(new FastColorDrawable(context.getResources().getColor(
321+
R.color.notification_panel_solid_background)));
318322
}
319323

320324
if (ENABLE_INTRUDERS) {
@@ -2127,5 +2131,38 @@ protected void haltTicker() {
21272131
protected boolean shouldDisableNavbarGestures() {
21282132
return mExpanded || (mDisabled & StatusBarManager.DISABLE_HOME) != 0;
21292133
}
2130-
}
21312134

2135+
private static class FastColorDrawable extends Drawable {
2136+
private final int mColor;
2137+
2138+
public FastColorDrawable(int color) {
2139+
mColor = 0xff000000 | color;
2140+
}
2141+
2142+
@Override
2143+
public void draw(Canvas canvas) {
2144+
canvas.drawColor(mColor, PorterDuff.Mode.SRC);
2145+
}
2146+
2147+
@Override
2148+
public void setAlpha(int alpha) {
2149+
}
2150+
2151+
@Override
2152+
public void setColorFilter(ColorFilter cf) {
2153+
}
2154+
2155+
@Override
2156+
public int getOpacity() {
2157+
return PixelFormat.OPAQUE;
2158+
}
2159+
2160+
@Override
2161+
public void setBounds(int left, int top, int right, int bottom) {
2162+
}
2163+
2164+
@Override
2165+
public void setBounds(Rect bounds) {
2166+
}
2167+
}
2168+
}

0 commit comments

Comments
 (0)