本文是基于Android5.1的代碼

Android原生下拉欄樣式(此圖是轉載的)
怎去紅色部分的呢?(此圖是轉載的)
很簡單,直接隐藏掉就行了,接下來找到我們的路徑:
frameworks\base\packages\SystemUI\src\com\android\systemui\volume\ZenModePanel.java
private void updateWidgets() {
if (mTransitionHelper.isTransitioning()) {
mTransitionHelper.pendingUpdateWidgets();
return;
}
final int zen = getSelectedZen(Global.ZEN_MODE_OFF);
final boolean zenOff = zen == Global.ZEN_MODE_OFF;
final boolean zenImportant = zen == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS;
final boolean zenNone = zen == Global.ZEN_MODE_NO_INTERRUPTIONS;
final boolean expanded = !mHidden && mExpanded;
// mZenButtons.setVisibility(mHidden ? GONE : VISIBLE);
mZenButtons.setVisibility(GONE);
mZenSubhead.setVisibility(!mHidden && !zenOff ? VISIBLE : GONE);
mZenSubheadExpanded.setVisibility(expanded ? VISIBLE : GONE);
mZenSubheadCollapsed.setVisibility(!expanded ? VISIBLE : GONE);
mMoreSettings.setVisibility(zenImportant && expanded ? VISIBLE : GONE);
mZenConditions.setVisibility(!zenOff && expanded ? VISIBLE : GONE);
if (zenNone) {
/// M: Support "Operator plugin - customize zen none text". @{
String zenNoneTitle = mContext.getString(R.string.zen_no_interruptions_with_warning);
zenNoneTitle = PluginFactory.getVolumePlugin(mContext)
.customizeZenModeNoInterruptionsTitle(zenNoneTitle);
/// M: Support "Operator plugin - customize zen none text". @}
mZenSubheadExpanded.setText(zenNoneTitle);
mZenSubheadCollapsed.setText(mExitConditionText);
} else if (zenImportant) {
mZenSubheadExpanded.setText(R.string.zen_important_interruptions);
mZenSubheadCollapsed.setText(mExitConditionText);
}
mZenSubheadExpanded.setTextColor(zenNone && mPrefs.isNoneDangerous()
? mSubheadWarningColor : mSubheadColor);
}
mZenButtons.setVisibility(mHidden ? GONE : VISIBLE) 直接注釋掉或 mZenButtons.setVisibility(GONE);