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

Commit 205018a8 authored by Lauren Winston's avatar Lauren Winston
Browse files

Add a cursor preference to Accessibility Settings

Bug: 240194047

Test: atest SoftwareCursorPreferencesControllerTest and
SoftwareCursorTogglerPreferenceControllerTest

Change-Id: I97e226d8d8c0bcdfd0e2612e86b81987480063d1
parent e530a172
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2861,6 +2861,22 @@
            column="13"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
        message="Avoid using hardcoded color"
        category="Correctness"
        priority="4"
        summary="Using hardcoded color"
        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
        errorLine1="            android:color=&quot;@color/accessibility_feature_background&quot;/>"
        errorLine2="            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="res/drawable/ic_accessibility_software_cursor.xml"
            line="22"
            column="13"/>
    </issue>

    <issue
        id="HardCodedColor"
        severity="Error"
+35 −0
Original line number Diff line number Diff line
<!--
  Copyright 2022 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.
  -->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <com.android.settingslib.widget.AdaptiveIconShapeDrawable
            android:width="@dimen/accessibility_icon_size"
            android:height="@dimen/accessibility_icon_size"
            android:color="@color/accessibility_feature_background"/>
    </item>
    <item android:gravity="center">
        <vector
            android:height="@dimen/accessibility_icon_foreground_size" android:viewportHeight="400"
            android:viewportWidth="400" android:width="@dimen/accessibility_icon_foreground_size">
            <path android:fillColor="#ffffff" android:pathData="M258.35,149.56l10.36,5.13l-7.6,15.35l-10.36,-5.13L258.35,149.56zM194.11,175.1l5.07,-10.24l15.54,7.69l-5.07,10.24L194.11,175.1z"/>
            <path android:fillColor="#ffffff" android:pathData="M210.38,195.9l3.73,10.83l-16.35,5.41l-3.73,-10.83L210.38,195.9zM219.98,148.91l10.88,-3.6l5.61,16.29l-10.88,3.6L219.98,148.91zM288.78,173.93l3.73,10.83c-8.2,2.76 -8.43,2.83 -16.38,5.46l-3.73,-10.83C280.3,176.74 280.84,176.56 288.78,173.93z"/>
            <path android:fillColor="#ffffff" android:fillType="evenOdd" android:pathData="M301.3,245.59l-26.75,-14.14c-3.93,-2.07 -7.27,-3.42 -7.27,-7.08c0,-26.44 4.38,-52.43 -20.64,-52.43c-26.2,2.55 -20.64,28.7 -20.64,55.14c0,18.58 0,1.63 0,9.34v28.44l-15.19,-3.4l-0.83,-0.17c-0.83,-0.17 -1.65,-0.26 -2.64,-0.26c-4.38,0 -8.5,1.83 -11.64,5.15l0,0c-6.5,6.96 -6.46,17.78 0.09,24.7l30.38,32.1c3.55,3.84 8.5,6.02 13.62,6.02h52.01c8.09,0 14.94,-6.11 16.26,-14.57l6.6,-41.1C316.49,261.99 311.12,250.82 301.3,245.59zM296.38,271l-6.16,36.42c-0.25,1.49 -1.54,2.58 -3.06,2.58h-49.36c-1.98,0 -3.32,-1.74 -3.9,-2.26l-24.53,-24.49c-1.18,-1.25 -0.03,-3.27 1.64,-2.9l18.91,4.19c5.44,1.2 10.6,-2.94 10.07,-8.52v-82.17c0,-3.43 2.84,-6.82 6.71,-6.82c4.54,0 7.29,2.74 7.29,7.19v34.99c-0.21,8.12 2.87,13.62 9.3,17.45l0,0l28.54,15.09C295.15,263.49 296.96,267.24 296.38,271z"/>
            <path android:fillColor="#ffffff" android:pathData="M223,117h-33.23C186.6,95.08 169.55,77.83 148,74.84V42h-14v33.82c-21.66,3.2 -38.72,19.95 -41.92,41.18H59v14h33.88c2.98,21.88 19.77,39.18 41.12,42.47V206h14v-33.3c22.14,-2.95 39.64,-20.04 42.71,-41.7H223V117zM141.99,163h-2.08c-20.39,-0.54 -36.84,-16.67 -37.91,-36.92v-4.16c1.07,-20.25 17.52,-36.38 37.91,-36.92h2.08c21.08,0.56 38.01,17.78 38.01,39C180,145.22 163.07,162.44 141.99,163z"/>
            <path android:fillColor="#ffffff" android:pathData="M141,124m-18,0a18,18 0,1 1,36 0a18,18 0,1 1,-36 0"/>
        </vector>
    </item>
