Merge "Fix visibility issue in QS detail panels" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8527610e55
@@ -72,7 +72,8 @@ public interface DetailAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return if detail panel should animate when shown or closed
|
* Indicates whether the detail view wants to animate when shown. This has no affect over the
|
||||||
|
* closing animation. Detail panels will always animate when closed.
|
||||||
*/
|
*/
|
||||||
default boolean shouldAnimate() {
|
default boolean shouldAnimate() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -212,6 +212,11 @@ public class QSDetail extends LinearLayout {
|
|||||||
Dependency.get(CommandQueue.class).animateCollapsePanels();
|
Dependency.get(CommandQueue.class).animateCollapsePanels();
|
||||||
mTriggeredExpand = false;
|
mTriggeredExpand = false;
|
||||||
}
|
}
|
||||||
|
// Always animate on close, even if the last opened detail adapter had shouldAnimate()
|
||||||
|
// return false. This is necessary to avoid a race condition which could leave the
|
||||||
|
// keyguard in a bad state where QS remains visible underneath the notifications, clock,
|
||||||
|
// and status area.
|
||||||
|
mShouldAnimate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean visibleDiff = wasShowingDetail != showingDetail;
|
boolean visibleDiff = wasShowingDetail != showingDetail;
|
||||||
@@ -245,10 +250,15 @@ public class QSDetail extends LinearLayout {
|
|||||||
mClosingDetail = true;
|
mClosingDetail = true;
|
||||||
mDetailAdapter = null;
|
mDetailAdapter = null;
|
||||||
listener = mTeardownDetailWhenDone;
|
listener = mTeardownDetailWhenDone;
|
||||||
mHeader.setVisibility(View.VISIBLE);
|
// Only update visibility if already expanded. Otherwise, a race condition can cause the
|
||||||
mFooter.setVisibility(View.VISIBLE);
|
// keyguard to enter a bad state where the QS tiles are displayed underneath the
|
||||||
mQsPanelController.setGridContentVisibility(true);
|
// notifications, clock, and status area.
|
||||||
mQsPanelCallback.onScanStateChanged(false);
|
if (mQsPanelController.isExpanded()) {
|
||||||
|
mHeader.setVisibility(View.VISIBLE);
|
||||||
|
mFooter.setVisibility(View.VISIBLE);
|
||||||
|
mQsPanelController.setGridContentVisibility(true);
|
||||||
|
mQsPanelCallback.onScanStateChanged(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
|
sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
|
||||||
animateDetailVisibleDiff(x, y, visibleDiff, listener);
|
animateDetailVisibleDiff(x, y, visibleDiff, listener);
|
||||||
|
|||||||
@@ -1575,7 +1575,10 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
public void expandWithQsDetail(DetailAdapter qsDetailAdapter) {
|
public void expandWithQsDetail(DetailAdapter qsDetailAdapter) {
|
||||||
traceQsJank(true /* startTracing */, false /* wasCancelled */);
|
traceQsJank(true /* startTracing */, false /* wasCancelled */);
|
||||||
flingSettings(0 /* velocity */, FLING_EXPAND);
|
flingSettings(0 /* velocity */, FLING_EXPAND);
|
||||||
mQSDetailDisplayer.showDetailAdapter(qsDetailAdapter, 0, 0);
|
// When expanding with a panel, there's no meaningful touch point to correspond to. Set the
|
||||||
|
// origin to somewhere above the screen. This is used for animations.
|
||||||
|
int x = mQsFrame.getWidth() / 2;
|
||||||
|
mQSDetailDisplayer.showDetailAdapter(qsDetailAdapter, x, -getHeight());
|
||||||
if (mAccessibilityManager.isEnabled()) {
|
if (mAccessibilityManager.isEnabled()) {
|
||||||
mView.setAccessibilityPaneTitle(determineAccessibilityPaneTitle());
|
mView.setAccessibilityPaneTitle(determineAccessibilityPaneTitle());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,8 +148,10 @@ public class QSDetailTest extends SysuiTestCase {
|
|||||||
eq(true) /* in */, any());
|
eq(true) /* in */, any());
|
||||||
clearInvocations(mQsDetail.mClipper);
|
clearInvocations(mQsDetail.mClipper);
|
||||||
|
|
||||||
|
// Detail adapters should always animate on close. shouldAnimate() should only affect the
|
||||||
|
// open transition
|
||||||
mQsDetail.handleShowingDetail(null, 0, 0, false);
|
mQsDetail.handleShowingDetail(null, 0, 0, false);
|
||||||
verify(mQsDetail.mClipper).updateCircularClip(eq(false) /* animate */, anyInt(), anyInt(),
|
verify(mQsDetail.mClipper).updateCircularClip(eq(true) /* animate */, anyInt(), anyInt(),
|
||||||
eq(false) /* in */, any());
|
eq(false) /* in */, any());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user