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

Commit 26ce6885 authored by Jay Aliomer's avatar Jay Aliomer Committed by Android (Google) Code Review
Browse files

Merge "Revert "Revert "Add settings for scheduling dark theme""" into qt-qpr1-dev

parents adfc51a5 53ad4fed
Loading
Loading
Loading
Loading
+40 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2019 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.
  -->

<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">

    <Button
        android:id="@+id/dark_ui_turn_on_button"
        style="@style/ActionPrimaryButton"
        android:layout_marginStart="@dimen/screen_margin_sides"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical" />

    <Button
        android:id="@+id/dark_ui_turn_off_button"
        style="@style/ActionSecondaryButton"
        android:layout_marginStart="@dimen/screen_margin_sides"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical" />

</LinearLayout>
 No newline at end of file
+8 −0
Original line number Original line Diff line number Diff line
@@ -100,6 +100,14 @@
        <item>1800000</item>
        <item>1800000</item>
    </string-array>
    </string-array>


    <!-- Dark theme scheduling preferences  [CHAR LIMIT=NONE] -->
    <string-array name="dark_ui_scheduler_preference_titles">
        <!-- 1: None -->
        <item>@string/dark_ui_auto_mode_never</item>
        <!-- 2: Auto -->
        <item>@string/dark_ui_auto_mode_auto</item>
    </string-array>

    <!-- Security settings.  The delay after screen is turned off until device locks.
    <!-- Security settings.  The delay after screen is turned off until device locks.
         These are shown in a list dialog. -->
         These are shown in a list dialog. -->
    <string-array name="lock_after_timeout_entries">
    <string-array name="lock_after_timeout_entries">
+35 −0
Original line number Original line Diff line number Diff line
@@ -2917,6 +2917,40 @@
    <!-- Night display slice screen, subtitle of intensity setting when night light is off. [CHAR LIMIT=30] -->
    <!-- Night display slice screen, subtitle of intensity setting when night light is off. [CHAR LIMIT=30] -->
    <string name="night_display_not_currently_on">Night Light not currently on</string>
    <string name="night_display_not_currently_on">Night Light not currently on</string>
    <!--    Dark ui screen-->
    <!-- Display settings screen, activation button action for manual mode. [CHAR LIMIT=40] -->
    <string name="dark_ui_activation_on_manual">Turn on now</string>
    <!-- Display settings screen, deactivation button action for manual mode. [CHAR LIMIT=40] -->
    <string name="dark_ui_activation_off_manual">Turn off now</string>
    <!-- Display settings screen, activation button action for sunset-to-sunrise schedule [CHAR LIMIT=40] -->
    <string name="dark_ui_activation_on_auto">Turn on until sunrise</string>
    <!-- Display settings screen, deactivation button action for sunset-to-sunrise schedule [CHAR LIMIT=40] -->
    <string name="dark_ui_activation_off_auto">Turn off until sunset</string>
    <!-- Dark UI screen, setting option name to enable Dark UI [CHAR LIMIT=30] -->
    <string name="dark_ui_title">Dark Mode</string>
    <!-- Dark UI screen, setting option name to configure whether Dark UI turn on/off automatically. [CHAR LIMIT=30] -->
    <string name="dark_ui_auto_mode_title">Schedule</string>
    <!-- Dark UI screen, setting option value for Dark UI to *never* turn on/off automatically. [CHAR LIMIT=30] -->
    <string name="dark_ui_auto_mode_never">None</string>
    <!-- Dark UIscreen, setting option value for Dark UI to turn on/off automatically at sunset/sunrise. [CHAR LIMIT=32] -->
    <string name="dark_ui_auto_mode_auto">Turns on from sunset to sunrise</string>
    <!-- Dark UIscreen, setting option name controlling the current activation status. [CHAR LIMIT=30] -->
    <string name="dark_ui_status_title">Status</string>
    <!-- Display settings screen, summary format of Dark UI when off. [CHAR LIMIT=NONE] -->
    <string name="dark_ui_summary_off">Off / <xliff:g name="auto_mode_summary" example="Never turn on automatically">%1$s</xliff:g></string>
    <!-- Display settings screen, summary of Dark UI when off and will *never* turn on automatically. [CHAR LIMIT=NONE] -->
    <string name="dark_ui_summary_off_auto_mode_never">Will never turn on automatically</string>
    <!-- Display settings screen, summary of Dark UI when off and will turn on automatically at sunset. [CHAR LIMIT=NONE] -->
    <string name="dark_ui_summary_off_auto_mode_auto">Will turn on automatically at sunset</string>
    <!-- Display settings screen, summary format of Dark UI when on. [CHAR LIMIT=NONE] -->
    <string name="dark_ui_summary_on">On / <xliff:g name="auto_mode_summary" example="Never turn off automatically">%1$s</xliff:g></string>
    <!-- Display settings screen, summary of Dark UI when on and will *never* turn off automatically. [CHAR LIMIT=NONE] -->
    <string name="dark_ui_summary_on_auto_mode_never">Will never turn off automatically</string>
    <!-- Display settings screen, summary of Dark UI when on and will turn off automatically at sunrise. [CHAR LIMIT=NONE] -->
    <string name="dark_ui_summary_on_auto_mode_auto">Will turn off automatically at sunrise</string>
    <!-- Dark theme screen, description of Dark theme feature. [CHAR LIMIT=NONE] -->
    <string name="dark_ui_text">Dark theme uses true black to help keep your battery alive longer. Dark theme schedules wait to turn on until your screen is off.</string>
    <!-- Sound & display settings screen, setting option name to change screen timeout -->
    <!-- Sound & display settings screen, setting option name to change screen timeout -->
    <string name="screen_timeout">Screen timeout</string>
    <string name="screen_timeout">Screen timeout</string>
    <!-- Sound & display settings screen, setting option name to change screen timeout [CHAR LIMIT=30] -->
    <!-- Sound & display settings screen, setting option name to change screen timeout [CHAR LIMIT=30] -->
