summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evan Chen <evanxinchen@google.com> 2022-05-05 16:44:48 -0700
committer Evan Chen <evanxinchen@google.com> 2022-05-06 17:33:44 -0700
commit3eef2a0542e8a36224cfb9ba628f7e208aab96e2 (patch)
treeaa52139ceee705f680a00a485cd6e50fee97dae5
parent253e417e7694b63b89d2f118f2841e5659520227 (diff)
Fix CDM dialog for accessibility
1. Support RTL language. 2. Make Info, Vendor and permission icon darker in dark mode. 3. Increase the size of back button 4. Increase the size of vendor, info icon 5. Make CDM dialog rotateable in landscape mode 6. Add ScrollView for CDM dialog 7. Add a lable for Info icon Test: atest CtsCompanionDeviceManagerCoreTestCases atest CtsCompanionDeviceManagerUiAutomationTestCases atest CtsOsTestCases:CompanionDeviceManagerTest Fix: 231387185, 231387975, 231395535, 231397714, 231407966, 231407973, 231410305 Change-Id: I0df377f6b30e933ea8674291b2c8bf26c7f8ab36
-rw-r--r--packages/CompanionDeviceManager/AndroidManifest.xml1
-rw-r--r--packages/CompanionDeviceManager/res/drawable-night/ic_apps.xml27
-rw-r--r--packages/CompanionDeviceManager/res/drawable-night/ic_info.xml25
-rw-r--r--packages/CompanionDeviceManager/res/drawable-night/ic_notifications.xml26
-rw-r--r--packages/CompanionDeviceManager/res/drawable-night/ic_storage.xml25
-rw-r--r--packages/CompanionDeviceManager/res/drawable/helper_back_button.xml4
-rw-r--r--packages/CompanionDeviceManager/res/drawable/ic_apps.xml3
-rw-r--r--packages/CompanionDeviceManager/res/drawable/ic_notifications.xml2
-rw-r--r--packages/CompanionDeviceManager/res/drawable/ic_storage.xml2
-rw-r--r--packages/CompanionDeviceManager/res/layout/activity_confirmation.xml203
-rw-r--r--packages/CompanionDeviceManager/res/layout/helper_confirmation.xml97
-rw-r--r--packages/CompanionDeviceManager/res/layout/list_item_device.xml5
-rw-r--r--packages/CompanionDeviceManager/res/layout/list_item_permission.xml6
-rw-r--r--packages/CompanionDeviceManager/res/layout/vendor_header.xml24
-rw-r--r--packages/CompanionDeviceManager/res/values/strings.xml6
-rw-r--r--packages/CompanionDeviceManager/res/values/styles.xml15
-rw-r--r--packages/CompanionDeviceManager/res/values/themes.xml4
-rw-r--r--packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java9
18 files changed, 311 insertions, 173 deletions
diff --git a/packages/CompanionDeviceManager/AndroidManifest.xml b/packages/CompanionDeviceManager/AndroidManifest.xml
index 8b5d214f7a10..16cd2e55136c 100644
--- a/packages/CompanionDeviceManager/AndroidManifest.xml
+++ b/packages/CompanionDeviceManager/AndroidManifest.xml
@@ -46,6 +46,7 @@
android:launchMode="singleInstance"
android:excludeFromRecents="true"
android:permission="android.permission.BIND_COMPANION_DEVICE_MANAGER_SERVICE"
+ android:configChanges="orientation|screenSize"
android:theme="@style/ChooserActivity"/>
<service
diff --git a/packages/CompanionDeviceManager/res/drawable-night/ic_apps.xml b/packages/CompanionDeviceManager/res/drawable-night/ic_apps.xml
new file mode 100644
index 000000000000..8d7fa26acff4
--- /dev/null
+++ b/packages/CompanionDeviceManager/res/drawable-night/ic_apps.xml
@@ -0,0 +1,27 @@
+<!--
+ ~ 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="@android:color/system_accent1_200">
+ <path
+ android:pathData="M6.2529,18.5H16.2529V17.5H18.2529V21.5C18.2529,22.6 17.3529,23.5 16.2529,23.5H6.2529C5.1529,23.5 4.2529,22.6 4.2529,21.5V3.5C4.2529,2.4 5.1529,1.51 6.2529,1.51L16.2529,1.5C17.3529,1.5 18.2529,2.4 18.2529,3.5V7.5H16.2529V6.5H6.2529V18.5ZM16.2529,3.5H6.2529V4.5H16.2529V3.5ZM6.2529,21.5V20.5H16.2529V21.5H6.2529ZM12.6553,9.4049C12.6553,8.8526 13.103,8.4049 13.6553,8.4049H20.5254C21.0776,8.4049 21.5254,8.8526 21.5254,9.4049V14.6055C21.5254,15.1578 21.0776,15.6055 20.5254,15.6055H14.355L12.6553,17.0871V9.4049Z"
+ android:fillColor="#3C4043"
+ android:fillType="evenOdd"/>
+</vector> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable-night/ic_info.xml b/packages/CompanionDeviceManager/res/drawable-night/ic_info.xml
new file mode 100644
index 000000000000..5689e34d0886
--- /dev/null
+++ b/packages/CompanionDeviceManager/res/drawable-night/ic_info.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="@android:color/system_accent1_200">
+ <path android:fillColor="@android:color/white"
+ android:pathData="M11,17H13V11H11ZM12,9Q12.425,9 12.713,8.712Q13,8.425 13,8Q13,7.575 12.713,7.287Q12.425,7 12,7Q11.575,7 11.288,7.287Q11,7.575 11,8Q11,8.425 11.288,8.712Q11.575,9 12,9ZM12,22Q9.925,22 8.1,21.212Q6.275,20.425 4.925,19.075Q3.575,17.725 2.788,15.9Q2,14.075 2,12Q2,9.925 2.788,8.1Q3.575,6.275 4.925,4.925Q6.275,3.575 8.1,2.787Q9.925,2 12,2Q14.075,2 15.9,2.787Q17.725,3.575 19.075,4.925Q20.425,6.275 21.212,8.1Q22,9.925 22,12Q22,14.075 21.212,15.9Q20.425,17.725 19.075,19.075Q17.725,20.425 15.9,21.212Q14.075,22 12,22ZM12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12Q12,12 12,12ZM12,20Q15.325,20 17.663,17.663Q20,15.325 20,12Q20,8.675 17.663,6.337Q15.325,4 12,4Q8.675,4 6.338,6.337Q4,8.675 4,12Q4,15.325 6.338,17.663Q8.675,20 12,20Z"/>
+</vector> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable-night/ic_notifications.xml b/packages/CompanionDeviceManager/res/drawable-night/ic_notifications.xml
new file mode 100644
index 000000000000..06bfad5b8efd
--- /dev/null
+++ b/packages/CompanionDeviceManager/res/drawable-night/ic_notifications.xml
@@ -0,0 +1,26 @@
+<?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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="@android:color/system_accent1_200">
+ <path android:fillColor="@android:color/white"
+ android:pathData="M4,19V17H6V10Q6,7.925 7.25,6.312Q8.5,4.7 10.5,4.2V3.5Q10.5,2.875 10.938,2.438Q11.375,2 12,2Q12.625,2 13.062,2.438Q13.5,2.875 13.5,3.5V4.2Q15.5,4.7 16.75,6.312Q18,7.925 18,10V17H20V19ZM12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5ZM12,22Q11.175,22 10.588,21.413Q10,20.825 10,20H14Q14,20.825 13.413,21.413Q12.825,22 12,22ZM8,17H16V10Q16,8.35 14.825,7.175Q13.65,6 12,6Q10.35,6 9.175,7.175Q8,8.35 8,10Z"/>
+</vector> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable-night/ic_storage.xml b/packages/CompanionDeviceManager/res/drawable-night/ic_storage.xml
new file mode 100644
index 000000000000..f8aef33c88ea
--- /dev/null
+++ b/packages/CompanionDeviceManager/res/drawable-night/ic_storage.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="@android:color/system_accent1_200">
+ <path android:fillColor="@android:color/white"
+ android:pathData="M6,17H18L14.25,12L11.25,16L9,13ZM5,21Q4.175,21 3.587,20.413Q3,19.825 3,19V5Q3,4.175 3.587,3.587Q4.175,3 5,3H19Q19.825,3 20.413,3.587Q21,4.175 21,5V19Q21,19.825 20.413,20.413Q19.825,21 19,21ZM5,19H19Q19,19 19,19Q19,19 19,19V5Q19,5 19,5Q19,5 19,5H5Q5,5 5,5Q5,5 5,5V19Q5,19 5,19Q5,19 5,19ZM5,5Q5,5 5,5Q5,5 5,5V19Q5,19 5,19Q5,19 5,19Q5,19 5,19Q5,19 5,19V5Q5,5 5,5Q5,5 5,5Z"/>
+</vector> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable/helper_back_button.xml b/packages/CompanionDeviceManager/res/drawable/helper_back_button.xml
index 8e92051faf6c..6ce1f1263638 100644
--- a/packages/CompanionDeviceManager/res/drawable/helper_back_button.xml
+++ b/packages/CompanionDeviceManager/res/drawable/helper_back_button.xml
@@ -18,6 +18,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/system_accent1_100"/>
- <corners android:topLeftRadius="16dp" android:topRightRadius="16dp"
- android:bottomLeftRadius="16dp" android:bottomRightRadius="16dp"/>
+ <corners android:topLeftRadius="20dp" android:topRightRadius="20dp"
+ android:bottomLeftRadius="20dp" android:bottomRightRadius="20dp"/>
</shape> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable/ic_apps.xml b/packages/CompanionDeviceManager/res/drawable/ic_apps.xml
index d1ec8637775c..7295e78b16cb 100644
--- a/packages/CompanionDeviceManager/res/drawable/ic_apps.xml
+++ b/packages/CompanionDeviceManager/res/drawable/ic_apps.xml
@@ -19,7 +19,8 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
- android:viewportHeight="24">
+ android:viewportHeight="24"
+ android:tint="@android:color/system_accent1_600">
<path
android:pathData="M6.2529,18.5H16.2529V17.5H18.2529V21.5C18.2529,22.6 17.3529,23.5 16.2529,23.5H6.2529C5.1529,23.5 4.2529,22.6 4.2529,21.5V3.5C4.2529,2.4 5.1529,1.51 6.2529,1.51L16.2529,1.5C17.3529,1.5 18.2529,2.4 18.2529,3.5V7.5H16.2529V6.5H6.2529V18.5ZM16.2529,3.5H6.2529V4.5H16.2529V3.5ZM6.2529,21.5V20.5H16.2529V21.5H6.2529ZM12.6553,9.4049C12.6553,8.8526 13.103,8.4049 13.6553,8.4049H20.5254C21.0776,8.4049 21.5254,8.8526 21.5254,9.4049V14.6055C21.5254,15.1578 21.0776,15.6055 20.5254,15.6055H14.355L12.6553,17.0871V9.4049Z"
android:fillColor="#3C4043"
diff --git a/packages/CompanionDeviceManager/res/drawable/ic_notifications.xml b/packages/CompanionDeviceManager/res/drawable/ic_notifications.xml
index e5825bcbf70c..7b1ef85ae5fd 100644
--- a/packages/CompanionDeviceManager/res/drawable/ic_notifications.xml
+++ b/packages/CompanionDeviceManager/res/drawable/ic_notifications.xml
@@ -20,7 +20,7 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
- android:tint="?attr/colorControlNormal">
+ android:tint="@android:color/system_accent1_600">
<path android:fillColor="@android:color/white"
android:pathData="M4,19V17H6V10Q6,7.925 7.25,6.312Q8.5,4.7 10.5,4.2V3.5Q10.5,2.875 10.938,2.438Q11.375,2 12,2Q12.625,2 13.062,2.438Q13.5,2.875 13.5,3.5V4.2Q15.5,4.7 16.75,6.312Q18,7.925 18,10V17H20V19ZM12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5Q12,11.5 12,11.5ZM12,22Q11.175,22 10.588,21.413Q10,20.825 10,20H14Q14,20.825 13.413,21.413Q12.825,22 12,22ZM8,17H16V10Q16,8.35 14.825,7.175Q13.65,6 12,6Q10.35,6 9.175,7.175Q8,8.35 8,10Z"/>
</vector> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable/ic_storage.xml b/packages/CompanionDeviceManager/res/drawable/ic_storage.xml
index 406a3b5dada5..3e033d372e72 100644
--- a/packages/CompanionDeviceManager/res/drawable/ic_storage.xml
+++ b/packages/CompanionDeviceManager/res/drawable/ic_storage.xml
@@ -20,7 +20,7 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
- android:tint="?attr/colorControlNormal">
+ android:tint="@android:color/system_accent1_600">
<path android:fillColor="@android:color/white"
android:pathData="M6,17H18L14.25,12L11.25,16L9,13ZM5,21Q4.175,21 3.587,20.413Q3,19.825 3,19V5Q3,4.175 3.587,3.587Q4.175,3 5,3H19Q19.825,3 20.413,3.587Q21,4.175 21,5V19Q21,19.825 20.413,20.413Q19.825,21 19,21ZM5,19H19Q19,19 19,19Q19,19 19,19V5Q19,5 19,5Q19,5 19,5H5Q5,5 5,5Q5,5 5,5V19Q5,19 5,19Q5,19 5,19ZM5,5Q5,5 5,5Q5,5 5,5V19Q5,19 5,19Q5,19 5,19Q5,19 5,19Q5,19 5,19V5Q5,5 5,5Q5,5 5,5Z"/>
</vector> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/layout/activity_confirmation.xml b/packages/CompanionDeviceManager/res/layout/activity_confirmation.xml
index c0e6c09d69ed..520ade892f51 100644
--- a/packages/CompanionDeviceManager/res/layout/activity_confirmation.xml
+++ b/packages/CompanionDeviceManager/res/layout/activity_confirmation.xml
@@ -12,135 +12,142 @@
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:id="@+id/activity_confirmation"
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:minWidth="340dp">
+ android:layout_height="match_parent"
+ style="@style/ScrollViewStyle">
- <LinearLayout android:id="@+id/association_confirmation"
- style="@style/ContainerLayout">
+ <LinearLayout
+ android:id="@+id/activity_confirmation"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:baselineAligned="false">
- <!-- A header for selfManaged devices only. -->
- <include layout="@layout/vendor_header" />
+ <LinearLayout android:id="@+id/association_confirmation"
+ style="@style/ContainerLayout">
- <!-- Do NOT change the ID of the root LinearLayout above: it's referenced in CTS tests. -->
+ <!-- A header for selfManaged devices only. -->
+ <include layout="@layout/vendor_header" />
- <ImageView
- android:id="@+id/profile_icon"
- android:layout_width="match_parent"
- android:layout_height="32dp"
- android:gravity="center"
- android:layout_marginTop="18dp"
- android:tint="@android:color/system_accent1_600"/>
+ <!-- Do NOT change the ID of the root LinearLayout above:
+ it's referenced in CTS tests. -->
- <LinearLayout style="@style/Description">
- <TextView
- android:id="@+id/title"
- style="@style/DescriptionTitle" />
+ <ImageView
+ android:id="@+id/profile_icon"
+ android:layout_width="match_parent"
+ android:layout_height="32dp"
+ android:gravity="center"
+ android:layout_marginTop="18dp"
+ android:tint="@android:color/system_accent1_600"/>
- <TextView
- android:id="@+id/summary"
- style="@style/DescriptionSummary" />
+ <LinearLayout style="@style/Description">
+ <TextView
+ android:id="@+id/title"
+ style="@style/DescriptionTitle" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/summary"
+ style="@style/DescriptionSummary" />
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1">
+ </LinearLayout>
- <LinearLayout
- android:id="@+id/multiple_device_list"
+ <RelativeLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="12dp"
- android:orientation="vertical"
- android:visibility="gone">
+ android:layout_height="0dp"
+ android:layout_weight="1">
+
+ <LinearLayout
+ android:id="@+id/multiple_device_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="12dp"
+ android:orientation="vertical"
+ android:visibility="gone">
+
+ <View
+ android:id="@+id/border_top"
+ style="@style/DeviceListBorder" />
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/device_list"
+ android:layout_width="match_parent"
+ android:scrollbars="vertical"
+ android:layout_marginBottom="12dp"
+ android:layout_height="200dp" />
- <View
- android:id="@+id/border_top"
- style="@style/DeviceListBorder" />
+ <View
+ android:id="@+id/border_bottom"
+ style="@style/DeviceListBorder" />
+
+ </LinearLayout>
<androidx.recyclerview.widget.RecyclerView
- android:id="@+id/device_list"
+ android:id="@+id/permission_list"
android:layout_width="match_parent"
- android:scrollbars="vertical"
- android:layout_marginBottom="12dp"
- android:layout_height="200dp" />
+ android:layout_height="wrap_content" />
- <View
- android:id="@+id/border_bottom"
- style="@style/DeviceListBorder" />
+ <ProgressBar
+ android:id="@+id/spinner_multiple_device"
+ android:visibility="gone"
+ style="@style/Spinner" />
- </LinearLayout>
+ </RelativeLayout>
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/permission_list"
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content" />
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="vertical"
+ android:layout_marginTop="16dp">
- <ProgressBar
- android:id="@+id/spinner_multiple_device"
- android:visibility="gone"
- style="@style/Spinner" />
+ <!-- Do NOT change the IDs of the buttons: they are referenced in CTS tests. -->
- </RelativeLayout>
+ <Button
+ android:id="@+id/btn_positive"
+ style="@style/PositiveButton"
+ android:text="@string/consent_yes" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="vertical"
- android:layout_marginTop="16dp">
+ <Button
+ android:id="@+id/btn_negative"
+ android:layout_marginBottom="12dp"
+ style="@style/NegativeButton"
+ android:text="@string/consent_no" />
- <!-- Do NOT change the IDs of the buttons: they are referenced in CTS tests. -->
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="bottom|end"
+ android:orientation="vertical"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="16dp">
- <Button
- android:id="@+id/btn_positive"
- style="@style/PositiveButton"
- android:text="@string/consent_yes" />
+ <!-- Do NOT change the IDs of the buttons: they are referenced in CTS tests. -->
- <Button
- android:id="@+id/btn_negative"
- android:layout_marginBottom="12dp"
- style="@style/NegativeButton"
- android:text="@string/consent_no" />
+ <Button
+ android:id="@+id/btn_negative_multiple_devices"
+ style="@style/NegativeButtonMultipleDevices"
+ android:textColor="?android:textColorPrimary"
+ android:visibility="gone"
+ android:text="@string/consent_no" />
+ </LinearLayout>
</LinearLayout>
- <LinearLayout
+ <RelativeLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="bottom|right"
- android:orientation="vertical"
- android:layout_marginRight="16dp"
- android:layout_marginBottom="16dp">
-
- <!-- Do NOT change the IDs of the buttons: they are referenced in CTS tests. -->
+ android:layout_height="match_parent"
+ android:layout_weight="1">
- <Button
- android:id="@+id/btn_negative_multiple_devices"
- style="@style/NegativeButtonMultipleDevices"
- android:textColor="?android:textColorPrimary"
+ <ProgressBar
+ android:id="@+id/spinner_single_device"
android:visibility="gone"
- android:text="@string/consent_no" />
- </LinearLayout>
+ style="@style/Spinner" />
+ </RelativeLayout>>
</LinearLayout>
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1">
-
- <ProgressBar
- android:id="@+id/spinner_single_device"
- android:visibility="gone"
- style="@style/Spinner" />
- </RelativeLayout>>
-
-</LinearLayout> \ No newline at end of file
+</ScrollView> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/layout/helper_confirmation.xml b/packages/CompanionDeviceManager/res/layout/helper_confirmation.xml
index a9ace44d49b8..d0d46f715846 100644
--- a/packages/CompanionDeviceManager/res/layout/helper_confirmation.xml
+++ b/packages/CompanionDeviceManager/res/layout/helper_confirmation.xml
@@ -15,54 +15,67 @@
~ limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/helper_confirmation"
- android:theme="@style/ChooserActivity"
- android:padding="12dp"
- style="@style/ContainerLayout">
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ style="@style/ScrollViewStyle">
- <ImageView
- android:id="@+id/app_icon"
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="32dp"
- android:gravity="center"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="12dp"/>
+ android:layout_height="wrap_content">
- <TextView
- android:id="@+id/helper_title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:paddingHorizontal="12dp"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="22sp" />
+ <LinearLayout
+ android:id="@+id/helper_confirmation"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:theme="@style/ChooserActivity"
+ android:padding="12dp"
+ style="@style/ContainerLayout">
- <TextView
- android:id="@+id/helper_summary"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="24dp"
- android:layout_marginRight="24dp"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="24dp"
- android:gravity="center"
- android:textColor="?android:attr/textColorSecondary"
- android:textSize="14sp" />
+ <ImageView
+ android:id="@+id/app_icon"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:gravity="center"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="12dp"/>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginRight="12dp"
- android:layout_marginBottom="12dp"
- android:gravity="end">
+ <TextView
+ android:id="@+id/helper_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="22sp" />
+
+ <TextView
+ android:id="@+id/helper_summary"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="24dp"
+ android:layout_marginEnd="24dp"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="32dp"
+ android:gravity="center"
+ android:textColor="?android:attr/textColorSecondary"
+ android:textSize="14sp" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginEnd="12dp"
+ android:gravity="end">
+
+ <Button
+ android:id="@+id/btn_back"
+ style="@style/VendorHelperBackButton"
+ android:text="@string/consent_back" />
+
+ </LinearLayout>
- <Button
- android:id="@+id/btn_back"
- style="@style/VendorHelperBackButton"
- android:text="@string/consent_back" />
+ </LinearLayout>
</LinearLayout>
-</LinearLayout> \ No newline at end of file
+</ScrollView> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/layout/list_item_device.xml b/packages/CompanionDeviceManager/res/layout/list_item_device.xml
index eeb988f364b2..0a5afe4363ac 100644
--- a/packages/CompanionDeviceManager/res/layout/list_item_device.xml
+++ b/packages/CompanionDeviceManager/res/layout/list_item_device.xml
@@ -28,14 +28,15 @@
android:id="@android:id/icon"
android:layout_width="24dp"
android:layout_height="24dp"
- android:layout_marginLeft="24dp"
- android:layout_marginRight="12dp"
+ android:layout_marginStart="24dp"
android:tint="@android:color/system_accent1_600"/>
<TextView
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingStart="24dp"
+ android:paddingEnd="24dp"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItemSmall"/>
diff --git a/packages/CompanionDeviceManager/res/layout/list_item_permission.xml b/packages/CompanionDeviceManager/res/layout/list_item_permission.xml
index 3dce38d0dc20..54916a24b7df 100644
--- a/packages/CompanionDeviceManager/res/layout/list_item_permission.xml
+++ b/packages/CompanionDeviceManager/res/layout/list_item_permission.xml
@@ -20,8 +20,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:paddingLeft="32dp"
- android:paddingRight="32dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:paddingBottom="14dp">
<ImageView
@@ -30,7 +30,6 @@
android:layout_height="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="12dp"
- android:tint="@android:color/system_accent1_600"
android:contentDescription="Permission Icon"/>
<LinearLayout
@@ -51,7 +50,6 @@
android:id="@+id/permission_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingRight="24dp"
android:textSize="14sp"
android:textColor="?android:attr/textColorSecondary"/>
diff --git a/packages/CompanionDeviceManager/res/layout/vendor_header.xml b/packages/CompanionDeviceManager/res/layout/vendor_header.xml
index c35f59e7e8a0..14e74312dd2c 100644
--- a/packages/CompanionDeviceManager/res/layout/vendor_header.xml
+++ b/packages/CompanionDeviceManager/res/layout/vendor_header.xml
@@ -24,28 +24,32 @@
android:layout_gravity="center"
android:paddingTop="24dp"
android:paddingBottom="4dp"
- android:paddingLeft="24dp"
- android:paddingRight="24dp"
+ android:paddingStart="24dp"
+ android:paddingEnd="24dp"
android:visibility="gone" >
<ImageView
android:id="@+id/vendor_header_image"
- android:layout_width="31dp"
- android:layout_height="32dp" />
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:contentDescription="@string/vendor_icon_description" />
<TextView
android:id="@+id/vendor_header_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="20dp"
- android:layout_marginTop="5dp"
- android:layout_toRightOf="@+id/header_image" />
+ android:layout_marginStart="12dp"
+ android:layout_marginTop="12dp"
+ android:textSize="16sp"
+ android:layout_toEndOf="@+id/vendor_header_image"
+ android:textColor="?android:attr/textColorSecondary"/>
<ImageButton
android:id="@+id/vendor_header_button"
android:background="@drawable/ic_info"
- android:layout_width="31dp"
- android:layout_height="32dp"
- android:layout_alignParentRight="true" />
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:contentDescription="@string/vendor_header_button_description"
+ android:layout_alignParentEnd="true" />
</RelativeLayout> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/values/strings.xml b/packages/CompanionDeviceManager/res/values/strings.xml
index 586a0223b460..3d6bf152f93f 100644
--- a/packages/CompanionDeviceManager/res/values/strings.xml
+++ b/packages/CompanionDeviceManager/res/values/strings.xml
@@ -116,4 +116,10 @@
apps installed on your watch during setup will use the same permissions as your phone.\n\n
These permissions may include access to your watch\u2019s microphone and location.</string>
+ <!--Description for vendor icon [CHAR LIMIT=30]-->
+ <string name="vendor_icon_description">App Icon</string>
+
+ <!--Description for information icon [CHAR LIMIT=30]-->
+ <string name="vendor_header_button_description">More Information Button</string>
+
</resources>
diff --git a/packages/CompanionDeviceManager/res/values/styles.xml b/packages/CompanionDeviceManager/res/values/styles.xml
index c38323f5f73c..428f2dc2eb35 100644
--- a/packages/CompanionDeviceManager/res/values/styles.xml
+++ b/packages/CompanionDeviceManager/res/values/styles.xml
@@ -59,9 +59,8 @@
<style name="VendorHelperBackButton"
parent="@android:style/Widget.Material.Button.Borderless.Colored">
- <item name="android:layout_width">60dp</item>
- <item name="android:layout_height">36dp</item>
- <item name="android:layout_marginTop">20dp</item>
+ <item name="android:layout_width">70dp</item>
+ <item name="android:layout_height">48dp</item>
<item name="android:textAllCaps">false</item>
<item name="android:textColor">@android:color/system_neutral1_900</item>
<item name="android:background">@drawable/helper_back_button</item>
@@ -71,8 +70,6 @@
parent="@android:style/Widget.Material.Button.Borderless.Colored">
<item name="android:layout_width">300dp</item>
<item name="android:layout_height">56dp</item>
- <item name="android:layout_marginLeft">24dp</item>
- <item name="android:layout_marginRight">24dp</item>
<item name="android:layout_marginBottom">2dp</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">14sp</item>
@@ -84,8 +81,6 @@
parent="@android:style/Widget.Material.Button.Borderless.Colored">
<item name="android:layout_width">300dp</item>
<item name="android:layout_height">56dp</item>
- <item name="android:layout_marginLeft">24dp</item>
- <item name="android:layout_marginRight">24dp</item>
<item name="android:layout_marginTop">2dp</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">14sp</item>
@@ -115,4 +110,10 @@
<item name="android:indeterminate">true</item>
<item name="android:layout_centerInParent">true</item>
</style>
+
+ <style name="ScrollViewStyle">
+ <item name="android:scrollbars">none</item>
+ <item name="android:fillViewport">true</item>
+ <item name="android:clipChildren">false</item>
+ </style>
</resources> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/values/themes.xml b/packages/CompanionDeviceManager/res/values/themes.xml
index e3fc67c50d75..1ea3968a5984 100644
--- a/packages/CompanionDeviceManager/res/values/themes.xml
+++ b/packages/CompanionDeviceManager/res/values/themes.xml
@@ -18,8 +18,8 @@
<style name="ChooserActivity"
parent="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar">
- <item name="*android:windowFixedHeightMajor">100%</item>
- <item name="*android:windowFixedHeightMinor">100%</item>
+ <item name="android:windowContentOverlay">@null</item>
+ <item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
index 37cbf3017f0b..05a143e7e38a 100644
--- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
@@ -51,6 +51,7 @@ import android.companion.CompanionDeviceManager;
import android.companion.IAssociationRequestCallback;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.net.MacAddress;
import android.os.Bundle;
@@ -411,17 +412,19 @@ public class CompanionDeviceActivity extends FragmentActivity implements
final Drawable vendorIcon;
final CharSequence vendorName;
final Spanned title;
+ int nightModeFlags = getResources().getConfiguration().uiMode
+ & Configuration.UI_MODE_NIGHT_MASK;
mPermissionTypes = new ArrayList<>();
try {
vendorIcon = getVendorHeaderIcon(this, packageName, userId);
vendorName = getVendorHeaderName(this, packageName, userId);
-
mVendorHeaderImage.setImageDrawable(vendorIcon);
if (hasVendorIcon(this, packageName, userId)) {
- mVendorHeaderImage.setColorFilter(getResources().getColor(
- android.R.color.system_accent1_600, /* Theme= */null));
+ int color = nightModeFlags == Configuration.UI_MODE_NIGHT_YES
+ ? android.R.color.system_accent1_200 : android.R.color.system_accent1_600;
+ mVendorHeaderImage.setColorFilter(getResources().getColor(color, /* Theme= */null));
}
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Package u" + userId + "/" + packageName + " not found.");