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

Commit 75fa9648 authored by Adrian Roos's avatar Adrian Roos
Browse files

Ambient Indication: Add supporting infrastructure

Adds a stub for inflating the ambient indication. Also
adds some logic to the panel view to avoid the
indication by showing fewer notification while it's
there.

Bug: 36777988
Test: m SystemUI
Change-Id: Ifee218860a7561d77edf0f71a17e02c975132597
parent da2259a4
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2017 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.
  -->

<!-- empty stub -->
<merge />
+2 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@
            android:layout_gravity="@integer/notification_panel_layout_gravity"
            android:layout_marginBottom="@dimen/close_handle_underlap" />

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

        <ViewStub
            android:id="@+id/keyguard_user_switcher"
            android:layout="@layout/keyguard_user_switcher"
+9 −1
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ public class NotificationPanelView extends PanelView implements
    private NotificationGroupManager mGroupManager;
    private boolean mShowIconsWhenExpanded;
    private int mIndicationBottomPadding;
    private int mAmbientIndicationBottomPadding;
    private boolean mIsFullWidth;
    private boolean mDark;
    private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger();
@@ -425,7 +426,7 @@ public class NotificationPanelView extends PanelView implements
        float shelfSize = mNotificationStackScroller.getNotificationShelf().getIntrinsicHeight()
                + notificationPadding;
        float availableSpace = mNotificationStackScroller.getHeight() - minPadding - shelfSize
                - mIndicationBottomPadding;
                - Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding);
        int count = 0;
        for (int i = 0; i < mNotificationStackScroller.getChildCount(); i++) {
            ExpandableView child = (ExpandableView) mNotificationStackScroller.getChildAt(i);
@@ -2476,4 +2477,11 @@ public class NotificationPanelView extends PanelView implements
    public void setPulsing(boolean pulsing) {
        mKeyguardStatusView.setPulsing(pulsing);
    }

    public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) {
        if (mAmbientIndicationBottomPadding != ambientIndicationBottomPadding) {
            mAmbientIndicationBottomPadding = ambientIndicationBottomPadding;
            mStatusBar.updateKeyguardMaxNotifications();
        }
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -6112,6 +6112,10 @@ public class StatusBar extends SystemUI implements DemoMode,
     * Called when the notification panel layouts
     */
    public void onPanelLaidOut() {
        updateKeyguardMaxNotifications();
    }

    public void updateKeyguardMaxNotifications() {
        if (mState == StatusBarState.KEYGUARD) {
            // Since the number of notifications is determined based on the height of the view, we
            // need to update them.
@@ -6867,6 +6871,10 @@ public class StatusBar extends SystemUI implements DemoMode,
        }
    }

    public NotificationPanelView getPanel() {
        return mNotificationPanel;
    }

    @Override
    public void startAssist(Bundle args) {
        if (mAssistManager != null) {