Loading core/java/android/app/Notification.java +45 −0 Original line number Diff line number Diff line Loading @@ -5577,6 +5577,24 @@ public class Notification implements Parcelable public void setRebuildStyledRemoteViews(boolean rebuild) { mRebuildStyledRemoteViews = rebuild; } /** * Get the text that should be displayed in the statusBar when heads upped. This is * usually just the app name, but may be different depending on the style. * * @param publicMode If true, return a text that is safe to display in public. * * @hide */ public CharSequence getHeadsUpStatusBarText(boolean publicMode) { if (mStyle != null && !publicMode) { CharSequence text = mStyle.getHeadsUpStatusBarText(); if (!TextUtils.isEmpty(text)) { return text; } } return loadHeaderAppName(); } } /** Loading Loading @@ -5954,6 +5972,16 @@ public class Notification implements Parcelable * @hide */ public abstract boolean areNotificationsVisiblyDifferent(Style other); /** * @return the the text that should be displayed in the statusBar when heads-upped. * If {@code null} is returned, the default implementation will be used. * * @hide */ public CharSequence getHeadsUpStatusBarText() { return null; } } /** Loading Loading @@ -6402,6 +6430,23 @@ public class Notification implements Parcelable } } /** * @return the the text that should be displayed in the statusBar when heads upped. * If {@code null} is returned, the default implementation will be used. * * @hide */ @Override public CharSequence getHeadsUpStatusBarText() { CharSequence conversationTitle = !TextUtils.isEmpty(super.mBigContentTitle) ? super.mBigContentTitle : mConversationTitle; if (!TextUtils.isEmpty(conversationTitle) && !hasOnlyWhiteSpaceSenders()) { return conversationTitle; } return null; } /** * @return the user to be displayed for any replies sent by the user */ Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3231,6 +3231,7 @@ <java-symbol type="id" name="remote_input_progress" /> <java-symbol type="id" name="remote_input_send" /> <java-symbol type="id" name="remote_input" /> <java-symbol type="dimen" name="notification_content_margin" /> <java-symbol type="dimen" name="slice_shortcut_size" /> <java-symbol type="dimen" name="slice_icon_size" /> <java-symbol type="dimen" name="slice_padding" /> Loading packages/SystemUI/res/drawable/heads_up_scrim.xml→packages/SystemUI/res/layout/heads_up_status_bar_layout.xml +48 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2014 The Android Open Source Project ~ Copyright (C) 2018 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. Loading @@ -15,11 +14,35 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> <com.android.systemui.statusbar.HeadsUpStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="invisible" android:id="@+id/heads_up_status_bar_view" android:alpha="0" > <!-- This is a space just used as a layout and it's not actually displaying anything. We're repositioning the statusbar icon to the position where this is laid out when showing this view. --> <Space android:id="@+id/icon_placeholder" android:layout_width="@dimen/status_bar_icon_drawing_size" android:layout_height="@dimen/status_bar_icon_drawing_size" android:layout_gravity="center_vertical" /> <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.HeadsUpStatusBarText" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" android:textAlignment="viewStart" android:paddingStart="6dp" android:layout_weight="1" android:layout_gravity="center_vertical" /> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:type="linear" android:angle="-90" android:startColor="#55000000" android:endColor="#00000000" /> </shape> No newline at end of file </com.android.systemui.statusbar.HeadsUpStatusBarView> packages/SystemUI/res/layout/notification_icon_area.xml +4 −2 Original line number Diff line number Diff line Loading @@ -18,12 +18,14 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/notification_icon_area_inner" android:layout_width="match_parent" android:layout_height="match_parent" > android:layout_height="match_parent" android:clipChildren="false"> <com.android.systemui.statusbar.phone.NotificationIconContainer android:id="@+id/notificationIcons" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentStart="true" android:gravity="center_vertical" android:orientation="horizontal"/> android:orientation="horizontal" android:clipChildren="false"/> </com.android.keyguard.AlphaOptimizedLinearLayout> No newline at end of file packages/SystemUI/res/layout/status_bar.xml +40 −32 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ android:id="@+id/notification_lights_out" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="match_parent" android:paddingStart="6dip" android:paddingStart="@dimen/status_bar_padding_start" android:paddingBottom="2dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" Loading @@ -44,7 +44,7 @@ <LinearLayout android:id="@+id/status_bar_contents" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingStart="6dp" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="8dp" android:orientation="horizontal" > Loading @@ -53,11 +53,17 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout="@layout/operator_name" /> <FrameLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1"> <include layout="@layout/heads_up_status_bar_layout" /> <LinearLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1" android:layout_width="match_parent" android:clipChildren="false" > <com.android.systemui.statusbar.policy.Clock android:id="@+id/clock" Loading @@ -77,9 +83,11 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" /> android:orientation="horizontal" android:clipChildren="false"/> </LinearLayout> </FrameLayout> <!-- Space should cover the notch (if it exists) and let other views lay out around it --> <android.widget.Space Loading Loading
core/java/android/app/Notification.java +45 −0 Original line number Diff line number Diff line Loading @@ -5577,6 +5577,24 @@ public class Notification implements Parcelable public void setRebuildStyledRemoteViews(boolean rebuild) { mRebuildStyledRemoteViews = rebuild; } /** * Get the text that should be displayed in the statusBar when heads upped. This is * usually just the app name, but may be different depending on the style. * * @param publicMode If true, return a text that is safe to display in public. * * @hide */ public CharSequence getHeadsUpStatusBarText(boolean publicMode) { if (mStyle != null && !publicMode) { CharSequence text = mStyle.getHeadsUpStatusBarText(); if (!TextUtils.isEmpty(text)) { return text; } } return loadHeaderAppName(); } } /** Loading Loading @@ -5954,6 +5972,16 @@ public class Notification implements Parcelable * @hide */ public abstract boolean areNotificationsVisiblyDifferent(Style other); /** * @return the the text that should be displayed in the statusBar when heads-upped. * If {@code null} is returned, the default implementation will be used. * * @hide */ public CharSequence getHeadsUpStatusBarText() { return null; } } /** Loading Loading @@ -6402,6 +6430,23 @@ public class Notification implements Parcelable } } /** * @return the the text that should be displayed in the statusBar when heads upped. * If {@code null} is returned, the default implementation will be used. * * @hide */ @Override public CharSequence getHeadsUpStatusBarText() { CharSequence conversationTitle = !TextUtils.isEmpty(super.mBigContentTitle) ? super.mBigContentTitle : mConversationTitle; if (!TextUtils.isEmpty(conversationTitle) && !hasOnlyWhiteSpaceSenders()) { return conversationTitle; } return null; } /** * @return the user to be displayed for any replies sent by the user */ Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3231,6 +3231,7 @@ <java-symbol type="id" name="remote_input_progress" /> <java-symbol type="id" name="remote_input_send" /> <java-symbol type="id" name="remote_input" /> <java-symbol type="dimen" name="notification_content_margin" /> <java-symbol type="dimen" name="slice_shortcut_size" /> <java-symbol type="dimen" name="slice_icon_size" /> <java-symbol type="dimen" name="slice_padding" /> Loading
packages/SystemUI/res/drawable/heads_up_scrim.xml→packages/SystemUI/res/layout/heads_up_status_bar_layout.xml +48 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2014 The Android Open Source Project ~ Copyright (C) 2018 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. Loading @@ -15,11 +14,35 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> <com.android.systemui.statusbar.HeadsUpStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" android:visibility="invisible" android:id="@+id/heads_up_status_bar_view" android:alpha="0" > <!-- This is a space just used as a layout and it's not actually displaying anything. We're repositioning the statusbar icon to the position where this is laid out when showing this view. --> <Space android:id="@+id/icon_placeholder" android:layout_width="@dimen/status_bar_icon_drawing_size" android:layout_height="@dimen/status_bar_icon_drawing_size" android:layout_gravity="center_vertical" /> <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.HeadsUpStatusBarText" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" android:textAlignment="viewStart" android:paddingStart="6dp" android:layout_weight="1" android:layout_gravity="center_vertical" /> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:type="linear" android:angle="-90" android:startColor="#55000000" android:endColor="#00000000" /> </shape> No newline at end of file </com.android.systemui.statusbar.HeadsUpStatusBarView>
packages/SystemUI/res/layout/notification_icon_area.xml +4 −2 Original line number Diff line number Diff line Loading @@ -18,12 +18,14 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/notification_icon_area_inner" android:layout_width="match_parent" android:layout_height="match_parent" > android:layout_height="match_parent" android:clipChildren="false"> <com.android.systemui.statusbar.phone.NotificationIconContainer android:id="@+id/notificationIcons" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentStart="true" android:gravity="center_vertical" android:orientation="horizontal"/> android:orientation="horizontal" android:clipChildren="false"/> </com.android.keyguard.AlphaOptimizedLinearLayout> No newline at end of file
packages/SystemUI/res/layout/status_bar.xml +40 −32 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ android:id="@+id/notification_lights_out" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="match_parent" android:paddingStart="6dip" android:paddingStart="@dimen/status_bar_padding_start" android:paddingBottom="2dip" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" Loading @@ -44,7 +44,7 @@ <LinearLayout android:id="@+id/status_bar_contents" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingStart="6dp" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="8dp" android:orientation="horizontal" > Loading @@ -53,11 +53,17 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout="@layout/operator_name" /> <FrameLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1"> <include layout="@layout/heads_up_status_bar_layout" /> <LinearLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1" android:layout_width="match_parent" android:clipChildren="false" > <com.android.systemui.statusbar.policy.Clock android:id="@+id/clock" Loading @@ -77,9 +83,11 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" /> android:orientation="horizontal" android:clipChildren="false"/> </LinearLayout> </FrameLayout> <!-- Space should cover the notch (if it exists) and let other views lay out around it --> <android.widget.Space Loading