@@ -7040,6 +7074,7 @@
    <string name="help_url_connected_devices" translatable="false"></string>
    <string name="help_url_connected_devices" translatable="false"></string>
    <string name="help_url_apps_and_notifications" translatable="false"></string>
    <string name="help_url_apps_and_notifications" translatable="false"></string>
    <string name="help_url_night_display" translatable="false"></string>
    <string name="help_url_night_display" translatable="false"></string>
    <string name="help_url_dark_theme" translatable="false"></string>
    <string name="help_url_screen_saver" translatable="false"></string>
    <string name="help_url_screen_saver" translatable="false"></string>
    <string name="help_url_pickup_gesture" translatable="false"></string>
    <string name="help_url_pickup_gesture" translatable="false"></string>
    <string name="help_url_storage_dashboard" translatable="false"></string>
    <string name="help_url_storage_dashboard" translatable="false"></string>
+49 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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.
-->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:title="@string/dark_ui_mode"
    android:key="dark_ui_mode_screen"
    settings:keywords="@string/keywords_dark_ui_mode">

    <DropDownPreference
        android:key="dark_ui_auto_mode"
        android:title="@string/dark_ui_auto_mode_title"
        android:summary="%s"
        android:entries="@array/dark_ui_scheduler_preference_titles"
        android:entryValues="@array/dark_ui_scheduler_preference_titles"
        settings:controller="com.android.settings.display.darkmode.DarkModeScheduleSelectorController"
        settings:keywords="@string/keywords_dark_ui_mode"/>

    <com.android.settingslib.widget.LayoutPreference
        android:key="dark_ui_activated"
        android:title="@string/dark_ui_title"
        android:selectable="false"
        android:layout="@layout/dark_ui_activation_button"
        settings:allowDividerBelow="true"
        settings:controller="com.android.settings.display.darkmode.DarkModeActivationPreferenceController"
        settings:keywords="@string/keywords_dark_ui_mode"/>

    <com.android.settingslib.widget.FooterPreference
            android:key="dark_ui_footer"
            android:title="@string/dark_ui_text"
            android:selectable="false"
            settings:searchable="false"
            settings:allowDividerAbove="true"/>

</PreferenceScreen>
 No newline at end of file
+9 −7
Original line number Original line Diff line number Diff line
@@ -31,6 +31,15 @@
        <intent android:action="com.android.intent.action.SHOW_BRIGHTNESS_DIALOG" />
        <intent android:action="com.android.intent.action.SHOW_BRIGHTNESS_DIALOG" />
    </com.android.settingslib.RestrictedPreference>
    </com.android.settingslib.RestrictedPreference>


    <com.android.settings.display.darkmode.DarkModePreference
        android:key="dark_ui_mode"
        android:title="@string/dark_ui_mode"
        android:fragment="com.android.settings.display.darkmode.DarkModeSettingsFragment"
        android:widgetLayout="@null"
        settings:widgetLayout="@null"
        settings:controller="com.android.settings.display.DarkUIPreferenceController"
        settings:searchable="false"/>

    <com.android.settings.display.NightDisplayPreference
    <com.android.settings.display.NightDisplayPreference
        android:key="night_display"
        android:key="night_display"
        android:title="@string/night_display_title"
        android:title="@string/night_display_title"
@@ -54,13 +63,6 @@
        settings:controller="com.android.settings.display.WallpaperPreferenceController">
        settings:controller="com.android.settings.display.WallpaperPreferenceController">
    </com.android.settingslib.RestrictedPreference>
    </com.android.settingslib.RestrictedPreference>



    <SwitchPreference
        android:key="dark_ui_mode"
        android:title="@string/dark_ui_mode"
        settings:keywords="@string/keywords_dark_ui_mode"
        settings:controller="com.android.settings.display.DarkUIPreferenceController"/>

    <!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
    <!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
    <com.android.settings.display.TimeoutListPreference
    <com.android.settings.display.TimeoutListPreference
        android:key="screen_timeout"
        android:key="screen_timeout"
Loading