Merge changes from topics "presubmit-am-1a8adc3a42824e489007f2ef846a0f71", "presubmit-am-71bbe918d83d491e8ccb96c26458149c", "presubmit-am-e80e22a9aeb8442eb3b3332c3b2ea804" into tm-dev
* changes: CDM UI cleanUp Introduce a progessBar for multiple devices Make the Allow button at the top
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
@@ -17,6 +18,6 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@android:color/system_accent1_100"/>
|
<solid android:color="@android:color/system_accent1_100"/>
|
||||||
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp"
|
<corners android:topLeftRadius="4dp" android:topRightRadius="4dp"
|
||||||
android:bottomLeftRadius="4dp" android:bottomRightRadius="4dp"/>
|
android:bottomLeftRadius="12dp" android:bottomRightRadius="12dp"/>
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
@@ -17,6 +18,6 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@android:color/system_accent1_100"/>
|
<solid android:color="@android:color/system_accent1_100"/>
|
||||||
<corners android:topLeftRadius="4dp" android:topRightRadius="4dp"
|
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp"
|
||||||
android:bottomLeftRadius="12dp" android:bottomRightRadius="12dp"/>
|
android:bottomLeftRadius="4dp" android:bottomRightRadius="4dp"/>
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Copyright (C) 2021 The Android Open Source Project
|
<!-- Copyright (C) 2021 The Android Open Source Project
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
@@ -20,35 +19,26 @@
|
|||||||
<!-- A header for selfManaged devices only. -->
|
<!-- A header for selfManaged devices only. -->
|
||||||
<include layout="@layout/vendor_header" />
|
<include layout="@layout/vendor_header" />
|
||||||
|
|
||||||
|
<!-- Do NOT change the ID of the root LinearLayout above: it's referenced in CTS tests. -->
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/profile_icon"
|
android:id="@+id/profile_icon"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginTop="18dp"
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:tint="@android:color/system_accent1_600"/>
|
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" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/summary"
|
||||||
android:layout_width="match_parent"
|
style="@style/DescriptionSummary" />
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingHorizontal="12dp"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
style="@*android:style/TextAppearance.Widget.Toolbar.Title" />
|
|
||||||
|
|
||||||
<TextView
|
</LinearLayout>
|
||||||
android:id="@+id/summary"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -59,18 +49,20 @@
|
|||||||
android:id="@+id/multiple_device_list"
|
android:id="@+id/multiple_device_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/border_top"
|
android:id="@+id/border_top"
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
style="@style/DeviceListBorder" />
|
style="@style/DeviceListBorder" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/device_list"
|
android:id="@+id/device_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:layout_height="200dp" />
|
android:layout_height="200dp" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
@@ -84,35 +76,56 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/spinner"
|
||||||
|
android:layout_width="56dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:tint="@android:color/system_accent1_600"
|
||||||
|
android:visibility="gone"
|
||||||
|
style="?android:attr/progressBarStyleLarge" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="24dp">
|
android:layout_marginTop="16dp">
|
||||||
|
|
||||||
<!-- Do NOT change the IDs of the buttons: they are referenced in CTS tests. -->
|
<!-- Do NOT change the IDs of the buttons: they are referenced in CTS tests. -->
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_negative"
|
|
||||||
style="@style/NegativeButton"
|
|
||||||
android:text="@string/consent_no" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_positive"
|
android:id="@+id/btn_positive"
|
||||||
style="@style/PositiveButton"
|
style="@style/PositiveButton"
|
||||||
android:text="@string/consent_yes" />
|
android:text="@string/consent_yes" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_negative_multiple_devices"
|
android:id="@+id/btn_negative"
|
||||||
android:layout_marginLeft="170dp"
|
android:layout_marginBottom="12dp"
|
||||||
android:layout_marginBottom="10dp"
|
style="@style/NegativeButton"
|
||||||
style="@style/NegativeButtonMultipleDevices"
|
|
||||||
android:textColor = "?android:textColorPrimary"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/consent_no" />
|
android:text="@string/consent_no" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
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. -->
|
||||||
|
|
||||||
|
<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>
|
||||||
@@ -15,54 +15,42 @@
|
|||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/activity_confirmation"
|
android:id="@+id/data_transfer_confirmation"
|
||||||
android:layout_width="match_parent"
|
style="@style/ContainerLayout">
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/dialog_background"
|
|
||||||
android:elevation="16dp"
|
|
||||||
android:maxHeight="400dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="18dp"
|
|
||||||
android:layout_gravity="center">
|
|
||||||
|
|
||||||
<!-- Do NOT change the ID of the root LinearLayout above: it's referenced in CTS tests. -->
|
<!-- Do NOT change the ID of the root LinearLayout above: it's referenced in CTS tests. -->
|
||||||
|
|
||||||
<TextView
|
<LinearLayout style="@style/Description">
|
||||||
android:id="@+id/title"
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/title"
|
||||||
android:layout_height="wrap_content"
|
style="@style/DescriptionTitle" />
|
||||||
android:gravity="center"
|
|
||||||
android:paddingHorizontal="12dp"
|
|
||||||
style="@*android:style/TextAppearance.Widget.Toolbar.Title"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/summary"
|
android:id="@+id/summary"
|
||||||
android:layout_width="match_parent"
|
style="@style/DescriptionSummary" />
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="12dp"
|
</LinearLayout>
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="24dp">
|
android:layout_marginTop="16dp">
|
||||||
|
|
||||||
<!-- Do NOT change the IDs of the buttons: they are referenced in CTS tests. -->
|
<!-- Do NOT change the IDs of the buttons: they are referenced in CTS tests. -->
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_negative"
|
|
||||||
style="@style/NegativeButton"
|
|
||||||
android:text="@string/consent_no" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_positive"
|
android:id="@+id/btn_positive"
|
||||||
style="@style/PositiveButton"
|
style="@style/PositiveButton"
|
||||||
android:text="@string/consent_yes" />
|
android:text="@string/consent_yes" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_negative"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
style="@style/NegativeButton"
|
||||||
|
android:text="@string/consent_no" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/helper_confirmation"
|
android:id="@+id/helper_confirmation"
|
||||||
android:theme="@style/ChooserActivity"
|
android:theme="@style/ChooserActivity"
|
||||||
|
android:padding="12dp"
|
||||||
style="@style/ContainerLayout">
|
style="@style/ContainerLayout">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -24,8 +26,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginTop="1dp"/>
|
android:layout_marginBottom="12dp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/helper_title"
|
android:id="@+id/helper_title"
|
||||||
@@ -33,17 +35,18 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingHorizontal="12dp"
|
android:paddingHorizontal="12dp"
|
||||||
style="@*android:style/TextAppearance.Widget.Toolbar.Title"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
android:textSize="20sp" />
|
android:textSize="22sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/helper_summary"
|
android:id="@+id/helper_summary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="24dp"
|
||||||
|
android:layout_marginRight="24dp"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginLeft="20dp"
|
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:gravity="start"
|
android:gravity="center"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
@@ -51,6 +54,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginRight="12dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:gravity="end">
|
android:gravity="end">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
android:id="@android:id/icon"
|
android:id="@android:id/icon"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginLeft="24dp"
|
||||||
android:layout_marginRight="12dp"
|
android:layout_marginRight="12dp"
|
||||||
android:tint="@android:color/system_accent1_600"/>
|
android:tint="@android:color/system_accent1_600"/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
@@ -19,13 +20,15 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="5dp">
|
android:paddingLeft="32dp"
|
||||||
|
android:paddingRight="32dp"
|
||||||
|
android:paddingBottom="14dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/permission_icon"
|
android:id="@+id/permission_icon"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:layout_marginTop="7dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:tint="@android:color/system_accent1_600"
|
android:tint="@android:color/system_accent1_600"
|
||||||
android:contentDescription="Permission Icon"/>
|
android:contentDescription="Permission Icon"/>
|
||||||
@@ -48,6 +51,7 @@
|
|||||||
android:id="@+id/permission_summary"
|
android:id="@+id/permission_summary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingRight="24dp"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="?android:attr/textColorSecondary"/>
|
android:textColor="?android:attr/textColorSecondary"/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
@@ -21,7 +22,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginBottom="16dp"
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:paddingLeft="24dp"
|
||||||
|
android:paddingRight="24dp"
|
||||||
android:visibility="gone" >
|
android:visibility="gone" >
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -42,7 +46,6 @@
|
|||||||
style="?android:attr/actionOverflowButtonStyle"
|
style="?android:attr/actionOverflowButtonStyle"
|
||||||
android:layout_width="31dp"
|
android:layout_width="31dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_marginLeft="100dp"
|
|
||||||
android:layout_alignParentRight="true" />
|
android:layout_alignParentRight="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
~
|
~
|
||||||
@@ -16,51 +17,86 @@
|
|||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<style name="ContainerLayout">
|
<style name="ContainerLayout">
|
||||||
<item name="android:padding">18dp</item>
|
|
||||||
<item name="android:elevation">16dp</item>
|
|
||||||
<item name="android:maxHeight">400dp</item>
|
|
||||||
<item name="android:orientation">vertical</item>
|
|
||||||
<item name="android:layout_gravity">center</item>
|
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:orientation">vertical</item>
|
||||||
|
<item name="android:layout_gravity">center</item>
|
||||||
|
<item name="android:minWidth">340dp</item>
|
||||||
<item name="android:background">@drawable/dialog_background</item>
|
<item name="android:background">@drawable/dialog_background</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Description">
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:orientation">vertical</item>
|
||||||
|
<item name="android:layout_marginTop">18dp</item>
|
||||||
|
<item name="android:layout_marginBottom">18dp</item>
|
||||||
|
<item name="android:layout_marginLeft">24dp</item>
|
||||||
|
<item name="android:layout_marginRight">24dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="DescriptionTitle"
|
||||||
|
parent="@*android:style/TextAppearance.Widget.Toolbar.Title">
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:gravity">center</item>
|
||||||
|
<item name="android:layout_marginLeft">14dp</item>
|
||||||
|
<item name="android:layout_marginRight">14dp</item>
|
||||||
|
<item name="android:textSize">20sp</item>
|
||||||
|
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="DescriptionSummary">
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:gravity">center</item>
|
||||||
|
<item name="android:layout_marginTop">18dp</item>
|
||||||
|
<item name="android:layout_marginLeft">18dp</item>
|
||||||
|
<item name="android:layout_marginRight">18dp</item>
|
||||||
|
<item name="android:textSize">14sp</item>
|
||||||
|
<item name="android:textColor">?android:attr/textColorSecondary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="VendorHelperOkButton"
|
<style name="VendorHelperOkButton"
|
||||||
parent="@android:style/Widget.Material.Button.Borderless.Colored">
|
parent="@android:style/Widget.Material.Button.Borderless.Colored">
|
||||||
<item name="android:layout_width">50dp</item>
|
<item name="android:layout_width">50dp</item>
|
||||||
<item name="android:layout_height">35dp</item>
|
<item name="android:layout_height">36dp</item>
|
||||||
<item name="android:layout_marginTop">20dp</item>
|
<item name="android:layout_marginTop">20dp</item>
|
||||||
<item name="android:textColor">@android:color/system_neutral1_900</item>
|
<item name="android:textColor">@android:color/system_neutral1_900</item>
|
||||||
<item name="android:background">@drawable/helper_ok_button</item>
|
<item name="android:background">@drawable/helper_ok_button</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="NegativeButton"
|
<style name="PositiveButton"
|
||||||
parent="@android:style/Widget.Material.Button.Borderless.Colored">
|
parent="@android:style/Widget.Material.Button.Borderless.Colored">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">300dp</item>
|
||||||
<item name="android:layout_height">wrap_content</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:textAllCaps">false</item>
|
||||||
<item name="android:textSize">14sp</item>
|
<item name="android:textSize">14sp</item>
|
||||||
<item name="android:textColor">@android:color/system_neutral1_900</item>
|
<item name="android:textColor">@android:color/system_neutral1_900</item>
|
||||||
<item name="android:background">@drawable/btn_negative_top</item>
|
<item name="android:background">@drawable/btn_positive_bottom</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="PositiveButton"
|
<style name="NegativeButton"
|
||||||
parent="@android:style/Widget.Material.Button.Borderless.Colored">
|
parent="@android:style/Widget.Material.Button.Borderless.Colored">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">300dp</item>
|
||||||
<item name="android:layout_height">wrap_content</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:textAllCaps">false</item>
|
||||||
<item name="android:textSize">14sp</item>
|
<item name="android:textSize">14sp</item>
|
||||||
<item name="android:textColor">@android:color/system_neutral1_900</item>
|
<item name="android:textColor">@android:color/system_neutral1_900</item>
|
||||||
<item name="android:layout_marginTop">4dp</item>
|
<item name="android:layout_marginTop">4dp</item>
|
||||||
<item name="android:background">@drawable/btn_positive_bottom</item>
|
<item name="android:background">@drawable/btn_negative_top</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="NegativeButtonMultipleDevices"
|
<style name="NegativeButtonMultipleDevices"
|
||||||
parent="@android:style/Widget.Material.Button.Colored">
|
parent="@android:style/Widget.Material.Button.Colored">
|
||||||
<item name="android:layout_width">100dp</item>
|
<item name="android:layout_width">100dp</item>
|
||||||
<item name="android:layout_height">35dp</item>
|
<item name="android:layout_height">36dp</item>
|
||||||
<item name="android:layout_marginTop">20dp</item>
|
|
||||||
<item name="android:textAllCaps">false</item>
|
<item name="android:textAllCaps">false</item>
|
||||||
<item name="android:background">@drawable/btn_negative_multiple_devices</item>
|
<item name="android:background">@drawable/btn_negative_multiple_devices</item>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ import android.widget.Button;
|
|||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -116,14 +117,14 @@ public class CompanionDeviceActivity extends FragmentActivity implements
|
|||||||
private ImageButton mVendorHeaderButton;
|
private ImageButton mVendorHeaderButton;
|
||||||
|
|
||||||
// Progress indicator is only shown while we are looking for the first suitable device for a
|
// Progress indicator is only shown while we are looking for the first suitable device for a
|
||||||
// "regular" (ie. not self-managed) association.
|
// multiple device association.
|
||||||
private View mProgressIndicator;
|
private ProgressBar mProgressIndicator;
|
||||||
|
|
||||||
// Present for self-managed association requests and "single-device" regular association
|
// Present for self-managed association requests and "single-device" regular association
|
||||||
// regular.
|
// regular.
|
||||||
private Button mButtonAllow;
|
private Button mButtonAllow;
|
||||||
private Button mButtonNotAllow;
|
private Button mButtonNotAllow;
|
||||||
// Present for multiple device association requests only.
|
// Present for multiple devices' association requests only.
|
||||||
private Button mButtonNotAllowMultipleDevices;
|
private Button mButtonNotAllowMultipleDevices;
|
||||||
|
|
||||||
private LinearLayout mAssociationConfirmationDialog;
|
private LinearLayout mAssociationConfirmationDialog;
|
||||||
@@ -263,6 +264,8 @@ public class CompanionDeviceActivity extends FragmentActivity implements
|
|||||||
mVendorHeaderButton = findViewById(R.id.vendor_header_button);
|
mVendorHeaderButton = findViewById(R.id.vendor_header_button);
|
||||||
|
|
||||||
mDeviceListRecyclerView = findViewById(R.id.device_list);
|
mDeviceListRecyclerView = findViewById(R.id.device_list);
|
||||||
|
|
||||||
|
mProgressIndicator = findViewById(R.id.spinner);
|
||||||
mDeviceAdapter = new DeviceListAdapter(this, this::onListItemClick);
|
mDeviceAdapter = new DeviceListAdapter(this, this::onListItemClick);
|
||||||
|
|
||||||
mPermissionListRecyclerView = findViewById(R.id.permission_list);
|
mPermissionListRecyclerView = findViewById(R.id.permission_list);
|
||||||
@@ -502,21 +505,25 @@ public class CompanionDeviceActivity extends FragmentActivity implements
|
|||||||
mSummary.setText(summary);
|
mSummary.setText(summary);
|
||||||
mProfileIcon.setImageDrawable(profileIcon);
|
mProfileIcon.setImageDrawable(profileIcon);
|
||||||
|
|
||||||
mDeviceAdapter = new DeviceListAdapter(this, this::onListItemClick);
|
|
||||||
|
|
||||||
// TODO: hide the list and show a spinner until a first device matching device is found.
|
|
||||||
mDeviceListRecyclerView.setAdapter(mDeviceAdapter);
|
mDeviceListRecyclerView.setAdapter(mDeviceAdapter);
|
||||||
mDeviceListRecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
mDeviceListRecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
CompanionDeviceDiscoveryService.getScanResult().observe(
|
CompanionDeviceDiscoveryService.getScanResult().observe(this,
|
||||||
/* lifecycleOwner */ this,
|
deviceFilterPairs -> {
|
||||||
/* observer */ mDeviceAdapter);
|
// Dismiss the progress bar once there's one device found for multiple devices.
|
||||||
|
if (deviceFilterPairs.size() >= 1) {
|
||||||
|
mProgressIndicator.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
mDeviceAdapter.setDevices(deviceFilterPairs);
|
||||||
|
});
|
||||||
|
|
||||||
// "Remove" consent button: users would need to click on the list item.
|
// "Remove" consent button: users would need to click on the list item.
|
||||||
mButtonAllow.setVisibility(View.GONE);
|
mButtonAllow.setVisibility(View.GONE);
|
||||||
mButtonNotAllow.setVisibility(View.GONE);
|
mButtonNotAllow.setVisibility(View.GONE);
|
||||||
mButtonNotAllowMultipleDevices.setVisibility(View.VISIBLE);
|
mButtonNotAllowMultipleDevices.setVisibility(View.VISIBLE);
|
||||||
mMultipleDeviceList.setVisibility(View.VISIBLE);
|
mMultipleDeviceList.setVisibility(View.VISIBLE);
|
||||||
|
mProgressIndicator.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onListItemClick(int position) {
|
private void onListItemClick(int position) {
|
||||||
@@ -564,7 +571,7 @@ public class CompanionDeviceActivity extends FragmentActivity implements
|
|||||||
CompanionVendorHelperDialogFragment.newInstance(mRequest.getPackageName(),
|
CompanionVendorHelperDialogFragment.newInstance(mRequest.getPackageName(),
|
||||||
mRequest.getUserId(), mRequest.getDeviceProfile());
|
mRequest.getUserId(), mRequest.getDeviceProfile());
|
||||||
|
|
||||||
mAssociationConfirmationDialog.setVisibility(View.GONE);
|
mAssociationConfirmationDialog.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
fragmentDialog.show(fragmentManager, /* Tag */ FRAGMENT_DIALOG_TAG);
|
fragmentDialog.show(fragmentManager, /* Tag */ FRAGMENT_DIALOG_TAG);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ public class CompanionDeviceDiscoveryService extends Service {
|
|||||||
mBtAdapter = mBtManager.getAdapter();
|
mBtAdapter = mBtManager.getAdapter();
|
||||||
mBleScanner = mBtAdapter.getBluetoothLeScanner();
|
mBleScanner = mBtAdapter.getBluetoothLeScanner();
|
||||||
mWifiManager = getSystemService(WifiManager.class);
|
mWifiManager = getSystemService(WifiManager.class);
|
||||||
|
|
||||||
|
sScanResultsLiveData.setValue(Collections.emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -186,7 +188,6 @@ public class CompanionDeviceDiscoveryService extends Service {
|
|||||||
mStopAfterFirstMatch = request.isSingleDevice();
|
mStopAfterFirstMatch = request.isSingleDevice();
|
||||||
mDiscoveryStarted = true;
|
mDiscoveryStarted = true;
|
||||||
sStateLiveData.setValue(DiscoveryState.DISCOVERY_IN_PROGRESS);
|
sStateLiveData.setValue(DiscoveryState.DISCOVERY_IN_PROGRESS);
|
||||||
sScanResultsLiveData.setValue(Collections.emptyList());
|
|
||||||
|
|
||||||
final List<DeviceFilter<?>> allFilters = request.getDeviceFilters();
|
final List<DeviceFilter<?>> allFilters = request.getDeviceFilters();
|
||||||
final List<BluetoothDeviceFilter> btFilters =
|
final List<BluetoothDeviceFilter> btFilters =
|
||||||
|
|||||||
@@ -25,15 +25,13 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.lifecycle.Observer;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
/**
|
/**
|
||||||
* Adapter for the list of "found" devices.
|
* Adapter for the list of "found" devices.
|
||||||
*/
|
*/
|
||||||
class DeviceListAdapter extends RecyclerView.Adapter<DeviceListAdapter.ViewHolder> implements
|
class DeviceListAdapter extends RecyclerView.Adapter<DeviceListAdapter.ViewHolder> {
|
||||||
Observer<List<DeviceFilterPair<?>>> {
|
|
||||||
public int mSelectedPosition = RecyclerView.NO_POSITION;
|
public int mSelectedPosition = RecyclerView.NO_POSITION;
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
@@ -96,9 +94,8 @@ class DeviceListAdapter extends RecyclerView.Adapter<DeviceListAdapter.ViewHolde
|
|||||||
mSelectedPosition = position;
|
mSelectedPosition = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
void setDevices(List<DeviceFilterPair<?>> devices) {
|
||||||
public void onChanged(List<DeviceFilterPair<?>> deviceFilterPairs) {
|
mDevices = devices;
|
||||||
mDevices = deviceFilterPairs;
|
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user