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

Commit 21fd0e8a authored by Kevin Chang's avatar Kevin Chang
Browse files

Support accessibility shorcut secondary action (2/n)

Create a dialog that could let users choose their preferred accessibility
shortcut.

This CL only contains dialog layout and its utility methods.
Related logic implementation will be added in next CL.

Bug: 142531156
Test: Maunal
Change-Id: I7bfccea96cc47dd213b4d828499c10b290e24330
parent b4a6245d
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<!--
    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.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:height="32dp"
        android:viewportHeight="48"
        android:viewportWidth="48"
        android:width="32dp">
    <path
        android:fillColor="#757575"
        android:pathData="M14.83,16.42L24,25.59l9.17,-9.17L36,19.25l-12,12 -12,-12z"/>
</vector>
+41 −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
  -->

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbarStyle="outsideOverlay">

    <LinearLayout
        android:theme="@style/Theme.AlertDialog"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingTop="24dp"
        android:paddingStart="24dp"
        android:paddingEnd="24dp">

        <include android:id="@+id/software_shortcut"
                 layout="@layout/accessibility_edit_shortcut_component"/>

        <include android:id="@+id/hardware_shortcut"
                 layout="@layout/accessibility_edit_shortcut_component"/>

    </LinearLayout>

</ScrollView>
 No newline at end of file
+43 −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
  -->

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

    <CheckBox
        android:id="@+id/checkbox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <TextView
        android:id="@+id/summary"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="?android:attr/textColorSecondary"
        android:paddingStart="32dp"/>

    <ImageView
        android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingStart="32dp"
        android:scaleType="fitCenter"/>

</LinearLayout>
 No newline at end of file
+66 −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
  -->

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbarStyle="outsideOverlay">

    <LinearLayout
        android:theme="@style/Theme.AlertDialog"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingTop="24dp"
        android:paddingStart="24dp"
        android:paddingEnd="24dp">

        <include android:id="@+id/software_shortcut"
                 layout="@layout/accessibility_edit_shortcut_component"/>

        <include android:id="@+id/hardware_shortcut"
                 layout="@layout/accessibility_edit_shortcut_component"/>

        <LinearLayout
            android:id="@+id/advanced_shortcut"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_keyboard_arrow_down"
                android:scaleType="fitCenter"/>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center_vertical"
                android:textColor="?android:attr/colorAccent"
                android:text="@string/accessibility_shortcut_edit_dialog_title_advance"/>

        </LinearLayout>>

        <include android:id="@+id/triple_tap_shortcut"
                 layout="@layout/accessibility_edit_shortcut_component"
                 android:visibility="gone"/>

    </LinearLayout>

</ScrollView>
 No newline at end of file
+18 −0
Original line number Diff line number Diff line
@@ -4732,6 +4732,24 @@
    <string name="accessibility_tutorial_dialog_message_gesture_settings_with_talkback">To turn an accessibility service on or off, swipe up from the bottom of the screen with three fingers.\n\nTo switch between services, swipe up with three fingers and hold.</string>
    <!-- Button for the Accessibility tutorial dialog to dismiss the dialog when user clicks it. [CHAR LIMIT=10] -->
    <string name="accessibility_tutorial_dialog_button">Got it</string>
    <!-- Title for software shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
    <string name="accessibility_shortcut_edit_dialog_title_software">Accessibility Button</string>
    <!-- Title for software shortcut in gesture mode in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
    <string name="accessibility_shortcut_edit_dialog_title_software_gesture">2-finger swipe up from bottom</string>
    <!-- Summary for software shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
    <string name="accessibility_shortcut_edit_dialog_summary_software">Tap the <xliff:g id="accessibility_icon" example="[Icon]">%s</xliff:g> button at the bottom of your screen</string>
    <!-- Summary for software shortcut in gesture mode in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
    <string name="accessibility_shortcut_edit_dialog_summary_software_gesture">Swipe up with 2 fingers from edge of screen</string>
    <!-- Title for hardware shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
    <string name="accessibility_shortcut_edit_dialog_title_hardware">Hold volume keys</string>
    <!-- Summary for hardware shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
    <string name="accessibility_shortcut_edit_dialog_summary_hardware">Press and hold both volume keys for 1 second</string>
    <!-- Title for triple tap shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
    <string name="accessibility_shortcut_edit_dialog_title_triple_tap">Triple tap screen</string>
    <!-- Summary for triple tap shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
    <string name="accessibility_shortcut_edit_dialog_summary_triple_tap">Quickly tap screen 3 times (this can slow down your device)</string>
    <!-- Title for the Accessibility edit shortcut dialog to save the preference when user clicks it. [CHAR LIMIT=10] -->
    <string name="accessibility_shortcut_edit_dialog_title_advance">Advanced</string>
    <!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->
    <string name="accessibility_screen_magnification_navbar_configuration_warning">The Accessibility button is set to <xliff:g id="service" example="Select to Speak">%1$s</xliff:g>. To use magnification, touch &amp; hold the Accessibility button, then select magnification.</string>
    <!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->
Loading