Loading core/java/android/app/Notification.java +12 −8 Original line number Diff line number Diff line Loading @@ -5303,14 +5303,18 @@ public class Notification implements Parcelable } private void bindExpandButton(RemoteViews contentView, StandardTemplateParams p) { contentView.setInt( R.id.expand_button, "setDefaultTextColor", getPrimaryTextColor(p)); contentView.setInt( R.id.expand_button, "setDefaultPillColor", getProtectionColor(p)); contentView.setInt( R.id.expand_button, "setHighlightTextColor", getBackgroundColor(p)); contentView.setInt( R.id.expand_button, "setHighlightPillColor", getAccentColor(p)); // set default colors int textColor = getPrimaryTextColor(p); int pillColor = getProtectionColor(p); contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor); contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor); // Use different highlighted colors except when low-priority mode prevents that if (!p.forceDefaultColor) { textColor = getBackgroundColor(p); pillColor = getAccentColor(p); } contentView.setInt(R.id.expand_button, "setHighlightTextColor", textColor); contentView.setInt(R.id.expand_button, "setHighlightPillColor", pillColor); } private void bindHeaderChronometerAndTime(RemoteViews contentView, Loading core/java/android/view/NotificationHeaderView.java +7 −4 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; import android.util.AttributeSet; import android.widget.FrameLayout; import android.widget.RelativeLayout; import android.widget.RemoteViews; import com.android.internal.R; Loading @@ -42,7 +42,7 @@ import java.util.ArrayList; * @hide */ @RemoteViews.RemoteView public class NotificationHeaderView extends FrameLayout { public class NotificationHeaderView extends RelativeLayout { private final int mHeadingEndMargin; private final int mTouchableHeight; private OnClickListener mExpandClickListener; Loading Loading @@ -159,7 +159,7 @@ public class NotificationHeaderView extends FrameLayout { * @param extraMarginEnd extra margin in px */ public void setTopLineExtraMarginEnd(int extraMarginEnd) { mTopLineView.setHeaderTextMarginEnd(extraMarginEnd + mHeadingEndMargin); mTopLineView.setHeaderTextMarginEnd(extraMarginEnd); } /** Loading @@ -181,12 +181,15 @@ public class NotificationHeaderView extends FrameLayout { * @return extra margin */ public int getTopLineExtraMarginEnd() { return mTopLineView.getHeaderTextMarginEnd() - mHeadingEndMargin; return mTopLineView.getHeaderTextMarginEnd(); } /** * Get the base margin at the end of the top line view. * Add this to {@link #getTopLineExtraMarginEnd()} to get the total margin of the top line. * <p> * NOTE: This method's result is only valid if the expander does not have a number. Currently * only groups headers and conversations have numbers, so this is safe to use by MediaStyle. * * @return base margin */ Loading core/java/com/android/internal/widget/NotificationExpandButton.java +4 −2 Original line number Diff line number Diff line Loading @@ -220,7 +220,9 @@ public class NotificationExpandButton extends FrameLayout { */ @RemotableViewMethod public void setNumber(int number) { if (mNumber != number) { mNumber = number; updateNumber(); } } } core/res/res/layout/notification_template_header.xml +11 −6 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ android:id="@+id/left_icon" android:layout_width="@dimen/notification_left_icon_size" android:layout_height="@dimen/notification_left_icon_size" android:layout_gravity="center_vertical|start" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_marginStart="@dimen/notification_left_icon_start" android:background="@drawable/notification_large_icon_outline" android:clipToOutline="true" Loading @@ -43,7 +44,8 @@ android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" android:layout_gravity="center_vertical|start" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_marginStart="@dimen/notification_icon_circle_start" android:background="@drawable/notification_icon_circle" android:padding="@dimen/notification_icon_circle_padding" Loading @@ -55,10 +57,12 @@ android:id="@+id/notification_top_line" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_toStartOf="@id/expand_button" android:layout_alignWithParentIfMissing="true" android:clipChildren="false" android:gravity="center_vertical" android:paddingEnd="@dimen/notification_heading_margin_end" android:paddingStart="@dimen/notification_content_margin_start" android:theme="@style/Theme.DeviceDefault.Notification" > Loading @@ -71,14 +75,15 @@ android:id="@+id/alternate_expand_target" android:layout_width="@dimen/notification_content_margin_start" android:layout_height="match_parent" android:layout_gravity="start" android:layout_alignParentStart="true" android:importantForAccessibility="no" /> <include layout="@layout/notification_expand_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:layout_alignParentEnd="true" android:layout_centerVertical="true" /> </NotificationHeaderView> core/res/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ <dimen name="notification_content_margin_end">16dp</dimen> <!-- The margin on the end of the top-line content views (accommodates the expander) --> <dimen name="notification_heading_margin_end">48dp</dimen> <dimen name="notification_heading_margin_end">56dp</dimen> <!-- The margin for text at the end of the image view for media notifications --> <dimen name="notification_media_image_margin_end">72dp</dimen> Loading Loading
core/java/android/app/Notification.java +12 −8 Original line number Diff line number Diff line Loading @@ -5303,14 +5303,18 @@ public class Notification implements Parcelable } private void bindExpandButton(RemoteViews contentView, StandardTemplateParams p) { contentView.setInt( R.id.expand_button, "setDefaultTextColor", getPrimaryTextColor(p)); contentView.setInt( R.id.expand_button, "setDefaultPillColor", getProtectionColor(p)); contentView.setInt( R.id.expand_button, "setHighlightTextColor", getBackgroundColor(p)); contentView.setInt( R.id.expand_button, "setHighlightPillColor", getAccentColor(p)); // set default colors int textColor = getPrimaryTextColor(p); int pillColor = getProtectionColor(p); contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor); contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor); // Use different highlighted colors except when low-priority mode prevents that if (!p.forceDefaultColor) { textColor = getBackgroundColor(p); pillColor = getAccentColor(p); } contentView.setInt(R.id.expand_button, "setHighlightTextColor", textColor); contentView.setInt(R.id.expand_button, "setHighlightPillColor", pillColor); } private void bindHeaderChronometerAndTime(RemoteViews contentView, Loading
core/java/android/view/NotificationHeaderView.java +7 −4 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; import android.util.AttributeSet; import android.widget.FrameLayout; import android.widget.RelativeLayout; import android.widget.RemoteViews; import com.android.internal.R; Loading @@ -42,7 +42,7 @@ import java.util.ArrayList; * @hide */ @RemoteViews.RemoteView public class NotificationHeaderView extends FrameLayout { public class NotificationHeaderView extends RelativeLayout { private final int mHeadingEndMargin; private final int mTouchableHeight; private OnClickListener mExpandClickListener; Loading Loading @@ -159,7 +159,7 @@ public class NotificationHeaderView extends FrameLayout { * @param extraMarginEnd extra margin in px */ public void setTopLineExtraMarginEnd(int extraMarginEnd) { mTopLineView.setHeaderTextMarginEnd(extraMarginEnd + mHeadingEndMargin); mTopLineView.setHeaderTextMarginEnd(extraMarginEnd); } /** Loading @@ -181,12 +181,15 @@ public class NotificationHeaderView extends FrameLayout { * @return extra margin */ public int getTopLineExtraMarginEnd() { return mTopLineView.getHeaderTextMarginEnd() - mHeadingEndMargin; return mTopLineView.getHeaderTextMarginEnd(); } /** * Get the base margin at the end of the top line view. * Add this to {@link #getTopLineExtraMarginEnd()} to get the total margin of the top line. * <p> * NOTE: This method's result is only valid if the expander does not have a number. Currently * only groups headers and conversations have numbers, so this is safe to use by MediaStyle. * * @return base margin */ Loading
core/java/com/android/internal/widget/NotificationExpandButton.java +4 −2 Original line number Diff line number Diff line Loading @@ -220,7 +220,9 @@ public class NotificationExpandButton extends FrameLayout { */ @RemotableViewMethod public void setNumber(int number) { if (mNumber != number) { mNumber = number; updateNumber(); } } }
core/res/res/layout/notification_template_header.xml +11 −6 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ android:id="@+id/left_icon" android:layout_width="@dimen/notification_left_icon_size" android:layout_height="@dimen/notification_left_icon_size" android:layout_gravity="center_vertical|start" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_marginStart="@dimen/notification_left_icon_start" android:background="@drawable/notification_large_icon_outline" android:clipToOutline="true" Loading @@ -43,7 +44,8 @@ android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" android:layout_gravity="center_vertical|start" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_marginStart="@dimen/notification_icon_circle_start" android:background="@drawable/notification_icon_circle" android:padding="@dimen/notification_icon_circle_padding" Loading @@ -55,10 +57,12 @@ android:id="@+id/notification_top_line" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_toStartOf="@id/expand_button" android:layout_alignWithParentIfMissing="true" android:clipChildren="false" android:gravity="center_vertical" android:paddingEnd="@dimen/notification_heading_margin_end" android:paddingStart="@dimen/notification_content_margin_start" android:theme="@style/Theme.DeviceDefault.Notification" > Loading @@ -71,14 +75,15 @@ android:id="@+id/alternate_expand_target" android:layout_width="@dimen/notification_content_margin_start" android:layout_height="match_parent" android:layout_gravity="start" android:layout_alignParentStart="true" android:importantForAccessibility="no" /> <include layout="@layout/notification_expand_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:layout_alignParentEnd="true" android:layout_centerVertical="true" /> </NotificationHeaderView>
core/res/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ <dimen name="notification_content_margin_end">16dp</dimen> <!-- The margin on the end of the top-line content views (accommodates the expander) --> <dimen name="notification_heading_margin_end">48dp</dimen> <dimen name="notification_heading_margin_end">56dp</dimen> <!-- The margin for text at the end of the image view for media notifications --> <dimen name="notification_media_image_margin_end">72dp</dimen> Loading