diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 2b45723dae557..c66f3f746b659 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -6583,10 +6583,6 @@ public class Notification implements Parcelable return R.layout.notification_template_material_conversation; } - private int getCallLayoutResource() { - return R.layout.notification_template_material_call; - } - private int getActionLayoutResource() { return R.layout.notification_material_action; } @@ -9329,7 +9325,7 @@ public class Notification implements Parcelable */ @Override public RemoteViews makeContentView(boolean increasedHeight) { - return makeCallLayout(); + return makeCallLayout(StandardTemplateParams.VIEW_TYPE_NORMAL); } /** @@ -9337,14 +9333,14 @@ public class Notification implements Parcelable */ @Override public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { - return makeCallLayout(); + return makeCallLayout(StandardTemplateParams.VIEW_TYPE_HEADS_UP); } /** * @hide */ public RemoteViews makeBigContentView() { - return makeCallLayout(); + return makeCallLayout(StandardTemplateParams.VIEW_TYPE_BIG); } @NonNull @@ -9443,7 +9439,7 @@ public class Notification implements Parcelable return resultActions; } - private RemoteViews makeCallLayout() { + private RemoteViews makeCallLayout(int viewType) { Bundle extras = mBuilder.mN.extras; CharSequence text = mBuilder.processLegacyText(extras.getCharSequence(EXTRA_TEXT)); if (text == null) { @@ -9452,15 +9448,21 @@ public class Notification implements Parcelable // Bind standard template StandardTemplateParams p = mBuilder.mParams.reset() - .viewType(StandardTemplateParams.VIEW_TYPE_BIG) + .viewType(viewType) .callStyleActions(true) .allowTextWithProgress(true) .hideLargeIcon(true) .text(text) .summaryText(mBuilder.processLegacyText(mVerificationText)); mBuilder.mActions = getActionsListWithSystemActions(); - RemoteViews contentView = mBuilder.applyStandardTemplateWithActions( - mBuilder.getCallLayoutResource(), p, null /* result */); + final RemoteViews contentView; + if (p.mViewType != StandardTemplateParams.VIEW_TYPE_NORMAL) { + contentView = mBuilder.applyStandardTemplateWithActions( + R.layout.notification_template_material_big_call, p, null /* result */); + } else { + contentView = mBuilder.applyStandardTemplate( + R.layout.notification_template_material_call, p, null /* result */); + } // Bind some extra conversation-specific header fields. mBuilder.setTextViewColorPrimary(contentView, R.id.conversation_text, p); diff --git a/core/res/res/layout/notification_template_material_big_base.xml b/core/res/res/layout/notification_template_material_big_base.xml index 2d1c3422ca368..b9a3625f9e452 100644 --- a/core/res/res/layout/notification_template_material_big_base.xml +++ b/core/res/res/layout/notification_template_material_big_base.xml @@ -27,7 +27,7 @@ android:id="@+id/notification_action_list_margin_target" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/notification_action_list_height" + android:layout_marginBottom="@dimen/notification_content_margin" android:orientation="vertical" > diff --git a/core/res/res/layout/notification_template_material_big_call.xml b/core/res/res/layout/notification_template_material_big_call.xml new file mode 100644 index 0000000000000..1d5046777e77e --- /dev/null +++ b/core/res/res/layout/notification_template_material_big_call.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/res/res/layout/notification_template_material_big_text.xml b/core/res/res/layout/notification_template_material_big_text.xml index 2954ba2a09033..86e7dec29e7df 100644 --- a/core/res/res/layout/notification_template_material_big_text.xml +++ b/core/res/res/layout/notification_template_material_big_text.xml @@ -31,7 +31,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:layout_marginTop="@dimen/notification_content_margin_top" - android:layout_marginBottom="@dimen/notification_action_list_height" + android:layout_marginBottom="@dimen/notification_content_margin" android:clipToPadding="false" android:orientation="vertical" > diff --git a/core/res/res/layout/notification_template_material_call.xml b/core/res/res/layout/notification_template_material_call.xml index c2ffd1f0d8b35..5d9e761842d84 100644 --- a/core/res/res/layout/notification_template_material_call.xml +++ b/core/res/res/layout/notification_template_material_call.xml @@ -1,5 +1,4 @@ - - +