Merge "Zen: Distinct icon for DND = total silence." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ceacb51e04
29
packages/SystemUI/res/drawable/ic_dnd_total_silence.xml
Normal file
29
packages/SystemUI/res/drawable/ic_dnd_total_silence.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2015 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:width="24dp" >
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0s10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,20.5c-4.7,0.0 -8.5,-3.8 -8.5,-8.5S7.3,3.5 12.0,3.5s8.5,3.8 8.5,8.5S16.7,20.5 12.0,20.5z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12.0,6.0c-3.3,0.0 -6.0,2.7 -6.0,6.0c0.0,3.3 2.7,6.0 6.0,6.0s6.0,-2.7 6.0,-6.0C18.0,8.7 15.4,6.0 12.0,6.0zM15.0,13.0L9.0,13.0l0.0,-2.0l6.0,0.0L15.0,13.0z"/>
|
||||||
|
|
||||||
|
</vector>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Copyright (C) 2015 The Android Open Source Project
|
Copyright (C) 2015 The Android Open Source Project
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2015 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="64dp"
|
||||||
|
android:height="64dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0s10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,20.5c-4.7,0.0 -8.5,-3.8 -8.5,-8.5S7.3,3.5 12.0,3.5s8.5,3.8 8.5,8.5S16.7,20.5 12.0,20.5z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12.0,6.0c-3.3,0.0 -6.0,2.7 -6.0,6.0c0.0,3.3 2.7,6.0 6.0,6.0s6.0,-2.7 6.0,-6.0C18.0,8.7 15.4,6.0 12.0,6.0zM15.0,13.0L9.0,13.0l0.0,-2.0l6.0,0.0L15.0,13.0z"/>
|
||||||
|
|
||||||
|
</vector>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Copyright (C) 2015 The Android Open Source Project
|
Copyright (C) 2015 The Android Open Source Project
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2015 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:insetLeft="2.5dp"
|
||||||
|
android:insetRight="2.5dp">
|
||||||
|
<vector
|
||||||
|
android:width="17dp"
|
||||||
|
android:height="17dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0s10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,20.5c-4.7,0.0 -8.5,-3.8 -8.5,-8.5S7.3,3.5 12.0,3.5s8.5,3.8 8.5,8.5S16.7,20.5 12.0,20.5z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M12.0,6.0c-3.3,0.0 -6.0,2.7 -6.0,6.0c0.0,3.3 2.7,6.0 6.0,6.0s6.0,-2.7 6.0,-6.0C18.0,8.7 15.4,6.0 12.0,6.0zM15.0,13.0L9.0,13.0l0.0,-2.0l6.0,0.0L15.0,13.0z"/>
|
||||||
|
</vector>
|
||||||
|
</inset>
|
||||||
@@ -41,8 +41,7 @@
|
|||||||
android:layout_width="@dimen/volume_button_size"
|
android:layout_width="@dimen/volume_button_size"
|
||||||
android:layout_height="@dimen/volume_button_size"
|
android:layout_height="@dimen/volume_button_size"
|
||||||
android:layout_marginEnd="7dp"
|
android:layout_marginEnd="7dp"
|
||||||
android:scaleType="center"
|
android:scaleType="center" />
|
||||||
android:src="@drawable/ic_dnd" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class DndTile extends QSTile<QSTile.BooleanState> {
|
|||||||
R.string.accessibility_quick_settings_dnd_priority_on);
|
R.string.accessibility_quick_settings_dnd_priority_on);
|
||||||
break;
|
break;
|
||||||
case Global.ZEN_MODE_NO_INTERRUPTIONS:
|
case Global.ZEN_MODE_NO_INTERRUPTIONS:
|
||||||
state.icon = ResourceIcon.get(R.drawable.ic_qs_dnd_on);
|
state.icon = ResourceIcon.get(R.drawable.ic_qs_dnd_on_total_silence);
|
||||||
state.label = mContext.getString(R.string.quick_settings_dnd_none_label);
|
state.label = mContext.getString(R.string.quick_settings_dnd_none_label);
|
||||||
state.contentDescription = mContext.getString(
|
state.contentDescription = mContext.getString(
|
||||||
R.string.accessibility_quick_settings_dnd_none_on);
|
R.string.accessibility_quick_settings_dnd_none_on);
|
||||||
|
|||||||
@@ -219,7 +219,8 @@ public class PhoneStatusBarPolicy {
|
|||||||
|
|
||||||
if (DndTile.isVisible(mContext) || DndTile.isCombinedIcon(mContext)) {
|
if (DndTile.isVisible(mContext) || DndTile.isCombinedIcon(mContext)) {
|
||||||
zenVisible = mZen != Global.ZEN_MODE_OFF;
|
zenVisible = mZen != Global.ZEN_MODE_OFF;
|
||||||
zenIconId = R.drawable.stat_sys_dnd;
|
zenIconId = mZen == Global.ZEN_MODE_NO_INTERRUPTIONS
|
||||||
|
? R.drawable.stat_sys_dnd_total_silence : R.drawable.stat_sys_dnd;
|
||||||
zenDescription = mContext.getString(R.string.quick_settings_dnd_label);
|
zenDescription = mContext.getString(R.string.quick_settings_dnd_label);
|
||||||
} else if (mZen == Global.ZEN_MODE_NO_INTERRUPTIONS) {
|
} else if (mZen == Global.ZEN_MODE_NO_INTERRUPTIONS) {
|
||||||
zenVisible = true;
|
zenVisible = true;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import android.provider.Settings.Global;
|
|||||||
import android.service.notification.ZenModeConfig;
|
import android.service.notification.ZenModeConfig;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ public class ZenFooter extends LinearLayout {
|
|||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final SpTexts mSpTexts;
|
private final SpTexts mSpTexts;
|
||||||
|
|
||||||
|
private ImageView mIcon;
|
||||||
private TextView mSummaryLine1;
|
private TextView mSummaryLine1;
|
||||||
private TextView mSummaryLine2;
|
private TextView mSummaryLine2;
|
||||||
private TextView mEndNowButton;
|
private TextView mEndNowButton;
|
||||||
@@ -55,6 +57,7 @@ public class ZenFooter extends LinearLayout {
|
|||||||
@Override
|
@Override
|
||||||
protected void onFinishInflate() {
|
protected void onFinishInflate() {
|
||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
|
mIcon = (ImageView) findViewById(R.id.volume_zen_icon);
|
||||||
mSummaryLine1 = (TextView) findViewById(R.id.volume_zen_summary_line_1);
|
mSummaryLine1 = (TextView) findViewById(R.id.volume_zen_summary_line_1);
|
||||||
mSummaryLine2 = (TextView) findViewById(R.id.volume_zen_summary_line_2);
|
mSummaryLine2 = (TextView) findViewById(R.id.volume_zen_summary_line_2);
|
||||||
mEndNowButton = (TextView) findViewById(R.id.volume_zen_end_now);
|
mEndNowButton = (TextView) findViewById(R.id.volume_zen_end_now);
|
||||||
@@ -115,6 +118,7 @@ public class ZenFooter extends LinearLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
|
mIcon.setImageResource(isZenNone() ? R.drawable.ic_dnd_total_silence : R.drawable.ic_dnd);
|
||||||
final String line1 =
|
final String line1 =
|
||||||
isZenPriority() ? mContext.getString(R.string.interruption_level_priority)
|
isZenPriority() ? mContext.getString(R.string.interruption_level_priority)
|
||||||
: isZenAlarms() ? mContext.getString(R.string.interruption_level_alarms)
|
: isZenAlarms() ? mContext.getString(R.string.interruption_level_alarms)
|
||||||
|
|||||||
Reference in New Issue
Block a user