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

Commit e22aace3 authored by Danny Trunk's avatar Danny Trunk Committed by Luca Stefani
Browse files

LineageParts: Add charging control preferences

Change-Id: I936add4df464eb9818258de4955b651266c67ec3
parent 29fdecc0
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -101,6 +101,17 @@
            </intent-filter>
        </provider>

        <!-- Charging control settings (Battery category) -->
        <activity-alias
            android:name=".health.ChargingControlSettings"
            android:label="@string/charging_control_title"
            android:targetActivity="PartsActivity">
            <intent-filter>
                <action android:name="org.lineageos.lineageparts.CHARGING_CONTROL_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity-alias>

        <!-- Button settings (System category) -->
        <activity-alias
            android:name=".input.ButtonSettings"
+30 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2023 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:orientation="vertical">

    <TimePicker
        android:id="@+id/time_picker"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:paddingTop="8dp" />

</LinearLayout>
+63 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2023 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:paddingVertical="6dip"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:background="?android:attr/selectableItemBackground"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        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/textAppearanceLarge"
            android:textColor="?android:attr/textColorPrimary"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />

        <TextView
            android:id="@+id/value"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="?android:attr/textColorSecondary"
            android:singleLine="true" />

    </RelativeLayout>

    <SeekBar
        android:id="@+id/seekbar_widget"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingVertical="15dip"
        android:min="70"
        android:max="100" />

</LinearLayout>
+20 −0
Original line number Diff line number Diff line
@@ -16,6 +16,26 @@
     limitations under the License.
-->
<resources>
    <!-- Values for the charging control modes -->
    <string-array name="charging_control_mode_entries" translatable="false">
        <item>@string/charging_control_mode_auto_title</item>
        <item>@string/charging_control_mode_custom_title</item>
    </string-array>

    <string-array name="charging_control_mode_values" translatable="false">
        <item>1</item>
        <item>2</item>
    </string-array>

    <!-- Values for the additional charging control modes if fine-grained control is supported -->
    <string-array name="charging_control_mode_entries_fine_grained_control" translatable="false">
        <item>@string/charging_control_mode_limit_title</item>
    </string-array>

    <string-array name="charging_control_mode_values_fine_grained_control" translatable="false">
        <item>3</item>
    </string-array>

    <!-- Values for the notification light pulse spinners -->
    <string-array name="notification_pulse_length_entries" translatable="false">
        <item>@string/pulse_length_always_on</item>
+16 −0
Original line number Diff line number Diff line
@@ -78,6 +78,22 @@
    <string name="light_brightness_normal">Normal</string>
    <string name="light_brightness_zen">Do Not Disturb</string>

    <!-- Charging control settings -->
    <string name="charging_control_title">Charging control</string>
    <string name="charging_control_enable_title">Enable charging control</string>
    <string name="charging_control_mode_title">Charging mode</string>
    <string name="charging_control_mode_auto_title">Automatic schedule</string>
    <string name="charging_control_mode_auto_summary">Automatically determine when to start charging based on alarms set</string>
    <string name="charging_control_mode_custom_title">Custom schedule</string>
    <string name="charging_control_mode_custom_summary">Set a target time to full charge</string>
    <string name="charging_control_mode_limit_title">Limit charging</string>
    <string name="charging_control_mode_limit_summary">Limit charging to a certain percentage</string>
    <string name="charging_control_start_time_title">Start time</string>
    <string name="charging_control_start_time_summary">Charging control activates when you start charging after %s</string>
    <string name="charging_control_target_time_title">Target time to full charge</string>
    <string name="charging_control_target_time_summary">Battery will be fully charged by %s</string>
    <string name="charging_control_limit_title">Limit</string>

    <!-- Battery light settings -->
    <string name="battery_light_title">Battery light</string>
    <string name="battery_light_enable_title">Enable battery light</string>
Loading