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

Commit 51c7510e authored by Chris Wren's avatar Chris Wren
Browse files

allow rich notifications in the heads up.

new shouldInterrupt logic: screen on, not locked, not dreaming, and
  priority above HIGH and noisy, or has fullscreen intent
draft of API allowing devs to give hints about head up display

reuse inflateViews()
add an expand helper to the heads up space
move some things into Entry for reuse

don't allow touches in first second
delay decay if touched
make decay time a resource

add a custom viewgroup for notification rows to get view management
out of the NotificationData class.

Change-Id: I36464f110cfa0dabc3f35db7db6c35c27e8ee2ba
parent bc668ac4
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -456,6 +456,30 @@ public class Notification implements Parcelable
    // extras keys for other interesting pieces of information
    public static final String EXTRA_PEOPLE = "android.people";

    /**
     * Notification extra to specify heads up display preference.
     * @hide
     */
    public static final String EXTRA_AS_HEADS_UP = "headsup";

    /**
     * Value for {@link #EXTRA_AS_HEADS_UP} indicating that heads up display is not appropriate.
     * @hide
     */
    public static final int HEADS_UP_NEVER = 0;

    /**
     * Default value for {@link #EXTRA_AS_HEADS_UP} indicating that heads up display is appropriate.
     * @hide
     */
    public static final int HEADS_UP_ALLOWED = 1;

    /**
     * Value for {@link #EXTRA_AS_HEADS_UP} that advocates for heads up display.
     * @hide
     */
    public static final int HEADS_UP_REQUESTED = 2;

    /**
     * Structure to encapsulate an "action", including title and icon, that can be attached to a Notification.
     */
+2 −4
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
        >
    <scale
    <translate
        android:interpolator="@android:interpolator/overshoot"
        android:fromXScale="0.7" android:toXScale="1.0"
        android:fromYScale="0.7" android:toYScale="1.0"
        android:pivotX="50%" android:pivotY="50%"
        android:fromYDelta="-50%" android:toYDelta="0"
        android:duration="@android:integer/config_shortAnimTime" />
    <alpha 
        android:interpolator="@android:interpolator/decelerate_quad"
+228 B (500 B)
Loading image diff...
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:paddingTop="@*android:dimen/status_bar_height"
    >
    <FrameLayout
        android:layout_height="wrap_content"
+3 −2
Original line number Diff line number Diff line
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.android.systemui.statusbar.ExpandableNotificationRow
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
@@ -62,4 +63,4 @@
        android:padding="2dp"
        />

</FrameLayout>
</com.android.systemui.statusbar.ExpandableNotificationRow>
Loading