am 55328ffd: Navbar scrim when in QS

* commit '55328ffd74ad65e9ae0053f09751911f09ae5b85':
  Navbar scrim when in QS
This commit is contained in:
Jorim Jaggi
2014-08-05 19:26:57 +00:00
committed by Android Git Automerger
4 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?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>

View File

@@ -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 -->

View File

@@ -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();
}
}
}

View File

@@ -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() {