1.概述
遇到需求,QuickQSPanel首次下拉后展示快捷功能模块以后就是显示QuickQSPanel,而不展开QSPanel,接下来要从下滑手势下拉出状态栏分析功能实现。也就是直接是展开状态。
2、涉及核心类
frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone
Android12或者Android13
frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\NotificationPanelViewController.java
frameworks/base/packages/SystemUI/res/layout/status_bar_expanded.xml
Android10
frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\NotificationPanelViewController.java
frameworks/base/packages/SystemUI/res/layout/status_bar_expanded.xml
3、修改
private void setQsExpansion(float height) {
// mQs 不等于空直接复用
if (mQs != null) return;
// mQs 等于空新建
height = Math.min(Math.max(height, mQsMinExpansionHeight), mQsMaxExpansionHeight);
mQsFullyExpanded = height == mQsMaxExpansionHeight && mQsMaxExpansionHeight != 0;
if (height > mQsMinExpansionHeight && !mQsExpanded && !mStackScrollerOverscrolling
&& !mDozing) {
setQsExpanded(true);
} else if (height <= mQsMinExpansionHeight && mQsExpanded) {
setQsExpanded(false);
}
mQsExpansionHeight = height;
updateQsExpansion();
requestScrollerTopPaddingUpdate(false /* animate */);
updateHeaderKeyguardAlpha();
if (mBarState == StatusBarState.SHADE_LOCKED || mBarState == KEYGUARD) {
updateKeyguardBottomAreaAlpha();
positionClockAndNotifications();
updateBigClockAlpha();
}
if (mAccessibilityManager.isEnabled()) {
mView.setAccessibilityPaneTitle(determineAccessibilityPaneTitle());
}
if (!mFalsingManager.isUnlockingDisabled() && mQsFullyExpanded
&& mFalsingCollector.shouldEnforceBouncer()) {
mStatusBar.executeRunnableDismissingKeyguard(null, null /* cancelAction */,
false /* dismissShade */, true /* afterKeyguardGone */, false /* deferred */);
}
for (int i = 0; i < mExpansionListeners.size(); i++) {
mExpansionListeners.get(i).onQsExpansionChanged(
mQsMaxExpansionHeight != 0 ? mQsExpansionHeight / mQsMaxExpansionHeight : 0);
}
if (DEBUG) {
mView.invalidate();
}
}