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

Commit b7306044 authored by menghanli's avatar menghanli Committed by Raff Tsai
Browse files

Create settings for color inversion (2/n)

Provide a setting for new color inversion design.

Bug: 146019226
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ColorInversionPreferenceControllerTest
Test: make RunSettingsRoboTests2
Change-Id: I1d081c6321ee96d48e8f52304893e4a5fb59333a
parent b2c2f9d5
Loading
Loading
Loading
Loading
+14.9 KiB
Loading image diff...
+29 −0
Original line number 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.
  -->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="@dimen/color_mode_preview_height"
        android:contentDescription="@null"
        android:scaleType="fitCenter"
        android:src="@drawable/accessibility_color_inversion_preview"/>
</FrameLayout>
+4 −2
Original line number Diff line number Diff line
@@ -4903,8 +4903,10 @@
    <string name="accessibility_long_press_timeout_preference_title">Touch &amp; hold delay</string>
    <!-- Title for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] -->
    <string name="accessibility_display_inversion_preference_title">Color inversion</string>
    <!-- Used in the accessibility service settings to control turning display color inversion on/off entirely. [CHAR LIMIT=NONE] -->
    <string name="accessibility_display_inversion_switch_title">Invert colors</string>
    <!-- Subtitle for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] -->
    <string name="accessibility_display_inversion_preference_subtitle">May affect performance</string>
    <string name="accessibility_display_inversion_preference_subtitle">Turn light screens dark so people who are sensitive to bright light can have a better viewing experience.\n\nNote: dark colors will turn light. Images will also be inverted.</string>
    <!-- Title for accessibility preference for configuring feature that performs click action soon after mouse/trackpad pointer stops moving. [CHAR LIMIT=NONE] -->
    <string name="accessibility_autoclick_preference_title">Dwell timing</string>
    <!-- Footer text to explain what autoclick does -->
@@ -4919,7 +4921,7 @@
    <string name="accessibility_ring_vibration_title">Ring vibration</string>
    <!-- Title for accessibility preference for configuring touch feedback vibrations. -->
    <string name="accessibility_touch_vibration_title">Touch feedback</string>
    <!-- Used in the acessibilty service settings to control turning on/off the service entirely -->
    <!-- Used in the accessibility service settings to control turning on/off the service entirely -->
    <string name="accessibility_service_master_switch_title">Use <xliff:g id="accessibility_app_name" example="TalkBack">%1$s</xliff:g></string>
    <!-- Used in the Color correction settings screen to control turning on/off the feature entirely -->
    <string name="accessibility_daltonizer_master_switch_title">Use color correction</string>
+42 −0
Original line number 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:key="color_inversion_preference_screen"
    android:persistent="false"
    android:title="@string/accessibility_display_inversion_preference_title">

    <com.android.settingslib.widget.LayoutPreference
        android:key="color_inversion_preview"
        android:layout="@layout/color_inversion_preview"
        android:persistent="false"
        android:selectable="false"
        android:title="@string/summary_placeholder"
        settings:allowDividerAbove="true"
        settings:allowDividerBelow="true"
        settings:searchable="false" />

    <com.android.settingslib.widget.FooterPreference
        android:key="color_inversion_footer"
        android:persistent="false"
        android:selectable="false"
        android:title="@string/accessibility_display_inversion_preference_subtitle"
        settings:allowDividerAbove="true"
        settings:searchable="false" />
</PreferenceScreen>
+2 −2
Original line number Diff line number Diff line
@@ -209,11 +209,11 @@
            android:title="@string/accessibility_display_daltonizer_preference_title"
            settings:controller="com.android.settings.accessibility.DaltonizerPreferenceController"/>

        <SwitchPreference
        <Preference
            android:fragment="com.android.settings.accessibility.ToggleColorInversionPreferenceFragment"
            android:icon="@drawable/ic_color_inversion"
            android:key="toggle_inversion_preference"
            android:persistent="false"
            android:summary="@string/accessibility_display_inversion_preference_subtitle"
            android:title="@string/accessibility_display_inversion_preference_title"
            settings:controller="com.android.settings.accessibility.ColorInversionPreferenceController"/>
    </PreferenceCategory>
Loading