Android 5.1系統禁止通知狀態列下拉
阿新 • • 發佈:2019-02-12
之前看了網上很多修改,感覺太繁瑣,修改程式碼太多,最後感覺還是自己找找,看能不能簡單點
實際上就是修改一行程式碼。。diff --git a/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/android/frameworks/base/packa old mode 100644 new mode 100755 index 7cbf13f..7b0dc81 --- a/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/android/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -23,6 +23,7 @@ import android.util.EventLog; import android.view.MotionEvent; import android.view.View; import android.view.accessibility.AccessibilityEvent; +import android.os.SystemProperties; import com.android.systemui.EventLogTags; import com.android.systemui.R; @@ -94,9 +95,7 @@ public class PhoneStatusBarView extends PanelBar { @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; } @Override
如果你還想遮蔽通知欄的資訊,可以在往下看看
diff --git a/android/frameworks/base/packages/SystemUI/res/layout/status_bar.xml b/android/frameworks/base/packages/SystemUI/res/layout/status_bar.xml old mode 100644 new mode 100755 index 245c128..795b4b0 --- a/android/frameworks/base/packages/SystemUI/res/layout/status_bar.xml +++ b/android/frameworks/base/packages/SystemUI/res/layout/status_bar.xml @@ -50,6 +50,8 @@ <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"