Fix expandSettingsPanel status bar call
Use the same mechanism as the two finger gesture to get it to open correctly. Bug: 19196800 Change-Id: I952e14d3ccd796889ed54cb98c017542a25f28c9
This commit is contained in:
@@ -148,7 +148,8 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
private boolean mBlockTouches;
|
private boolean mBlockTouches;
|
||||||
private int mNotificationScrimWaitDistance;
|
private int mNotificationScrimWaitDistance;
|
||||||
private boolean mTwoFingerQsExpand;
|
// Used for two finger gesture as well as accessibility shortcut to QS.
|
||||||
|
private boolean mQsExpandImmediate;
|
||||||
private boolean mTwoFingerQsExpandPossible;
|
private boolean mTwoFingerQsExpandPossible;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -475,6 +476,13 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void expandWithQs() {
|
||||||
|
if (mQsExpansionEnabled) {
|
||||||
|
mQsExpandImmediate = true;
|
||||||
|
}
|
||||||
|
expand();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fling(float vel, boolean expand) {
|
public void fling(float vel, boolean expand) {
|
||||||
GestureRecorder gr = ((PhoneStatusBarView) mBar).mBar.getGestureRecorder();
|
GestureRecorder gr = ((PhoneStatusBarView) mBar).mBar.getGestureRecorder();
|
||||||
@@ -658,7 +666,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
if (mExpandedHeight != 0) {
|
if (mExpandedHeight != 0) {
|
||||||
handleQsDown(event);
|
handleQsDown(event);
|
||||||
}
|
}
|
||||||
if (!mTwoFingerQsExpand && mQsTracking) {
|
if (!mQsExpandImmediate && mQsTracking) {
|
||||||
onQsTouch(event);
|
onQsTouch(event);
|
||||||
if (!mConflictingQsExpansionGesture) {
|
if (!mConflictingQsExpansionGesture) {
|
||||||
return true;
|
return true;
|
||||||
@@ -675,7 +683,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
if (mTwoFingerQsExpandPossible && event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN
|
if (mTwoFingerQsExpandPossible && event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN
|
||||||
&& event.getPointerCount() == 2
|
&& event.getPointerCount() == 2
|
||||||
&& event.getY(event.getActionIndex()) < mStatusBarMinHeight) {
|
&& event.getY(event.getActionIndex()) < mStatusBarMinHeight) {
|
||||||
mTwoFingerQsExpand = true;
|
mQsExpandImmediate = true;
|
||||||
requestPanelHeightUpdate();
|
requestPanelHeightUpdate();
|
||||||
|
|
||||||
// Normally, we start listening when the panel is expanded, but here we need to start
|
// Normally, we start listening when the panel is expanded, but here we need to start
|
||||||
@@ -1166,7 +1174,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
private float calculateQsTopPadding() {
|
private float calculateQsTopPadding() {
|
||||||
if (mKeyguardShowing
|
if (mKeyguardShowing
|
||||||
&& (mTwoFingerQsExpand || mIsExpanding && mQsExpandedWhenExpandingStarted)) {
|
&& (mQsExpandImmediate || mIsExpanding && mQsExpandedWhenExpandingStarted)) {
|
||||||
|
|
||||||
// Either QS pushes the notifications down when fully expanded, or QS is fully above the
|
// Either QS pushes the notifications down when fully expanded, or QS is fully above the
|
||||||
// notifications (mostly on tablets). maxNotifications denotes the normal top padding
|
// notifications (mostly on tablets). maxNotifications denotes the normal top padding
|
||||||
@@ -1200,7 +1208,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mScrollView.getScrollY(),
|
mScrollView.getScrollY(),
|
||||||
mAnimateNextTopPaddingChange || animate,
|
mAnimateNextTopPaddingChange || animate,
|
||||||
mKeyguardShowing
|
mKeyguardShowing
|
||||||
&& (mTwoFingerQsExpand || mIsExpanding && mQsExpandedWhenExpandingStarted));
|
&& (mQsExpandImmediate || mIsExpanding && mQsExpandedWhenExpandingStarted));
|
||||||
mAnimateNextTopPaddingChange = false;
|
mAnimateNextTopPaddingChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1313,7 +1321,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
min = Math.max(min, minHeight);
|
min = Math.max(min, minHeight);
|
||||||
}
|
}
|
||||||
int maxHeight;
|
int maxHeight;
|
||||||
if (mTwoFingerQsExpand || mQsExpanded || mIsExpanding && mQsExpandedWhenExpandingStarted) {
|
if (mQsExpandImmediate || mQsExpanded || mIsExpanding && mQsExpandedWhenExpandingStarted) {
|
||||||
maxHeight = calculatePanelHeightQsExpanded();
|
maxHeight = calculatePanelHeightQsExpanded();
|
||||||
} else {
|
} else {
|
||||||
maxHeight = calculatePanelHeightShade();
|
maxHeight = calculatePanelHeightShade();
|
||||||
@@ -1328,10 +1336,10 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onHeightUpdated(float expandedHeight) {
|
protected void onHeightUpdated(float expandedHeight) {
|
||||||
if (!mQsExpanded || mTwoFingerQsExpand || mIsExpanding && mQsExpandedWhenExpandingStarted) {
|
if (!mQsExpanded || mQsExpandImmediate || mIsExpanding && mQsExpandedWhenExpandingStarted) {
|
||||||
positionClockAndNotifications();
|
positionClockAndNotifications();
|
||||||
}
|
}
|
||||||
if (mTwoFingerQsExpand || mQsExpanded && !mQsTracking && mQsExpansionAnimator == null
|
if (mQsExpandImmediate || mQsExpanded && !mQsTracking && mQsExpansionAnimator == null
|
||||||
&& !mQsExpansionFromOverscroll) {
|
&& !mQsExpansionFromOverscroll) {
|
||||||
float t;
|
float t;
|
||||||
if (mKeyguardShowing) {
|
if (mKeyguardShowing) {
|
||||||
@@ -1555,7 +1563,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
} else {
|
} else {
|
||||||
setListening(true);
|
setListening(true);
|
||||||
}
|
}
|
||||||
mTwoFingerQsExpand = false;
|
mQsExpandImmediate = false;
|
||||||
mTwoFingerQsExpandPossible = false;
|
mTwoFingerQsExpandPossible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1573,7 +1581,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setOverExpansion(float overExpansion, boolean isPixels) {
|
protected void setOverExpansion(float overExpansion, boolean isPixels) {
|
||||||
if (mConflictingQsExpansionGesture || mTwoFingerQsExpand) {
|
if (mConflictingQsExpansionGesture || mQsExpandImmediate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mStatusBar.getBarState() != StatusBarState.KEYGUARD) {
|
if (mStatusBar.getBarState() != StatusBarState.KEYGUARD) {
|
||||||
@@ -1593,7 +1601,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
protected void onTrackingStarted() {
|
protected void onTrackingStarted() {
|
||||||
super.onTrackingStarted();
|
super.onTrackingStarted();
|
||||||
if (mQsFullyExpanded) {
|
if (mQsFullyExpanded) {
|
||||||
mTwoFingerQsExpand = true;
|
mQsExpandImmediate = true;
|
||||||
}
|
}
|
||||||
if (mStatusBar.getBarState() == StatusBarState.KEYGUARD
|
if (mStatusBar.getBarState() == StatusBarState.KEYGUARD
|
||||||
|| mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED) {
|
|| mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED) {
|
||||||
@@ -1817,7 +1825,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
@Override
|
@Override
|
||||||
protected boolean fullyExpandedClearAllVisible() {
|
protected boolean fullyExpandedClearAllVisible() {
|
||||||
return mNotificationStackScroller.isDismissViewNotGone()
|
return mNotificationStackScroller.isDismissViewNotGone()
|
||||||
&& mNotificationStackScroller.isScrolledToBottom() && !mTwoFingerQsExpand;
|
&& mNotificationStackScroller.isScrolledToBottom() && !mQsExpandImmediate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2416,8 +2416,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
// Settings are not available in setup
|
// Settings are not available in setup
|
||||||
if (!mUserSetup) return;
|
if (!mUserSetup) return;
|
||||||
|
|
||||||
mNotificationPanel.expand();
|
mNotificationPanel.expandWithQs();
|
||||||
mNotificationPanel.openQs();
|
|
||||||
|
|
||||||
if (false) postStartTracing();
|
if (false) postStartTracing();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user