ParanoidSystemUI: SoundTile: Add speaker icons
Show it when ringer and notification volumes are separated, according to rest of the UI. Change-Id: I9428f62df667c846c5d643c027923806880ebe52
This commit is contained in:
parent
3f5ec79d24
commit
aea6899443
|
@ -0,0 +1,24 @@
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2022 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"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:autoMirrored="true">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M14,20.725V18.675Q16.25,18.025 17.625,16.175Q19,14.325 19,11.975Q19,9.625 17.625,7.775Q16.25,5.925 14,5.275V3.225Q17.1,3.925 19.05,6.362Q21,8.8 21,11.975Q21,15.15 19.05,17.587Q17.1,20.025 14,20.725ZM3,15V9H7L12,4V20L7,15ZM14,16V7.95Q15.175,8.5 15.838,9.6Q16.5,10.7 16.5,12Q16.5,13.275 15.838,14.362Q15.175,15.45 14,16ZM10,8.85 L7.85,11H5V13H7.85L10,15.15ZM7.5,12Z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2022 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"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:autoMirrored="true">
|
||||||
|
<path android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M19.8,22.6 L16.775,19.575Q16.15,19.975 15.45,20.263Q14.75,20.55 14,20.725V18.675Q14.35,18.55 14.688,18.425Q15.025,18.3 15.325,18.125L12,14.8V20L7,15H3V9H6.2L1.4,4.2L2.8,2.8L21.2,21.2ZM19.6,16.8 L18.15,15.35Q18.575,14.575 18.788,13.725Q19,12.875 19,11.975Q19,9.625 17.625,7.775Q16.25,5.925 14,5.275V3.225Q17.1,3.925 19.05,6.362Q21,8.8 21,11.975Q21,13.3 20.638,14.525Q20.275,15.75 19.6,16.8ZM16.25,13.45 L14,11.2V7.95Q15.175,8.5 15.838,9.6Q16.5,10.7 16.5,12Q16.5,12.375 16.438,12.738Q16.375,13.1 16.25,13.45ZM12,9.2 L9.4,6.6 12,4ZM10,15.15V12.8L8.2,11H5V13H7.85ZM9.1,11.9Z"/>
|
||||||
|
</vector>
|
|
@ -133,7 +133,8 @@ public class SoundTile extends QSTileImpl<BooleanState> {
|
||||||
}
|
}
|
||||||
switch (mAudioManager.getRingerModeInternal()) {
|
switch (mAudioManager.getRingerModeInternal()) {
|
||||||
case AudioManager.RINGER_MODE_NORMAL:
|
case AudioManager.RINGER_MODE_NORMAL:
|
||||||
state.icon = ResourceIcon.get(R.drawable.ic_qs_ringer_audible);
|
state.icon = ResourceIcon.get(isSeparateNotification()
|
||||||
|
? R.drawable.ic_qs_speaker_audible : R.drawable.ic_qs_ringer_audible);
|
||||||
state.secondaryLabel = mContext.getString(R.string.quick_settings_sound_ring);
|
state.secondaryLabel = mContext.getString(R.string.quick_settings_sound_ring);
|
||||||
state.state = Tile.STATE_ACTIVE;
|
state.state = Tile.STATE_ACTIVE;
|
||||||
break;
|
break;
|
||||||
|
@ -143,7 +144,8 @@ public class SoundTile extends QSTileImpl<BooleanState> {
|
||||||
state.state = Tile.STATE_INACTIVE;
|
state.state = Tile.STATE_INACTIVE;
|
||||||
break;
|
break;
|
||||||
case AudioManager.RINGER_MODE_SILENT:
|
case AudioManager.RINGER_MODE_SILENT:
|
||||||
state.icon = ResourceIcon.get(R.drawable.ic_qs_ringer_silent);
|
state.icon = ResourceIcon.get(isSeparateNotification()
|
||||||
|
? R.drawable.ic_qs_speaker_silent : R.drawable.ic_qs_ringer_silent);
|
||||||
state.secondaryLabel = mContext.getString(R.string.quick_settings_sound_silent);
|
state.secondaryLabel = mContext.getString(R.string.quick_settings_sound_silent);
|
||||||
state.state = Tile.STATE_INACTIVE;
|
state.state = Tile.STATE_INACTIVE;
|
||||||
break;
|
break;
|
||||||
|
@ -154,4 +156,9 @@ public class SoundTile extends QSTileImpl<BooleanState> {
|
||||||
public int getMetricsCategory() {
|
public int getMetricsCategory() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isSeparateNotification() {
|
||||||
|
return Settings.System.getInt(mContext.getContentResolver(),
|
||||||
|
Settings.System.VOLUME_SEPARATE_NOTIFICATION, 0) == 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue