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

Commit a5f5ff4a authored by shaoweishen's avatar shaoweishen
Browse files

[A11y Setting] Add keyboard keys preferences under A11y page

Bug: 325851068
Test: make RunSettingsRoboTests
Change-Id: Ic7eb1ec9e260a95d040bee784cbff479a4f087d0
parent b3646a49
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2024 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.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="@dimen/accessibility_icon_size"
    android:height="@dimen/accessibility_icon_size"
    android:viewportWidth="32"
    android:viewportHeight="32">
    <path
        android:pathData="M16,16m-16,0a16,16 0,1 1,32 0a16,16 0,1 1,-32 0"
        android:fillColor="#5F6368"/>
    <path
        android:pathData="M15.865,9.507C17.448,9.47 19.038,10.047 20.245,11.255C22.585,13.602 22.585,17.397 20.237,19.753L19.18,18.695C20.935,16.94 20.935,14.083 19.18,12.328C18.28,11.42 17.08,11 15.895,11.03L16.683,11.818L15.625,12.875L13,10.25L15.625,7.625L16.69,8.682L15.865,9.507ZM15.318,19.183L16.375,18.125L19,20.75L16.368,23.368L15.31,22.31L16.135,21.485C14.552,21.522 12.962,20.945 11.755,19.737C9.415,17.397 9.415,13.595 11.755,11.255L12.82,12.305C11.065,14.06 11.065,16.917 12.82,18.673C13.72,19.58 14.92,20 16.105,19.97L15.318,19.183Z"
        android:fillColor="#ffffff"
        android:fillType="evenOdd"/>
</vector>
+29 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2024 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.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="@dimen/accessibility_icon_size"
    android:height="@dimen/accessibility_icon_size"
    android:viewportWidth="32"
    android:viewportHeight="32">
    <path
        android:pathData="M16,16m-16,0a16,16 0,1 1,32 0a16,16 0,1 1,-32 0"
        android:fillColor="#5F6368"/>
    <path
        android:pathData="M15.535,9.53C15.685,9.515 15.842,9.5 16,9.5C19.728,9.5 22.75,12.523 22.75,16.25C22.75,19.978 19.728,23 16,23C12.273,23 9.25,19.978 9.25,16.25H10.75C10.75,19.145 13.105,21.5 16,21.5C18.895,21.5 21.25,19.145 21.25,16.25C21.25,13.355 18.895,11 16,11C15.894,11 15.797,11.012 15.698,11.025C15.664,11.029 15.63,11.034 15.595,11.038L16.907,12.35L15.85,13.408L12.693,10.25L15.85,7.1L16.907,8.158L15.535,9.53ZM16.675,17.203C16.675,17.398 16.608,17.563 16.48,17.69C16.353,17.818 16.188,17.878 15.993,17.878C15.797,17.878 15.64,17.818 15.512,17.698C15.385,17.585 15.295,17.42 15.25,17.218L14.545,17.495C14.597,17.743 14.703,17.945 14.852,18.11C15.002,18.283 15.175,18.403 15.377,18.485C15.573,18.568 15.783,18.605 16,18.605C16.278,18.605 16.532,18.545 16.75,18.425C16.975,18.305 17.14,18.14 17.267,17.93C17.395,17.72 17.455,17.473 17.455,17.203C17.455,16.933 17.395,16.693 17.275,16.483C17.155,16.273 16.99,16.108 16.795,15.995C16.6,15.883 16.382,15.823 16.157,15.823C15.88,15.823 15.648,15.905 15.445,16.07L15.4,16.055L15.55,15.095H17.215V14.405H14.898L14.665,16.46L15.43,16.805C15.498,16.723 15.58,16.655 15.677,16.603C15.775,16.55 15.887,16.528 16.007,16.528C16.202,16.528 16.36,16.595 16.487,16.723C16.615,16.85 16.675,17.008 16.675,17.203Z"
        android:fillColor="#ffffff"
        android:fillType="evenOdd"/>
</vector>
+29 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2024 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.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="@dimen/accessibility_icon_size"
    android:height="@dimen/accessibility_icon_size"
    android:viewportHeight="32"
    android:viewportWidth="32">
    <path
        android:fillColor="#5F6368"
        android:pathData="M16,16m-16,0a16,16 0,1 1,32 0a16,16 0,1 1,-32 0" />
    <path
        android:fillColor="#ffffff"
        android:fillType="evenOdd"
        android:pathData="M22,10.25H10C9.175,10.25 8.507,10.925 8.507,11.75L8.5,19.25C8.5,20.075 9.175,20.75 10,20.75H22C22.825,20.75 23.5,20.075 23.5,19.25V11.75C23.5,10.925 22.825,10.25 22,10.25ZM22,11.75V19.25H10V11.75H22ZM16.75,12.5H15.25V14H16.75V12.5ZM15.25,14.75H16.75V16.25H15.25V14.75ZM14.5,12.5H13V14H14.5V12.5ZM13,14.75H14.5V16.25H13V14.75ZM12.25,14.75H10.75V16.25H12.25V14.75ZM10.75,12.5H12.25V14H10.75V12.5ZM19,17H13V18.5H19V17ZM17.5,14.75H19V16.25H17.5V14.75ZM19,12.5H17.5V14H19V12.5ZM19.75,14.75H21.25V16.25H19.75V14.75ZM21.25,12.5H19.75V14H21.25V12.5Z" />
