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

Commit 281c2027 authored by Selim Cinek's avatar Selim Cinek
Browse files

Introduced the Notification shelf

Started the implementation of a new notification
scrolling model that dynamically transforms notifications
into a new icon shelf.

Test: Add notifications, scroll!
Bug: 32437839
Change-Id: Ic28cc1c82f2cda2ffa7a312648903b5bc2408820
parent bbcebde5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -311,6 +311,10 @@ public class NotificationHeaderView extends ViewGroup {
        return mProfileBadge;
    }

    public View getIcon() {
        return mIcon;
    }

    public class HeaderTouchListener implements View.OnTouchListener {

        private final ArrayList<Rect> mTouchRects = new ArrayList<>();
+1 −7
Original line number Diff line number Diff line
@@ -19,13 +19,7 @@
    android:id="@+id/notification_icon_area_inner"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    <com.android.systemui.statusbar.StatusBarIconView
        android:id="@+id/moreIcon"
        android:layout_width="@dimen/status_bar_icon_size"
        android:layout_height="match_parent"
        android:src="@drawable/stat_notify_more"
        android:visibility="gone" />
    <com.android.systemui.statusbar.phone.IconMerger
    <com.android.systemui.statusbar.phone.NotificationIconContainer
        android:id="@+id/notificationIcons"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
+47 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2014 The Android Open Source Project
  ~ Copyright (C) 2016 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,10 +15,10 @@
  -->

<!-- Extends FrameLayout -->
<com.android.systemui.statusbar.NotificationOverflowContainer
<com.android.systemui.statusbar.NotificationShelf
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/notification_summary_height"
    android:layout_height="@dimen/notification_shelf_height"
    android:focusable="true"
    android:clickable="true"
    >
@@ -31,44 +31,17 @@
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />

    <com.android.keyguard.AlphaOptimizedLinearLayout
    <com.android.systemui.statusbar.phone.NotificationIconContainer
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <TextView
            android:id="@+id/more_text"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="12dp"
            android:layout_gravity="center_vertical"
            android:background="@drawable/keyguard_overflow_number_background"
            android:gravity="center"
            android:textColor="#ff686868"
            android:textStyle="bold"
            android:textSize="14dp"
            />
        <com.android.systemui.statusbar.StatusBarIconView
            android:id="@+id/more_icon_overflow"
            android:layout_width="@dimen/status_bar_icon_size"
        android:layout_height="match_parent"
            android:src="@drawable/stat_notify_more"
            android:tint="@color/keyguard_overflow_content_color"
            android:visibility="gone"
            />
        <com.android.systemui.statusbar.NotificationOverflowIconsView
            android:id="@+id/overflow_icons_view"
            android:layout_gravity="center_vertical"
            android:layout_marginEnd="8dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />
    </com.android.keyguard.AlphaOptimizedLinearLayout>
        android:layout_marginStart="13dp"
        android:layout_marginEnd="13dp"
        android:gravity="center_vertical" />

    <com.android.systemui.statusbar.notification.FakeShadowView
        android:id="@+id/fake_shadow"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.android.systemui.statusbar.NotificationOverflowContainer>
</com.android.systemui.statusbar.NotificationShelf>
+7 −3
Original line number Diff line number Diff line
@@ -81,8 +81,12 @@
    <!-- Height of a heads up notification in the status bar -->
    <dimen name="notification_max_heads_up_height">148dp</dimen>

    <!-- Height of a the summary ("more card") notification on keyguard. -->
    <dimen name="notification_summary_height">44dp</dimen>
    <!-- Height of a the shelf with the notification icons -->
    <dimen name="notification_shelf_height">32dp</dimen>

    <!-- The padding of a notification icon on top to the start of the notification. Used for custom
         views where the distance can't be measured -->
    <dimen name="notification_icon_appear_padding">15dp</dimen>

    <!-- Minimum layouted height of a notification in the statusbar-->
    <dimen name="min_notification_layout_height">48dp</dimen>
@@ -94,7 +98,7 @@
    <dimen name="notification_gear_padding">20dp</dimen>

    <!-- size at which Notification icons will be drawn in the status bar -->
    <dimen name="status_bar_icon_drawing_size">17dip</dimen>
    <dimen name="status_bar_icon_drawing_size">17dp</dimen>

    <!-- opacity at which Notification icons will be drawn in the status bar -->
    <item type="dimen" name="status_bar_icon_drawing_alpha">90%</item>
+9 −9
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.stack.StackStateAnimator;

/**
 * Base class for both {@link ExpandableNotificationRow} and {@link NotificationOverflowContainer}
 * Base class for both {@link ExpandableNotificationRow} and {@link NotificationShelf}
 * to implement dimming/activating on Keyguard for the double-tap gesture
 */
public abstract class ActivatableNotificationView extends ExpandableOutlineView {
@@ -131,7 +131,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    private final int mLegacyColor;
    private final int mNormalColor;
    private final int mLowPriorityColor;
    private boolean mIsBelowSpeedBump;
    private boolean mIsBelowShelf;
    private FalsingManager mFalsingManager;
    private boolean mTrackTouch;

@@ -443,10 +443,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    }

    @Override
    public void setBelowSpeedBump(boolean below) {
        super.setBelowSpeedBump(below);
        if (below != mIsBelowSpeedBump) {
            mIsBelowSpeedBump = below;
    public void setBelowShelf(boolean below) {
        super.setBelowShelf(below);
        if (below != mIsBelowShelf) {
            mIsBelowShelf = below;
            updateBackgroundTint();
        }
    }
@@ -849,7 +849,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
            return mBgTint;
        } else if (mShowingLegacyBackground) {
            return mLegacyColor;
        } else if (mIsBelowSpeedBump) {
        } else if (mIsBelowShelf) {
            return mLowPriorityColor;
        } else {
            return mNormalColor;
@@ -861,7 +861,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
            return mTintedRippleColor;
        } else if (mShowingLegacyBackground) {
            return mTintedRippleColor;
        } else if (mIsBelowSpeedBump) {
        } else if (mIsBelowShelf) {
            return mLowPriorityRippleColor;
        } else {
            return mNormalRippleColor;
@@ -907,7 +907,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        setTintColor(0);
        resetBackgroundAlpha();
        setShowingLegacyBackground(false);
        setBelowSpeedBump(false);
        setBelowShelf(false);
    }

    public boolean hasSameBgColor(ActivatableNotificationView otherView) {
Loading