</layer-list>
 No newline at end of file
+8 −0
Original line number Diff line number Diff line
@@ -5132,6 +5132,12 @@
    <string name="accessibility_turn_screen_darker_title">Turn screen darker</string>
    <!-- Title for the accessibility preference category of interaction control services and settings. [CHAR LIMIT=50] -->
    <string name="interaction_control_category_title">Interaction controls</string>
    <!-- Title for the accessibility Software Cursor settings . [CHAR LIMIT=50] -->
    <string name="accessibility_software_cursor_title" translatable="false">Software Cursor</string>
    <!-- Summary for the accessibility Software Cursor settings . [CHAR LIMIT=NONE] -->
    <string name="accessibility_software_cursor_summary" translatable="false">Control your Android device using an on screen cursor</string>
    <!-- Title for the accessibility Software Cursor settings screen. -->
    <string name="accessibility_screen_software_cursor_title" translatable="false">Software Cursor</string>
    <!-- Title for the accessibility tap assistance page. [CHAR LIMIT=50] -->
    <string name="accessibility_tap_assistance_title">Timing controls</string>
    <!-- Title for the accessibility system controls page. [CHAR LIMIT=50] -->
@@ -5869,6 +5875,8 @@
    <string name="keywords_accessibility">Ease of use, ease of access, assistance, assistive</string>
    <!-- List of synonyms used in the settings search bar to find the “Magnification”. [CHAR LIMIT=NONE] -->
    <string name="keywords_magnification">Window Magnifier, Zoom, Magnification, Low vision, Enlarge, make bigger</string>
    <!-- List of synonyms used in the settings search bar to find “Software Cursor". [CHAR LIMIT=NONE] -->
    <string name="keywords_software_cursor" translatable="false">Cursor, Trackpad, Software Cursor, Mouse</string>
    <!-- List of synonyms used in the settings search bar to find the “TalkBack”. [CHAR LIMIT=NONE] -->
    <string name="keywords_talkback"></string>
    <!-- List of synonyms used in the settings search bar to find the “Live Caption”. [CHAR LIMIT=NONE] -->
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 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/accessibility_screen_software_cursor_title"
    settings:searchable="false">
    <com.android.settings.widget.SettingsMainSwitchPreference
        android:key="screen_software_cursor_preference_switch"
        android:title="@string/accessibility_screen_software_cursor_title"
        settings:controller="com.android.settings.accessibility.SoftwareCursorTogglePreferenceController"/>
</PreferenceScreen>
+11 −0
Original line number Diff line number Diff line
@@ -102,6 +102,17 @@
            settings:keywords="@string/keywords_vibration"
            android:summary="@string/accessibility_vibration_settings_summary"/>

        <!-- TODO(b/241023294): UX review of where Software Cursor feature should be positioned. -->
        <Preference
            android:key="software_cursor_preference_screen"
            android:icon="@drawable/ic_accessibility_software_cursor"
            android:fragment="com.android.settings.accessibility.CursorPreferenceFragment"
            android:title="@string/accessibility_software_cursor_title"
            settings:searchable="true"
            settings:keywords="@string/keywords_software_cursor"
            android:summary="@string/accessibility_software_cursor_summary"
            settings:controller="com.android.settings.accessibility.SoftwareCursorPreferenceController"/>

    </PreferenceCategory>

    <PreferenceCategory
Loading