</vector>
+8 −6
Original line number Diff line number Diff line
@@ -4328,16 +4328,16 @@
    <string name="show_ime_summary">Keep it on screen while physical keyboard is active</string>
    <!-- Title for the 'Bounce keys' preference switch. [CHAR LIMIT=35] -->
    <string name="bounce_keys">Bounce keys</string>
    <!-- Summary text for the 'Bounce keys' preference sub-screen. [CHAR LIMIT=100] -->
    <string name="bounce_keys_summary">Enable Bounce keys for physical keyboard accessibility</string>
    <!-- Summary text for the 'Bounce keys' preference sub-screen. [CHAR LIMIT=300] -->
    <string name="bounce_keys_summary">The keyboard ignores quickly repeated presses of the same key within <xliff:g id="bounce_keys_threshold" example="500">%1$d</xliff:g> ms</string>
    <!-- Title for the 'Slow keys' preference switch. [CHAR LIMIT=35] -->
    <string name="slow_keys">Slow keys</string>
    <!-- Summary text for the 'Slow keys' preference sub-screen. [CHAR LIMIT=100] -->
    <string name="slow_keys_summary">Enable Slow keys for physical keyboard accessibility</string>
    <!-- Summary text for the 'Slow keys' preference sub-screen. [CHAR LIMIT=300] -->
    <string name="slow_keys_summary">Adjusts the time it takes for a key press to activate to <xliff:g id="slow_keys_threshold" example="500">%1$d</xliff:g> ms</string>
    <!-- Title for the 'Sticky keys' preference switch. [CHAR LIMIT=35] -->
    <string name="sticky_keys">Sticky keys</string>
    <!-- Summary text for the 'Sticky keys' preference sub-screen. [CHAR LIMIT=100] -->
    <string name="sticky_keys_summary">Enable Sticky keys for physical keyboard accessibility</string>
    <!-- Summary text for the 'Sticky keys' preference sub-screen. [CHAR LIMIT=300] -->
    <string name="sticky_keys_summary">Press one key at a time for shortcuts instead of holding keys down together</string>
    <!-- Title for the button to trigger the 'keyboard shortcuts helper' dialog. [CHAR LIMIT=35] -->
    <string name="keyboard_shortcuts_helper">Keyboard shortcuts</string>
    <!-- Summary text for the 'keyboard shortcuts helper' dialog. [CHAR LIMIT=100] -->
@@ -4601,6 +4601,8 @@
    <string name="vision_settings_suggestion_title">Change font size</string>
    <!-- Title for the accessibility preference category of screen reader services and settings. [CHAR LIMIT=50] -->
    <string name="screen_reader_category_title">Screen reader</string>
    <!-- Title for the accessibility preference category of physical keyboard options. [CHAR LIMIT=50] -->
    <string name="keyboard_category_title">Physical keyboard options</string>
    <!-- Title for the accessibility preference category of caption services and settings. [CHAR LIMIT=50] -->
    <string name="captions_category_title">Captions</string>
    <!-- Title for the accessibility preference category of audio services and settings. [CHAR LIMIT=50] -->
+31 −0
Original line number Diff line number Diff line
@@ -105,6 +105,37 @@

    </PreferenceCategory>

    <PreferenceCategory
        android:key="physical_keyboard_options_category"
        android:persistent="false"
        android:title="@string/keyboard_category_title">

        <SwitchPreferenceCompat
            android:icon="@drawable/ic_sticky_keys"
            android:key="toggle_keyboard_sticky_keys"
            android:persistent="false"
            android:summary="@string/sticky_keys_summary"
            android:title="@string/sticky_keys"
            settings:controller="com.android.settings.accessibility.KeyboardStickyKeyPreferenceController"
            settings:searchable="true" />

        <SwitchPreferenceCompat
            android:icon="@drawable/ic_bounce_keys"
            android:key="toggle_keyboard_bounce_keys"
            android:persistent="false"
            android:title="@string/bounce_keys"
            settings:controller="com.android.settings.accessibility.KeyboardBounceKeyPreferenceController"
            settings:searchable="true" />

        <SwitchPreferenceCompat
            android:icon="@drawable/ic_slow_keys"
            android:key="toggle_keyboard_slow_keys"
            android:persistent="false"
            android:title="@string/slow_keys"
            settings:controller="com.android.settings.accessibility.KeyboardSlowKeyPreferenceController"
            settings:searchable="true" />
    </PreferenceCategory>

    <PreferenceCategory
        android:key="captions_category"
        android:persistent="false"
Loading