|
33 | 33 | import android.content.IntentFilter; |
34 | 34 | import android.content.res.Configuration; |
35 | 35 | import android.content.res.Resources; |
| 36 | +import android.graphics.Canvas; |
| 37 | +import android.graphics.ColorFilter; |
36 | 38 | import android.graphics.PixelFormat; |
| 39 | +import android.graphics.PorterDuff; |
37 | 40 | import android.graphics.Rect; |
| 41 | +import android.graphics.drawable.Drawable; |
38 | 42 | import android.inputmethodservice.InputMethodService; |
39 | 43 | import android.os.IBinder; |
40 | 44 | import android.os.Message; |
@@ -313,8 +317,8 @@ public boolean onTouch(View v, MotionEvent event) { |
313 | 317 |
|
314 | 318 | if (!ActivityManager.isHighEndGfx(mDisplay)) { |
315 | 319 | 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))); |
318 | 322 | } |
319 | 323 |
|
320 | 324 | if (ENABLE_INTRUDERS) { |
@@ -2127,5 +2131,38 @@ protected void haltTicker() { |
2127 | 2131 | protected boolean shouldDisableNavbarGestures() { |
2128 | 2132 | return mExpanded || (mDisabled & StatusBarManager.DISABLE_HOME) != 0; |
2129 | 2133 | } |
2130 | | -} |
2131 | 2134 |
|
| 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