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

Commit dd5b8868 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Navbar scrim when in QS

Bug: 16644711
Change-Id: I91d823671919068500a29878f3dfe9b481000a58
parent 1c8eb5e3
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<!--
  ~ Copyright (C) 2014 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
  -->

<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
+8 −0
Original line number Diff line number Diff line
@@ -115,4 +115,12 @@
        layout="@layout/keyguard_bottom_area"
        android:visibility="gone" />

    <com.android.systemui.statusbar.AlphaOptimizedView
        android:id="@+id/qs_navbar_scrim"
        android:layout_height="96dp"
        android:layout_width="match_parent"
        android:layout_gravity="bottom"
        android:visibility="invisible"
        android:background="@drawable/qs_navbar_scrim" />

</com.android.systemui.statusbar.phone.NotificationPanelView><!-- end of sliding panel -->
+20 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ public class NotificationPanelView extends PanelView implements
    private TextView mClockView;
    private View mReserveNotificationSpace;
    private MirrorView mSystemIconsCopy;
    private View mQsNavbarScrim;

    private NotificationStackScrollLayout mNotificationStackScroller;
    private int mNotificationTopPadding;
@@ -149,6 +150,8 @@ public class NotificationPanelView extends PanelView implements

    private boolean mShadeEmpty;

    private boolean mQsScrimEnabled = true;

    public NotificationPanelView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mSystemIconsCopy = new MirrorView(context);
@@ -183,6 +186,7 @@ public class NotificationPanelView extends PanelView implements
        mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(getContext(),
                android.R.interpolator.linear_out_slow_in);
        mKeyguardBottomArea = (KeyguardBottomAreaView) findViewById(R.id.keyguard_bottom_area);
        mQsNavbarScrim = findViewById(R.id.qs_navbar_scrim);
        mAfforanceHelper = new KeyguardAffordanceHelper(this, getContext());
    }

@@ -882,6 +886,10 @@ public class NotificationPanelView extends PanelView implements
                mKeyguardShowing && !expandVisually ? View.INVISIBLE : View.VISIBLE);
        mScrollView.setTouchEnabled(mQsExpanded);
        updateEmptyShadeView();
        mQsNavbarScrim.setVisibility(mStatusBarState == StatusBarState.SHADE && mQsExpanded
                && !mStackScrollerOverscrolling && mQsScrimEnabled
                        ? View.VISIBLE
                        : View.INVISIBLE);
    }

    private void setQsExpansion(float height) {
@@ -908,6 +916,10 @@ public class NotificationPanelView extends PanelView implements
                mKeyguardStatusBar.setAlpha(alpha);
            }
        }
        if (mStatusBarState == StatusBarState.SHADE && mQsExpanded
                && !mStackScrollerOverscrolling && mQsScrimEnabled) {
            mQsNavbarScrim.setAlpha(getQsExpansionFraction());
        }
    }

    private void updateNotificationScrim(float height) {
@@ -1629,4 +1641,12 @@ public class NotificationPanelView extends PanelView implements
        // Hide "No notifications" in QS.
        mNotificationStackScroller.updateEmptyShadeView(mShadeEmpty && !mQsExpanded);
    }

    public void setQsScrimEnabled(boolean qsScrimEnabled) {
        boolean changed = mQsScrimEnabled != qsScrimEnabled;
        mQsScrimEnabled = qsScrimEnabled;
        if (changed) {
            updateQsState();
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -650,6 +650,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                        if (mSearchPanelView != null) {
                            mSearchPanelView.setHorizontal(isVertical);
                        }
                        mNotificationPanel.setQsScrimEnabled(!isVertical);
                    }
                });
                mNavigationBarView.setOnTouchListener(new View.OnTouchListener() {