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

Commit af8ddc61 authored by Roman Birg's avatar Roman Birg
Browse files

Settings: add "Untouched" ring mode option in profiles



Change-Id: I4ac2d63119b328533217104a799cb0660ecddfb9
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent bb8be355
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The CyanogenMod 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

</LinearLayout>
 No newline at end of file
+2 −14
Original line number Diff line number Diff line
@@ -65,20 +65,6 @@
        <item>10000</item>
    </integer-array>

    <!-- Ring mode options. -->
    <string-array name="ring_mode_entries" translatable="false">
        <item>@string/ring_mode_normal</item>
        <item>@string/ring_mode_vibrate</item>
        <item>@string/ring_mode_mute</item>
    </string-array>

    <!-- Values for Ring mode. Do not translate. -->
    <string-array name="ring_mode_values" translatable="false">
        <item>normal</item>
        <item>vibrate</item>
        <item>mute</item>
    </string-array>

    <string-array name="lockscreen_battery_status_entries" translatable="false">
        <item>@string/lockscreen_battery_status_charging</item>
        <item>@string/lockscreen_battery_status_alwayson</item>
@@ -276,6 +262,7 @@
        <item>@string/ring_mode_normal</item>
        <item>@string/ring_mode_vibrate</item>
        <item>@string/ring_mode_mute</item>
        <item>@string/ring_mode_unchanged</item>
    </string-array>

    <!-- Values for Ring mode. Do not translate. -->
@@ -283,6 +270,7 @@
        <item>normal</item>
        <item>vibrate</item>
        <item>mute</item>
        <item></item>
    </string-array>

    <!-- Values for the notification light pulse spinners -->
+2 −1
Original line number Diff line number Diff line
@@ -180,9 +180,10 @@

    <!-- Ring mode -->
    <string name="ring_mode_title">Ring mode</string>
    <string name="ring_mode_normal">Normal</string>
    <string name="ring_mode_normal">Ring</string>
    <string name="ring_mode_vibrate">Vibrate</string>
    <string name="ring_mode_mute">Mute</string>
    <string name="ring_mode_unchanged">Unchanged</string>

    <!-- Volume panel style -->
    <string name="volume_overlay_title">Volume panel style</string>
+14 −7
Original line number Diff line number Diff line
@@ -382,13 +382,15 @@ public class SetupActionsFragment extends SettingsPreferenceFragment

        int defaultIndex = 0; // normal by default
        if (setting.isOverride()) {
            if (setting.getValue().equals(values[1] /* vibrate */)) {
            if (setting.getValue().equals(values[0] /* normal */)) {
                defaultIndex = 0;
            } else if (setting.getValue().equals(values[1] /* vibrate */)) {
                defaultIndex = 1; // enabled
            } else if (setting.getValue().equals(values[2] /* mute */)) {
                defaultIndex = 2; // mute
            } else {
                defaultIndex = 1; // disabled
            }
        } else {
            defaultIndex = 3;
        }

        builder.setTitle(R.string.ring_mode_title);
@@ -397,17 +399,21 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
            @Override
            public void onClick(DialogInterface dialog, int item) {
                switch (item) {
                    case 0: // disable override
                        setting.setOverride(false);
                    case 0: // enable override, normal
                        setting.setOverride(true);
                        setting.setValue(values[0]);
                        break;
                    case 1: // enable override, disable
                    case 1: // enable override, vibrate
                        setting.setOverride(true);
                        setting.setValue(values[1]);
                        break;
                    case 2: // enable override, enable
                    case 2: // enable override, mute
                        setting.setOverride(true);
                        setting.setValue(values[2]);
                        break;
                    case 3:
                        setting.setOverride(false);
                        break;
                }
                mProfile.setRingMode(setting);
                mAdapter.notifyDataSetChanged();
@@ -484,6 +490,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
            @Override
            public void onClick(DialogInterface dialog, int which) {
                int value = seekBar.getProgress();
                streamSettings.setOverride(true);
                streamSettings.setValue(value);
                mProfile.setStreamSettings(streamSettings);
                mAdapter.notifyDataSetChanged();
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public class RingModeItem implements Item {
                return R.string.ring_mode_mute;
            }
        } else {
            return R.string.ring_mode_normal;
            return R.string.ring_mode_unchanged;
        }
    }