Merge "Removed the darkShelf logic" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f3bf364998
@@ -409,7 +409,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
private final ViewOutlineProvider mOutlineProvider = new ViewOutlineProvider() {
|
private final ViewOutlineProvider mOutlineProvider = new ViewOutlineProvider() {
|
||||||
@Override
|
@Override
|
||||||
public void getOutline(View view, Outline outline) {
|
public void getOutline(View view, Outline outline) {
|
||||||
if (mAmbientState.isDarkAtAll() || !mShowDarkShelf) {
|
if (mAmbientState.isDarkAtAll()) {
|
||||||
float xProgress = mDarkXInterpolator.getInterpolation(
|
float xProgress = mDarkXInterpolator.getInterpolation(
|
||||||
(1 - mLinearDarkAmount) * mBackgroundXFactor);
|
(1 - mLinearDarkAmount) * mBackgroundXFactor);
|
||||||
outline.setRoundRect(mBackgroundAnimationRect,
|
outline.setRoundRect(mBackgroundAnimationRect,
|
||||||
@@ -507,7 +507,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
/**
|
/**
|
||||||
* If the {@link NotificationShelf} should be visible when dark.
|
* If the {@link NotificationShelf} should be visible when dark.
|
||||||
*/
|
*/
|
||||||
private boolean mShowDarkShelf;
|
|
||||||
private boolean mAnimateBottomOnLayout;
|
private boolean mAnimateBottomOnLayout;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -1368,8 +1367,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
mIsClipped = clipped;
|
mIsClipped = clipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mAmbientPulseManager.hasNotifications()
|
if (!mAmbientPulseManager.hasNotifications() && mAmbientState.isFullyDark()) {
|
||||||
&& mAmbientState.isFullyDark() && mShowDarkShelf) {
|
|
||||||
setClipBounds(null);
|
setClipBounds(null);
|
||||||
} else if (mAmbientState.isDarkAtAll()) {
|
} else if (mAmbientState.isDarkAtAll()) {
|
||||||
clipToOutline = true;
|
clipToOutline = true;
|
||||||
@@ -4723,9 +4721,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
if (mAmbientState.isDark() == dark) {
|
if (mAmbientState.isDark() == dark) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!dark) {
|
|
||||||
mShowDarkShelf = false;
|
|
||||||
}
|
|
||||||
mAmbientState.setDark(dark);
|
mAmbientState.setDark(dark);
|
||||||
if (animate && mAnimationsEnabled) {
|
if (animate && mAnimationsEnabled) {
|
||||||
mDarkNeedsAnimation = true;
|
mDarkNeedsAnimation = true;
|
||||||
@@ -4787,7 +4782,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
boolean nowDarkAtAll = mAmbientState.isDarkAtAll();
|
boolean nowDarkAtAll = mAmbientState.isDarkAtAll();
|
||||||
if (nowFullyDark != wasFullyDark) {
|
if (nowFullyDark != wasFullyDark) {
|
||||||
updateContentHeight();
|
updateContentHeight();
|
||||||
if (nowFullyDark && mShowDarkShelf) {
|
if (nowFullyDark) {
|
||||||
updateDarkShelfVisibility();
|
updateDarkShelfVisibility();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4803,14 +4798,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
|||||||
requestChildrenUpdate();
|
requestChildrenUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* If the shelf should be visible when the device is in ambient mode (dozing.)
|
|
||||||
*/
|
|
||||||
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
|
|
||||||
public void showDarkShelf() {
|
|
||||||
mShowDarkShelf = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateDarkShelfVisibility() {
|
private void updateDarkShelfVisibility() {
|
||||||
DozeParameters dozeParameters = DozeParameters.getInstance(mContext);
|
DozeParameters dozeParameters = DozeParameters.getInstance(mContext);
|
||||||
if (dozeParameters.shouldControlScreenOff()) {
|
if (dozeParameters.shouldControlScreenOff()) {
|
||||||
|
|||||||
@@ -2853,9 +2853,6 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
if (dozing == mDozing) return;
|
if (dozing == mDozing) return;
|
||||||
mDozing = dozing;
|
mDozing = dozing;
|
||||||
mNotificationStackScroller.setDark(mDozing, animate, wakeUpTouchLocation);
|
mNotificationStackScroller.setDark(mDozing, animate, wakeUpTouchLocation);
|
||||||
if (mDozing) {
|
|
||||||
mNotificationStackScroller.showDarkShelf();
|
|
||||||
}
|
|
||||||
mKeyguardBottomArea.setDozing(mDozing, animate);
|
mKeyguardBottomArea.setDozing(mDozing, animate);
|
||||||
|
|
||||||
if (mBarState == StatusBarState.KEYGUARD
|
if (mBarState == StatusBarState.KEYGUARD
|
||||||
|
|||||||
@@ -119,24 +119,9 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
|||||||
mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */);
|
mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */);
|
||||||
InOrder inOrder = inOrder(mNotificationStackScrollLayout, mStatusBarStateController);
|
InOrder inOrder = inOrder(mNotificationStackScrollLayout, mStatusBarStateController);
|
||||||
inOrder.verify(mNotificationStackScrollLayout).setDark(eq(true), eq(true), eq(null));
|
inOrder.verify(mNotificationStackScrollLayout).setDark(eq(true), eq(true), eq(null));
|
||||||
inOrder.verify(mNotificationStackScrollLayout).showDarkShelf();
|
|
||||||
inOrder.verify(mStatusBarStateController).setDozeAmount(eq(1f), eq(true));
|
inOrder.verify(mStatusBarStateController).setDozeAmount(eq(1f), eq(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSetDozing_showsDarkShelfWithDefaultClock() {
|
|
||||||
when(mKeyguardStatusView.hasCustomClock()).thenReturn(false);
|
|
||||||
mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */);
|
|
||||||
verify(mNotificationStackScrollLayout).showDarkShelf();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSetDozing_showsDarkShelfWhenCustomClock() {
|
|
||||||
when(mKeyguardStatusView.hasCustomClock()).thenReturn(true);
|
|
||||||
mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */);
|
|
||||||
verify(mNotificationStackScrollLayout).showDarkShelf();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSetExpandedHeight() {
|
public void testSetExpandedHeight() {
|
||||||
mNotificationPanelView.setExpandedHeight(200);
|
mNotificationPanelView.setExpandedHeight(200);
|
||||||
|
|||||||
Reference in New Issue
Block a user