Loading packages/SystemUI/res/values/colors.xml +1 −0 Original line number Diff line number Diff line Loading @@ -105,4 +105,5 @@ <color name="search_panel_card_color">#ffffff</color> <color name="keyguard_user_switcher_background_gradient_color">#77000000</color> <color name="doze_small_icon_background_color">#ff434343</color> </resources> packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,9 @@ <!-- Doze: interval between pulses when following the notification light --> <integer name="doze_notification_pulse_interval">30000</integer> <!-- Doze: alpha to apply to small icons when dozing --> <integer name="doze_small_icon_alpha">222</integer><!-- 87% of 0xff --> <!-- Volume: time to delay dismissing the volume panel after a click is performed --> <integer name="volume_panel_dismiss_delay">200</integer> Loading packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -34,5 +34,6 @@ <item type="id" name="alpha_animator_start_value_tag"/> <item type="id" name="top_inset_animator_start_value_tag"/> <item type="id" name="height_animator_start_value_tag"/> <item type="id" name="doze_saved_filter_tag"/> </resources> packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +9 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,15 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { return false; } @Override public void setDark(boolean dark, boolean fade) { super.setDark(dark, fade); final NotificationContentView showing = getShowingLayout(); if (showing != null) { showing.setDark(dark, fade); } } public void setHeightRange(int rowMinHeight, int rowMaxHeight) { mRowMinHeight = rowMinHeight; mRowMaxHeight = rowMaxHeight; Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +53 −0 Original line number Diff line number Diff line Loading @@ -17,15 +17,20 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.ColorFilter; import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.view.animation.Interpolator; import android.view.animation.LinearInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; import com.android.systemui.R; Loading @@ -37,6 +42,8 @@ import com.android.systemui.R; public class NotificationContentView extends FrameLayout { private static final long ANIMATION_DURATION_LENGTH = 170; private static final Paint INVERT_PAINT = createInvertPaint(); private static final ColorFilter NO_COLOR_FILTER = new ColorFilter(); private final Rect mClipBounds = new Rect(); Loading @@ -50,6 +57,7 @@ public class NotificationContentView extends FrameLayout { private final Interpolator mLinearInterpolator = new LinearInterpolator(); private boolean mContractedVisible = true; private boolean mDark; private final Paint mFadePaint = new Paint(); Loading Loading @@ -192,4 +200,49 @@ public class NotificationContentView extends FrameLayout { public boolean isContentExpandable() { return mExpandedChild != null; } public void setDark(boolean dark, boolean fade) { if (mDark == dark) return; mDark = dark; setImageViewDark(dark, fade, com.android.internal.R.id.right_icon); setImageViewDark(dark, fade, com.android.internal.R.id.icon); } private void setImageViewDark(boolean dark, boolean fade, int imageViewId) { // TODO: implement fade final ImageView v = (ImageView) mContractedChild.findViewById(imageViewId); final Drawable d = v.getBackground(); if (dark) { v.setLayerType(LAYER_TYPE_HARDWARE, INVERT_PAINT); if (d != null) { v.setTag(R.id.doze_saved_filter_tag, d.getColorFilter() != null ? d.getColorFilter() : NO_COLOR_FILTER); d.setColorFilter(getResources().getColor(R.color.doze_small_icon_background_color), PorterDuff.Mode.SRC_ATOP); v.setImageAlpha(getResources().getInteger(R.integer.doze_small_icon_alpha)); } } else { v.setLayerType(LAYER_TYPE_NONE, null); if (d != null) { final ColorFilter filter = (ColorFilter) v.getTag(R.id.doze_saved_filter_tag); if (filter != null) { d.setColorFilter(filter == NO_COLOR_FILTER ? null : filter); v.setTag(R.id.doze_saved_filter_tag, null); } v.setImageAlpha(0xff); } } } private static Paint createInvertPaint() { final Paint p = new Paint(); final float[] invert = { -1f, 0f, 0f, 1f, 1f, 0f, -1f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 1f, 0f, 0f, 0f, 1f, 0f }; p.setColorFilter(new ColorMatrixColorFilter(new ColorMatrix(invert))); return p; } } Loading
packages/SystemUI/res/values/colors.xml +1 −0 Original line number Diff line number Diff line Loading @@ -105,4 +105,5 @@ <color name="search_panel_card_color">#ffffff</color> <color name="keyguard_user_switcher_background_gradient_color">#77000000</color> <color name="doze_small_icon_background_color">#ff434343</color> </resources>
packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,9 @@ <!-- Doze: interval between pulses when following the notification light --> <integer name="doze_notification_pulse_interval">30000</integer> <!-- Doze: alpha to apply to small icons when dozing --> <integer name="doze_small_icon_alpha">222</integer><!-- 87% of 0xff --> <!-- Volume: time to delay dismissing the volume panel after a click is performed --> <integer name="volume_panel_dismiss_delay">200</integer> Loading
packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -34,5 +34,6 @@ <item type="id" name="alpha_animator_start_value_tag"/> <item type="id" name="top_inset_animator_start_value_tag"/> <item type="id" name="height_animator_start_value_tag"/> <item type="id" name="doze_saved_filter_tag"/> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +9 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,15 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { return false; } @Override public void setDark(boolean dark, boolean fade) { super.setDark(dark, fade); final NotificationContentView showing = getShowingLayout(); if (showing != null) { showing.setDark(dark, fade); } } public void setHeightRange(int rowMinHeight, int rowMaxHeight) { mRowMinHeight = rowMinHeight; mRowMaxHeight = rowMaxHeight; Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +53 −0 Original line number Diff line number Diff line Loading @@ -17,15 +17,20 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.ColorFilter; import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.view.animation.Interpolator; import android.view.animation.LinearInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; import com.android.systemui.R; Loading @@ -37,6 +42,8 @@ import com.android.systemui.R; public class NotificationContentView extends FrameLayout { private static final long ANIMATION_DURATION_LENGTH = 170; private static final Paint INVERT_PAINT = createInvertPaint(); private static final ColorFilter NO_COLOR_FILTER = new ColorFilter(); private final Rect mClipBounds = new Rect(); Loading @@ -50,6 +57,7 @@ public class NotificationContentView extends FrameLayout { private final Interpolator mLinearInterpolator = new LinearInterpolator(); private boolean mContractedVisible = true; private boolean mDark; private final Paint mFadePaint = new Paint(); Loading Loading @@ -192,4 +200,49 @@ public class NotificationContentView extends FrameLayout { public boolean isContentExpandable() { return mExpandedChild != null; } public void setDark(boolean dark, boolean fade) { if (mDark == dark) return; mDark = dark; setImageViewDark(dark, fade, com.android.internal.R.id.right_icon); setImageViewDark(dark, fade, com.android.internal.R.id.icon); } private void setImageViewDark(boolean dark, boolean fade, int imageViewId) { // TODO: implement fade final ImageView v = (ImageView) mContractedChild.findViewById(imageViewId); final Drawable d = v.getBackground(); if (dark) { v.setLayerType(LAYER_TYPE_HARDWARE, INVERT_PAINT); if (d != null) { v.setTag(R.id.doze_saved_filter_tag, d.getColorFilter() != null ? d.getColorFilter() : NO_COLOR_FILTER); d.setColorFilter(getResources().getColor(R.color.doze_small_icon_background_color), PorterDuff.Mode.SRC_ATOP); v.setImageAlpha(getResources().getInteger(R.integer.doze_small_icon_alpha)); } } else { v.setLayerType(LAYER_TYPE_NONE, null); if (d != null) { final ColorFilter filter = (ColorFilter) v.getTag(R.id.doze_saved_filter_tag); if (filter != null) { d.setColorFilter(filter == NO_COLOR_FILTER ? null : filter); v.setTag(R.id.doze_saved_filter_tag, null); } v.setImageAlpha(0xff); } } } private static Paint createInvertPaint() { final Paint p = new Paint(); final float[] invert = { -1f, 0f, 0f, 1f, 1f, 0f, -1f, 0f, 1f, 1f, 0f, 0f, -1f, 1f, 1f, 0f, 0f, 0f, 1f, 0f }; p.setColorFilter(new ColorMatrixColorFilter(new ColorMatrix(invert))); return p; } }