Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c24b4175 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[Notif redesign] Circular icons for Call Notifications

Note that:
- notification_2025_template_collapsed_call is forked from notification_template_material_call.
- notification_2025_template_expanded_call is forked from notification_template_material_big_call.

Bug: 378660052
Test: visual test, screenshot tests to come later
Flag: android.app.notifications_redesign_templates
Change-Id: I13f7ef44077bd0bc24eabbb983c9920c70cb6861
parent 26b692ae
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -818,6 +818,8 @@ public class Notification implements Parcelable
                     R.layout.notification_2025_template_heads_up_base,
                     R.layout.notification_2025_template_header,
                     R.layout.notification_2025_template_conversation,
                     R.layout.notification_2025_template_collapsed_call,
                     R.layout.notification_2025_template_expanded_call,
                     R.layout.notification_2025_template_collapsed_messaging,
                     R.layout.notification_2025_template_collapsed_media,
                     R.layout.notification_template_material_big_picture,
@@ -825,8 +827,6 @@ public class Notification implements Parcelable
                     R.layout.notification_template_material_inbox,
                     R.layout.notification_template_material_big_messaging,
                     R.layout.notification_template_material_big_media,
                     R.layout.notification_template_material_call,
                     R.layout.notification_template_material_big_call,
                     R.layout.notification_template_header -> true;
                case R.layout.notification_template_material_progress -> Flags.apiRichOngoing();
                default -> false;
@@ -7600,6 +7600,22 @@ public class Notification implements Parcelable
            }
        }
        private int getCollapsedCallLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_collapsed_call;
            } else {
                return R.layout.notification_template_material_call;
            }
        }
        private int getExpandedCallLayoutResource() {
            if (Flags.notificationsRedesignTemplates()) {
                return R.layout.notification_2025_template_expanded_call;
            } else {
                return R.layout.notification_template_material_big_call;
            }
        }
        private int getProgressLayoutResource() {
            return R.layout.notification_template_material_progress;
        }
@@ -10948,10 +10964,10 @@ public class Notification implements Parcelable
            final RemoteViews contentView;
            if (isCollapsed) {
                contentView = mBuilder.applyStandardTemplate(
                        R.layout.notification_template_material_call, p, null /* result */);
                        mBuilder.getCollapsedCallLayoutResource(), p, null /* result */);
            } else {
                contentView = mBuilder.applyStandardTemplateWithActions(
                        R.layout.notification_template_material_big_call, p, null /* result */);
                    mBuilder.getExpandedCallLayoutResource(), p, null /* result */);
            }
            // Bind some extra conversation-specific header fields.
+80 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2024 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
  -->

<!-- Extends FrameLayout -->
<com.android.internal.widget.CallLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/status_bar_latest_event_content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clipChildren="false"
    android:tag="call"
    android:theme="@style/Theme.DeviceDefault.Notification"
    >

    <!-- CallLayout shares visual appearance with ConversationLayout, so shares layouts -->
    <include layout="@layout/notification_2025_conversation_icon_container" />

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="88dp"
        android:orientation="horizontal"
        >

        <LinearLayout
            android:id="@+id/notification_main_column"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginStart="@dimen/conversation_content_start"
            android:orientation="vertical"
            android:minHeight="68dp"
            android:paddingBottom="@dimen/notification_headerless_margin_twoline"
            >

            <include
                layout="@layout/notification_template_conversation_header"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <include layout="@layout/notification_template_text"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/notification_text_height"
                />

        </LinearLayout>

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:minWidth="@dimen/notification_content_margin_end"
            >

            <include
                layout="@layout/notification_expand_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                />

        </FrameLayout>

    </LinearLayout>

</com.android.internal.widget.CallLayout>
+109 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2024 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
  -->

<!-- Extends FrameLayout -->
<com.android.internal.widget.CallLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/status_bar_latest_event_content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clipChildren="false"
    android:tag="call"
    android:theme="@style/Theme.DeviceDefault.Notification"
    >

    <!-- CallLayout shares visual appearance with ConversationLayout, so shares layouts -->
    <include layout="@layout/notification_2025_conversation_icon_container" />

    <LinearLayout
        android:id="@+id/notification_action_list_margin_target"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/notification_content_margin"
        android:orientation="vertical"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="horizontal"
            >

            <LinearLayout
                android:id="@+id/notification_main_column"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_marginStart="@dimen/conversation_content_start"
                android:orientation="vertical"
                android:minHeight="68dp"
                >

                <include
                    layout="@layout/notification_template_conversation_header"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    />

                <include layout="@layout/notification_template_text_multiline" />

                <include
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/notification_progress_bar_height"
                    android:layout_marginTop="@dimen/notification_progress_margin_top"
                    layout="@layout/notification_template_progress"
                    />
            </LinearLayout>

            <FrameLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:minWidth="@dimen/notification_content_margin_end"
                >

                <include
                    layout="@layout/notification_expand_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    />

            </FrameLayout>

        </LinearLayout>

        <ViewStub
            android:layout="@layout/notification_material_reply_text"
            android:id="@+id/notification_material_reply_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />

        <include
            layout="@layout/notification_template_smart_reply_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/notification_content_margin_start"
            android:layout_marginEnd="@dimen/notification_content_margin_end"
            android:layout_marginTop="@dimen/notification_content_margin"
            />

        <include layout="@layout/notification_material_action_list" />

    </LinearLayout>

</com.android.internal.widget.CallLayout>
+2 −0
Original line number Diff line number Diff line
@@ -3448,6 +3448,8 @@
  <!-- Notifications: CallStyle -->
  <java-symbol type="layout" name="notification_template_material_call" />
  <java-symbol type="layout" name="notification_template_material_big_call" />
  <java-symbol type="layout" name="notification_2025_template_collapsed_call" />
  <java-symbol type="layout" name="notification_2025_template_expanded_call" />
  <java-symbol type="string" name="call_notification_answer_action" />
  <java-symbol type="string" name="call_notification_answer_video_action" />
  <java-symbol type="string" name="call_notification_decline_action" />