Loading core/java/android/app/Notification.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -4257,15 +4257,17 @@ public class Notification implements Parcelable * Construct a RemoteViews for the final notification header only. This will not be * Construct a RemoteViews for the final notification header only. This will not be * colorized. * colorized. * * * @param ambient if true, generate the header for the ambient display layout. * @hide * @hide */ */ public RemoteViews makeNotificationHeader() { public RemoteViews makeNotificationHeader(boolean ambient) { Boolean colorized = (Boolean) mN.extras.get(EXTRA_COLORIZED); Boolean colorized = (Boolean) mN.extras.get(EXTRA_COLORIZED); mN.extras.putBoolean(EXTRA_COLORIZED, false); mN.extras.putBoolean(EXTRA_COLORIZED, false); RemoteViews header = new BuilderRemoteViews(mContext.getApplicationInfo(), RemoteViews header = new BuilderRemoteViews(mContext.getApplicationInfo(), R.layout.notification_template_header); ambient ? R.layout.notification_template_ambient_header : R.layout.notification_template_header); resetNotificationHeader(header); resetNotificationHeader(header); bindNotificationHeader(header, false /* ambient */); bindNotificationHeader(header, ambient); if (colorized != null) { if (colorized != null) { mN.extras.putBoolean(EXTRA_COLORIZED, colorized); mN.extras.putBoolean(EXTRA_COLORIZED, colorized); } else { } else { Loading Loading @@ -4407,7 +4409,7 @@ public class Notification implements Parcelable } } } } RemoteViews header = makeNotificationHeader(); RemoteViews header = makeNotificationHeader(false /* ambient */); header.setBoolean(R.id.notification_header, "setAcceptAllTouches", true); header.setBoolean(R.id.notification_header, "setAcceptAllTouches", true); if (summary != null) { if (summary != null) { mN.extras.putCharSequence(EXTRA_SUB_TEXT, summary); mN.extras.putCharSequence(EXTRA_SUB_TEXT, summary); Loading core/res/res/layout/notification_template_ambient_header.xml 0 → 100644 +28 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2017 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. --> <!-- hack to work around <include /> not being supported at the top level --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:paddingStart="@dimen/notification_extra_margin_ambient" android:paddingEnd="@dimen/notification_extra_margin_ambient" android:layout_width="wrap_content" android:layout_height="wrap_content"> <include layout="@layout/notification_template_header" android:theme="@style/Theme.Material.Notification.Ambient"/> </FrameLayout> core/res/res/values/symbols.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -2933,6 +2933,8 @@ <java-symbol type="string" name="time_picker_text_input_mode_description"/> <java-symbol type="string" name="time_picker_text_input_mode_description"/> <java-symbol type="string" name="time_picker_radial_mode_description"/> <java-symbol type="string" name="time_picker_radial_mode_description"/> <java-symbol type="layout" name="notification_template_ambient_header" /> <!-- resolver activity --> <!-- resolver activity --> <java-symbol type="drawable" name="resolver_icon_placeholder" /> <java-symbol type="drawable" name="resolver_icon_placeholder" /> Loading packages/SystemUI/res/layout/hybrid_notification.xml +8 −9 Original line number Original line Diff line number Diff line Loading @@ -19,23 +19,22 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:paddingStart="@*android:dimen/notification_content_margin_start" android:gravity="bottom|start" android:paddingEnd="12dp" style="?attr/hybridNotificationStyle"> android:gravity="bottom|start"> <TextView <TextView android:id="@+id/notification_title" android:id="@+id/notification_title" android:layout_width="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:paddingEnd="4dp" android:singleLine="true" android:textAppearance="@*android:style/TextAppearance.Material.Notification.Title" android:textAppearance="@*android:style/TextAppearance.Material.Notification.Title" android:singleLine="true" style="?attr/hybridNotificationTitleStyle" /> /> <TextView <TextView android:id="@+id/notification_text" android:id="@+id/notification_text" android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:paddingEnd="4dp" android:textAppearance="@*android:style/TextAppearance.Material.Notification" android:singleLine="true" android:singleLine="true" android:textAppearance="@*android:style/TextAppearance.Material.Notification" style="?attr/hybridNotificationTextStyle" /> /> </com.android.systemui.statusbar.notification.HybridNotificationView> </com.android.systemui.statusbar.notification.HybridNotificationView> No newline at end of file packages/SystemUI/res/layout/hybrid_overflow_number.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,7 @@ android:layout_width="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:textAppearance="@*android:style/TextAppearance.Material.Notification" android:textAppearance="@*android:style/TextAppearance.Material.Notification" android:paddingEnd="@*android:dimen/notification_content_margin_end" android:paddingEnd="@dimen/group_overflow_number_padding" android:gravity="end" android:gravity="end" android:singleLine="true" android:singleLine="true" /> /> No newline at end of file Loading
core/java/android/app/Notification.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -4257,15 +4257,17 @@ public class Notification implements Parcelable * Construct a RemoteViews for the final notification header only. This will not be * Construct a RemoteViews for the final notification header only. This will not be * colorized. * colorized. * * * @param ambient if true, generate the header for the ambient display layout. * @hide * @hide */ */ public RemoteViews makeNotificationHeader() { public RemoteViews makeNotificationHeader(boolean ambient) { Boolean colorized = (Boolean) mN.extras.get(EXTRA_COLORIZED); Boolean colorized = (Boolean) mN.extras.get(EXTRA_COLORIZED); mN.extras.putBoolean(EXTRA_COLORIZED, false); mN.extras.putBoolean(EXTRA_COLORIZED, false); RemoteViews header = new BuilderRemoteViews(mContext.getApplicationInfo(), RemoteViews header = new BuilderRemoteViews(mContext.getApplicationInfo(), R.layout.notification_template_header); ambient ? R.layout.notification_template_ambient_header : R.layout.notification_template_header); resetNotificationHeader(header); resetNotificationHeader(header); bindNotificationHeader(header, false /* ambient */); bindNotificationHeader(header, ambient); if (colorized != null) { if (colorized != null) { mN.extras.putBoolean(EXTRA_COLORIZED, colorized); mN.extras.putBoolean(EXTRA_COLORIZED, colorized); } else { } else { Loading Loading @@ -4407,7 +4409,7 @@ public class Notification implements Parcelable } } } } RemoteViews header = makeNotificationHeader(); RemoteViews header = makeNotificationHeader(false /* ambient */); header.setBoolean(R.id.notification_header, "setAcceptAllTouches", true); header.setBoolean(R.id.notification_header, "setAcceptAllTouches", true); if (summary != null) { if (summary != null) { mN.extras.putCharSequence(EXTRA_SUB_TEXT, summary); mN.extras.putCharSequence(EXTRA_SUB_TEXT, summary); Loading
core/res/res/layout/notification_template_ambient_header.xml 0 → 100644 +28 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2017 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. --> <!-- hack to work around <include /> not being supported at the top level --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:paddingStart="@dimen/notification_extra_margin_ambient" android:paddingEnd="@dimen/notification_extra_margin_ambient" android:layout_width="wrap_content" android:layout_height="wrap_content"> <include layout="@layout/notification_template_header" android:theme="@style/Theme.Material.Notification.Ambient"/> </FrameLayout>
core/res/res/values/symbols.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -2933,6 +2933,8 @@ <java-symbol type="string" name="time_picker_text_input_mode_description"/> <java-symbol type="string" name="time_picker_text_input_mode_description"/> <java-symbol type="string" name="time_picker_radial_mode_description"/> <java-symbol type="string" name="time_picker_radial_mode_description"/> <java-symbol type="layout" name="notification_template_ambient_header" /> <!-- resolver activity --> <!-- resolver activity --> <java-symbol type="drawable" name="resolver_icon_placeholder" /> <java-symbol type="drawable" name="resolver_icon_placeholder" /> Loading
packages/SystemUI/res/layout/hybrid_notification.xml +8 −9 Original line number Original line Diff line number Diff line Loading @@ -19,23 +19,22 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:paddingStart="@*android:dimen/notification_content_margin_start" android:gravity="bottom|start" android:paddingEnd="12dp" style="?attr/hybridNotificationStyle"> android:gravity="bottom|start"> <TextView <TextView android:id="@+id/notification_title" android:id="@+id/notification_title" android:layout_width="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:paddingEnd="4dp" android:singleLine="true" android:textAppearance="@*android:style/TextAppearance.Material.Notification.Title" android:textAppearance="@*android:style/TextAppearance.Material.Notification.Title" android:singleLine="true" style="?attr/hybridNotificationTitleStyle" /> /> <TextView <TextView android:id="@+id/notification_text" android:id="@+id/notification_text" android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:paddingEnd="4dp" android:textAppearance="@*android:style/TextAppearance.Material.Notification" android:singleLine="true" android:singleLine="true" android:textAppearance="@*android:style/TextAppearance.Material.Notification" style="?attr/hybridNotificationTextStyle" /> /> </com.android.systemui.statusbar.notification.HybridNotificationView> </com.android.systemui.statusbar.notification.HybridNotificationView> No newline at end of file
packages/SystemUI/res/layout/hybrid_overflow_number.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,7 @@ android:layout_width="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:textAppearance="@*android:style/TextAppearance.Material.Notification" android:textAppearance="@*android:style/TextAppearance.Material.Notification" android:paddingEnd="@*android:dimen/notification_content_margin_end" android:paddingEnd="@dimen/group_overflow_number_padding" android:gravity="end" android:gravity="end" android:singleLine="true" android:singleLine="true" /> /> No newline at end of file