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

Commit 0305010d authored by Danny Baumann's avatar Danny Baumann Committed by Arne Coucheron
Browse files

Add back increasing ring feature (2/3).

This also squashes in the following fixes from cm-13.0:
Ia4291d8ac3d1dbf76d432db7e0e973844163c4ae Fix NPE.
Ibe7fdf1ee7f0aa1c7c76052df69fa92e8b6a2ffd Fix up increasing ring tone volume preview behaviour.
Id32d6b51aab05e80be59bc1912c4ae7c5d114ac5 Settings: Always set ramp-up time value during bindView

Change-Id: Iafc79a57651db327a100e0f1723b62f442b638be
parent 4ad75bc4
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false" android:color="#24000000" />
    <item android:color="#8a000000" />
</selector>
+12 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="@color/audio_icon"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="#000"
        android:pathData="M12,22c1.105,0,2-0.898,2-2h-4C10,21.102,10.896,22,12,22Z M18.5,16v-5.5c0-3.075-2.135-5.643-5-6.321V3.5 C13.5,2.67,12.828,2,12,2s-1.5,0.67-1.5,1.5v0.679c-2.865,0.678-5,3.246-5,6.321V16l-2,2v1h17v-1L18.5,16z M16.504,14.558H7.561  V13.25l8.943-3.808V14.558z" />
</vector>
+106 −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:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="?android:attr/listPreferredItemHeight"
    android:gravity="center_vertical"
    android:paddingEnd="?android:attr/scrollbarSize">

    <ImageView
        android:id="@+android:id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:src="@drawable/ring_notif_increasing"
        android:minWidth="48dp" />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dip"
        android:layout_marginEnd="8dip"
        android:layout_marginTop="6dip"
        android:layout_marginBottom="6dip"
        android:layout_weight="1">

        <TextView android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView android:id="@+id/start_volume_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@android:id/title"
            android:layout_alignStart="@android:id/title"
            android:text="@string/increasing_ring_min_volume_title"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"
            android:singleLine="true" />

        <SeekBar android:id="@+id/start_volume"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/start_volume_label"
            android:layout_alignParentEnd="true"
            android:max="1000" />

        <TextView android:id="@+id/ramp_up_time_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/start_volume"
            android:layout_alignStart="@android:id/title"
            android:text="@string/increasing_ring_ramp_up_time_title"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"
            android:singleLine="true" />

        <TextView android:id="@+id/ramp_up_time_value"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/start_volume"
            android:layout_toEndOf="@id/ramp_up_time_label"
            android:layout_alignBaseline="@id/ramp_up_time_label"
            android:layout_alignParentEnd="true"
            android:gravity="end"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"
            android:singleLine="true" />

        <SeekBar android:id="@+id/ramp_up_time"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/ramp_up_time_label"
            android:layout_alignParentEnd="true"
            android:max="11" />

        <TextView android:id="@android:id/summary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/ramp_up_time"
            android:layout_alignStart="@android:id/title"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"
            android:maxLines="4" />

    </RelativeLayout>

</LinearLayout>
+5 −0
Original line number Diff line number Diff line
@@ -325,4 +325,9 @@
    <string name="adb_over_network">ADB over network</string>
    <string name="adb_over_network_summary">Enable TCP/IP debugging over network interfaces (Wi\u2011Fi, USB networks). This setting is reset on reboot</string>
    <string name="adb_over_network_warning">WARNING: When ADB over network is enabled, your phone is open for intrusions on all connected networks!\n\nOnly use this feature when you are connected on trusted networks.\n\nDo you really want to enable this function?</string>

    <!-- Increasing ring tone volume -->
    <string name="increasing_ring_volume_option_title">Increasing ring volume</string>
    <string name="increasing_ring_min_volume_title">Start volume</string>
    <string name="increasing_ring_ramp_up_time_title">Ramp-up time</string>
</resources>
+11 −0
Original line number Diff line number Diff line
@@ -38,6 +38,17 @@
                android:icon="@*android:drawable/ic_audio_ring_notif"
                android:title="@string/ring_volume_option_title" />

        <!-- Increasing ring -->
        <cyanogenmod.preference.CMSystemSettingSwitchPreference
                android:key="increasing_ring"
                android:title="@string/increasing_ring_volume_option_title" />

        <!-- Increasing ring volume -->
        <com.android.settings.notification.IncreasingRingVolumePreference
                android:key="increasing_ring_volume"
                android:icon="@drawable/ring_notif_increasing"
                android:dependency="increasing_ring" />

        <!-- Notification volume -->
        <com.android.settings.notification.VolumeSeekBarPreference
                android:key="notification_volume"
Loading