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

Commit db0e4f1d authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge changes from topic "heads_up_redesign" into pi-dev

* changes:
  Added new appear and disappear animations for heads up
  Polished the heads up experience
  Removed the heads up scrim and replaced it with more elevation
  Insetting heads up notifications
  Ensured that the heads-up notifications are always rounded
parents d0661a08 332c23fe
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -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();
        }
    }

    /**
@@ -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;
        }
    }

    /**
@@ -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
         */
+1 −0
Original line number Diff line number Diff line
@@ -3232,6 +3232,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" />
+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.
@@ -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>
+4 −2
Original line number Diff line number Diff line
@@ -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
+40 −32
Original line number Diff line number Diff line
@@ -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"
@@ -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"
        >
@@ -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"
@@ -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