Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31d100f3 authored by Michael Bestas's avatar Michael Bestas Committed by Sevenrock
Browse files

Settings: Use correct icon for ring volume



Author: Han Wang <416810799@qq.com>
Date:   Tue Aug 4 13:33:45 2020 +0200

    Settings: Fix icon size for ring volume

    Change-Id: Idc62abbaea8d4d4ccb72f4a9f395ce0f861dc705

Change-Id: If145262562c1409cd8a6cb79ba46b6646c75d1a8
Signed-off-by: default avatarPMS22 <prathams99@rediff.com>
parent c7f22ff5
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2016 The CyanogenMod Project
     Copyright (C) 2018 The LineageOS 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="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24"
    android:tint="?android:attr/colorControlNormal">

    <path
        android:fillColor="@android:color/black"
        android:pathData="M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M17,11A5,5 0 0,0 12,6A5,5 0 0,0 7,11V18H17V11M19.75,3.19L18.33,4.61C20.04,6.3 21,8.6 21,11H23C23,8.07 21.84,5.25 19.75,3.19M1,11H3C3,8.6 3.96,6.3 5.67,4.61L4.25,3.19C2.16,5.25 1,8.07 1,11Z" />
</vector>
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@
    <!-- Ring volume -->
    <com.android.settings.notification.VolumeSeekBarPreference
        android:key="ring_volume"
        android:icon="@drawable/ic_notifications"
        android:icon="@drawable/ic_audio_ring"
        android:title="@string/ring_volume_option_title"
        android:order="-160"
        settings:controller="com.android.settings.notification.RingVolumePreferenceController"/>
+14 −0
Original line number Diff line number Diff line
@@ -63,4 +63,18 @@ public class NotificationVolumePreferenceController extends
        return R.drawable.ic_notifications_off_24dp;
    }

    @Override
    protected void updatePreferenceIcon() {
        if (mPreference != null) {
            if (mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
                mMuteIcon = R.drawable.ic_volume_ringer_vibrate;
                mPreference.showIcon(R.drawable.ic_volume_ringer_vibrate);
            } else if (mRingerMode == AudioManager.RINGER_MODE_SILENT) {
                mMuteIcon = R.drawable.ic_notifications_off_24dp;
                mPreference.showIcon(R.drawable.ic_notifications_off_24dp);
            } else {
                mPreference.showIcon(R.drawable.ic_notifications);
            }
        }
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -43,12 +43,12 @@ public class RingVolumePreferenceController extends VolumeSeekBarPreferenceContr
    private static final String KEY_RING_VOLUME = "ring_volume";

    private Vibrator mVibrator;
    private int mRingerMode = -1;
    protected int mRingerMode = -1;
    private ComponentName mSuppressor;
    private final RingReceiver mReceiver = new RingReceiver();
    private final H mHandler = new H();

    private int mMuteIcon;
    protected int mMuteIcon;

    public RingVolumePreferenceController(Context context) {
        this(context, KEY_RING_VOLUME);
@@ -133,7 +133,7 @@ public class RingVolumePreferenceController extends VolumeSeekBarPreferenceContr
        updatePreferenceIcon();
    }

    private void updatePreferenceIcon() {
    protected void updatePreferenceIcon() {
        if (mPreference != null) {
            if (mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
                mMuteIcon = R.drawable.ic_volume_ringer_vibrate;
@@ -142,7 +142,7 @@ public class RingVolumePreferenceController extends VolumeSeekBarPreferenceContr
                mMuteIcon = R.drawable.ic_notifications_off_24dp;
                mPreference.showIcon(R.drawable.ic_notifications_off_24dp);
            } else {
                mPreference.showIcon(R.drawable.ic_notifications);
                mPreference.showIcon(R.drawable.ic_audio_ring);
            }
        }
    }