Loading core/res/res/drawable/notification_quantum_press.xml→core/res/res/drawable/notification_bg_dim.xml +6 −4 Original line number Diff line number Diff line Loading @@ -15,7 +15,9 @@ ~ limitations under the License --> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#ffcccccc" /> <corners android:radius="2dp" /> </shape> No newline at end of file <touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" android:tint="#ff444444" > <item android:drawable="@drawable/notification_bg_normal" /> </touch-feedback> No newline at end of file core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1092,6 +1092,7 @@ <java-symbol type="drawable" name="unlock_ring" /> <java-symbol type="drawable" name="unlock_wave" /> <java-symbol type="drawable" name="notification_bg" /> <java-symbol type="drawable" name="notification_bg_dim" /> <java-symbol type="drawable" name="notification_bg_low" /> <java-symbol type="drawable" name="notification_template_icon_bg" /> <java-symbol type="drawable" name="notification_template_icon_low_bg" /> Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +10 −6 Original line number Diff line number Diff line Loading @@ -423,9 +423,9 @@ public abstract class BaseStatusBar extends SystemUI implements } protected void applyLegacyRowBackground(StatusBarNotification sbn, View content) { if (sbn.getNotification().contentView.getLayoutId() != com.android.internal.R.layout.notification_template_base) { protected void applyLegacyRowBackground(StatusBarNotification sbn, NotificationData.Entry entry) { if (entry.expanded.getId() != com.android.internal.R.id.status_bar_latest_event_content) { int version = 0; try { ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.getPackageName(), 0); Loading @@ -434,7 +434,11 @@ public abstract class BaseStatusBar extends SystemUI implements Log.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPackageName(), ex); } if (version > 0 && version < Build.VERSION_CODES.GINGERBREAD) { content.setBackgroundResource(R.drawable.notification_row_legacy_bg); entry.row.setBackgroundResource(R.drawable.notification_row_legacy_bg); } else if (version < Build.VERSION_CODES.L) { entry.row.setBackgroundResourceIds( com.android.internal.R.drawable.notification_bg, com.android.internal.R.drawable.notification_bg_dim); } } } Loading Loading @@ -869,8 +873,6 @@ public abstract class BaseStatusBar extends SystemUI implements row.setDrawingCacheEnabled(true); applyLegacyRowBackground(sbn, content); if (MULTIUSER_DEBUG) { TextView debug = (TextView) row.findViewById(R.id.debug_info); if (debug != null) { Loading @@ -885,6 +887,8 @@ public abstract class BaseStatusBar extends SystemUI implements entry.expandedPublic = publicViewLocal; entry.setBigContentView(bigContentViewLocal); applyLegacyRowBackground(sbn, entry); return true; } Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +10 −0 Original line number Diff line number Diff line Loading @@ -219,4 +219,14 @@ public class ExpandableNotificationRow extends FrameLayout { public void setLocked(boolean locked) { mLatestItemView.setLocked(locked); } /** * Sets the resource id for the background of this notification. * * @param bgResId The background resource to use in normal state. * @param dimmedBgResId The background resource to use in dimmed state. */ public void setBackgroundResourceIds(int bgResId, int dimmedBgResId) { mLatestItemView.setBackgroundResourceIds(bgResId, dimmedBgResId); } } packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java +22 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityEvent; import android.widget.FrameLayout; import com.android.internal.R; public class LatestItemView extends FrameLayout { private static final long DOUBLETAP_TIMEOUT_MS = 1000; Loading @@ -32,6 +34,9 @@ public class LatestItemView extends FrameLayout { private boolean mDimmed; private boolean mLocked; private int mBgResId = R.drawable.notification_quantum_bg; private int mDimmedBgResId = R.drawable.notification_quantum_bg_dim; /** * Flag to indicate that the notification has been touched once and the second touch will * click it. Loading Loading @@ -148,11 +153,7 @@ public class LatestItemView extends FrameLayout { public void setDimmed(boolean dimmed) { if (mDimmed != dimmed) { mDimmed = dimmed; if (dimmed) { setBackgroundResource(com.android.internal.R.drawable.notification_quantum_bg_dim); } else { setBackgroundResource(com.android.internal.R.drawable.notification_quantum_bg); } updateBackgroundResource(); } } Loading @@ -163,4 +164,20 @@ public class LatestItemView extends FrameLayout { public void setLocked(boolean locked) { mLocked = locked; } /** * Sets the resource id for the background of this notification. * * @param bgResId The background resource to use in normal state. * @param dimmedBgResId The background resource to use in dimmed state. */ public void setBackgroundResourceIds(int bgResId, int dimmedBgResId) { mBgResId = bgResId; mDimmedBgResId = dimmedBgResId; updateBackgroundResource(); } private void updateBackgroundResource() { setBackgroundResource(mDimmed ? mDimmedBgResId : mBgResId); } } Loading
core/res/res/drawable/notification_quantum_press.xml→core/res/res/drawable/notification_bg_dim.xml +6 −4 Original line number Diff line number Diff line Loading @@ -15,7 +15,9 @@ ~ limitations under the License --> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#ffcccccc" /> <corners android:radius="2dp" /> </shape> No newline at end of file <touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" android:tint="#ff444444" > <item android:drawable="@drawable/notification_bg_normal" /> </touch-feedback> No newline at end of file
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1092,6 +1092,7 @@ <java-symbol type="drawable" name="unlock_ring" /> <java-symbol type="drawable" name="unlock_wave" /> <java-symbol type="drawable" name="notification_bg" /> <java-symbol type="drawable" name="notification_bg_dim" /> <java-symbol type="drawable" name="notification_bg_low" /> <java-symbol type="drawable" name="notification_template_icon_bg" /> <java-symbol type="drawable" name="notification_template_icon_low_bg" /> Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +10 −6 Original line number Diff line number Diff line Loading @@ -423,9 +423,9 @@ public abstract class BaseStatusBar extends SystemUI implements } protected void applyLegacyRowBackground(StatusBarNotification sbn, View content) { if (sbn.getNotification().contentView.getLayoutId() != com.android.internal.R.layout.notification_template_base) { protected void applyLegacyRowBackground(StatusBarNotification sbn, NotificationData.Entry entry) { if (entry.expanded.getId() != com.android.internal.R.id.status_bar_latest_event_content) { int version = 0; try { ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.getPackageName(), 0); Loading @@ -434,7 +434,11 @@ public abstract class BaseStatusBar extends SystemUI implements Log.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPackageName(), ex); } if (version > 0 && version < Build.VERSION_CODES.GINGERBREAD) { content.setBackgroundResource(R.drawable.notification_row_legacy_bg); entry.row.setBackgroundResource(R.drawable.notification_row_legacy_bg); } else if (version < Build.VERSION_CODES.L) { entry.row.setBackgroundResourceIds( com.android.internal.R.drawable.notification_bg, com.android.internal.R.drawable.notification_bg_dim); } } } Loading Loading @@ -869,8 +873,6 @@ public abstract class BaseStatusBar extends SystemUI implements row.setDrawingCacheEnabled(true); applyLegacyRowBackground(sbn, content); if (MULTIUSER_DEBUG) { TextView debug = (TextView) row.findViewById(R.id.debug_info); if (debug != null) { Loading @@ -885,6 +887,8 @@ public abstract class BaseStatusBar extends SystemUI implements entry.expandedPublic = publicViewLocal; entry.setBigContentView(bigContentViewLocal); applyLegacyRowBackground(sbn, entry); return true; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +10 −0 Original line number Diff line number Diff line Loading @@ -219,4 +219,14 @@ public class ExpandableNotificationRow extends FrameLayout { public void setLocked(boolean locked) { mLatestItemView.setLocked(locked); } /** * Sets the resource id for the background of this notification. * * @param bgResId The background resource to use in normal state. * @param dimmedBgResId The background resource to use in dimmed state. */ public void setBackgroundResourceIds(int bgResId, int dimmedBgResId) { mLatestItemView.setBackgroundResourceIds(bgResId, dimmedBgResId); } }
packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java +22 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityEvent; import android.widget.FrameLayout; import com.android.internal.R; public class LatestItemView extends FrameLayout { private static final long DOUBLETAP_TIMEOUT_MS = 1000; Loading @@ -32,6 +34,9 @@ public class LatestItemView extends FrameLayout { private boolean mDimmed; private boolean mLocked; private int mBgResId = R.drawable.notification_quantum_bg; private int mDimmedBgResId = R.drawable.notification_quantum_bg_dim; /** * Flag to indicate that the notification has been touched once and the second touch will * click it. Loading Loading @@ -148,11 +153,7 @@ public class LatestItemView extends FrameLayout { public void setDimmed(boolean dimmed) { if (mDimmed != dimmed) { mDimmed = dimmed; if (dimmed) { setBackgroundResource(com.android.internal.R.drawable.notification_quantum_bg_dim); } else { setBackgroundResource(com.android.internal.R.drawable.notification_quantum_bg); } updateBackgroundResource(); } } Loading @@ -163,4 +164,20 @@ public class LatestItemView extends FrameLayout { public void setLocked(boolean locked) { mLocked = locked; } /** * Sets the resource id for the background of this notification. * * @param bgResId The background resource to use in normal state. * @param dimmedBgResId The background resource to use in dimmed state. */ public void setBackgroundResourceIds(int bgResId, int dimmedBgResId) { mBgResId = bgResId; mDimmedBgResId = dimmedBgResId; updateBackgroundResource(); } private void updateBackgroundResource() { setBackgroundResource(mDimmed ? mDimmedBgResId : mBgResId); } }