Collapse the notification shade when closing the QS using the back button in split shade mode. am: 947e01c8db
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19293056 Change-Id: I41b01558a26d67a7c8538e189215bb6ae00855a5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1714,10 +1714,17 @@ public final class NotificationPanelViewController extends PanelViewController {
|
|||||||
/**
|
/**
|
||||||
* Animate QS closing by flinging it.
|
* Animate QS closing by flinging it.
|
||||||
* If QS is expanded, it will collapse into QQS and stop.
|
* If QS is expanded, it will collapse into QQS and stop.
|
||||||
|
* If in split shade, it will collapse the whole shade.
|
||||||
*
|
*
|
||||||
* @param animateAway Do not stop when QS becomes QQS. Fling until QS isn't visible anymore.
|
* @param animateAway Do not stop when QS becomes QQS. Fling until QS isn't visible anymore.
|
||||||
*/
|
*/
|
||||||
public void animateCloseQs(boolean animateAway) {
|
public void animateCloseQs(boolean animateAway) {
|
||||||
|
if (mSplitShadeEnabled) {
|
||||||
|
collapsePanel(
|
||||||
|
/* animate= */true, /* delayed= */false, /* speedUpFactor= */1.0f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (mQsExpansionAnimator != null) {
|
if (mQsExpansionAnimator != null) {
|
||||||
if (!mQsAnimatorExpand) {
|
if (!mQsAnimatorExpand) {
|
||||||
return;
|
return;
|
||||||
@@ -3390,19 +3397,11 @@ public final class NotificationPanelViewController extends PanelViewController {
|
|||||||
return mQsExpanded;
|
return mQsExpanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isQsDetailShowing() {
|
|
||||||
return mQs.isShowingDetail();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns whether the QS customizer is currently active. */
|
/** Returns whether the QS customizer is currently active. */
|
||||||
public boolean isQsCustomizing() {
|
public boolean isQsCustomizing() {
|
||||||
return mQs.isCustomizing();
|
return mQs.isCustomizing();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeQsDetail() {
|
|
||||||
mQs.closeDetail();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Close the QS customizer if it is open. */
|
/** Close the QS customizer if it is open. */
|
||||||
public void closeQsCustomizer() {
|
public void closeQsCustomizer() {
|
||||||
mQs.closeCustomizer();
|
mQs.closeCustomizer();
|
||||||
|
|||||||
@@ -3325,11 +3325,7 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (mNotificationPanelViewController.isQsExpanded()) {
|
if (mNotificationPanelViewController.isQsExpanded()) {
|
||||||
if (mNotificationPanelViewController.isQsDetailShowing()) {
|
|
||||||
mNotificationPanelViewController.closeQsDetail();
|
|
||||||
} else {
|
|
||||||
mNotificationPanelViewController.animateCloseQs(false /* animateAway */);
|
mNotificationPanelViewController.animateCloseQs(false /* animateAway */);
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (mNotificationPanelViewController.closeUserSwitcherIfOpen()) {
|
if (mNotificationPanelViewController.closeUserSwitcherIfOpen()) {
|
||||||
|
|||||||
@@ -1283,6 +1283,29 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
assertThat(mNotificationPanelViewController.isQsExpanded()).isFalse();
|
assertThat(mNotificationPanelViewController.isQsExpanded()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPanelClosedWhenClosingQsInSplitShade() {
|
||||||
|
mPanelExpansionStateManager.onPanelExpansionChanged(/* fraction= */ 1,
|
||||||
|
/* expanded= */ true, /* tracking= */ false, /* dragDownPxAmount= */ 0);
|
||||||
|
enableSplitShade(/* enabled= */ true);
|
||||||
|
mNotificationPanelViewController.setExpandedFraction(1f);
|
||||||
|
|
||||||
|
assertThat(mNotificationPanelViewController.isClosing()).isFalse();
|
||||||
|
mNotificationPanelViewController.animateCloseQs(false);
|
||||||
|
assertThat(mNotificationPanelViewController.isClosing()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPanelStaysOpenWhenClosingQs() {
|
||||||
|
mPanelExpansionStateManager.onPanelExpansionChanged(/* fraction= */ 1,
|
||||||
|
/* expanded= */ true, /* tracking= */ false, /* dragDownPxAmount= */ 0);
|
||||||
|
mNotificationPanelViewController.setExpandedFraction(1f);
|
||||||
|
|
||||||
|
assertThat(mNotificationPanelViewController.isClosing()).isFalse();
|
||||||
|
mNotificationPanelViewController.animateCloseQs(false);
|
||||||
|
assertThat(mNotificationPanelViewController.isClosing()).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void interceptTouchEvent_withinQs_shadeExpanded_startsQsTracking() {
|
public void interceptTouchEvent_withinQs_shadeExpanded_startsQsTracking() {
|
||||||
mNotificationPanelViewController.mQs = mQs;
|
mNotificationPanelViewController.mQs = mQs;
|
||||||
|
|||||||
Reference in New Issue
Block a user