修改frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@Override
public PanelView selectPanelForTouch(MotionEvent touch) {
// No double swiping. If either panel is open, nothing else can be pulled down.
//return mNotificationPanel.getExpandedHeight() > 0
// ? null
// : mNotificationPanel;
return null; .
}
这时候launcher界面或者app界面都不能下拉了,这样还有一个小问题,锁屏界面的下拉菜单还是可以下拉的,我们还需要做一下更改
修改frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
(1)
private void setQsExpanded(boolean expanded) {
//begin 添加下面四行
if(mKeyguardShowing)
{
return;
}
//end
boolean changed = mQsExpanded != expanded;
if (changed) {
mQsExpanded = expanded;
updateQsState();
requestPanelHeightUpdate();
mNotificationStackScroller.setInterceptDelegateEnabled(expanded);
mStatusBar.setQsExpanded(expanded);
}
}
(2)
private boolean shouldQuickSettingsIntercept(float x, float y, float yDiff) {
if (!mQsExpansionEnabled) {
return false;
}
//begin 将下面第一行替换成第二行
View header = mKeyguardShowing ? mKeyguardStatusBar : mHeader;
View header = mHeader;
//end
boolean onHeader = x >= header.getLeft() && x <= header.getRight()
&& y >= header.getTop() && y <= header.getBottom();
if (mQsExpanded) {
return onHeader || (mScrollView.isScrolledToBottom() && yDiff < 0) && isInQsArea(x, y);
} else {
return onHeader;
}
}
(3) private boolean onTouchEvent()
{
...
if (!mTwoFingerQsExpand && mQsTracking) {
//begin 添加下面
if(!mKeyguardShowing){
onQsTouch(event);
if (!mConflictingQsExpansionGesture) {
return true;
}
}
//end
}
...
}
不显示下拉通知
<span style="font-size:18px;">android:visibility属性:</span>
frameworks/base/packages/SystemUI/res/layout/status_bar.xml
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
android:id="@+id/notification_icon_area"
android:visibility="invisible"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"