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
This commit is contained in:
Kevin Chang
2019-11-15 20:03:21 +08:00
parent b4a6245d8d
commit 21fd0e8afb
6 changed files with 452 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?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>

View File

@@ -0,0 +1,43 @@
<?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>

View File

@@ -0,0 +1,66 @@
<?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>