CTS UI issue in DisplayCutoutTestActivity and
SetNewPasswordComplexityTest
Some layouts were getting cut of on wear os devices, modified,
added ScrollView to accommodate the smaller screens.
Test: Manually install the CtsVerifier apk and run the test
"DisplayCutoutTestActivity" and "SetNewPasswordComplexityTest"
Bug: 184593944
Change-Id: I42344133b03e53b868d2d9d50c8c03275411b4b4
(cherry picked from commit f5512f8784fb50aa54705615c7ab24ccc97d6c99)
diff --git a/apps/CtsVerifier/res/layout-watch/display_cutout.xml b/apps/CtsVerifier/res/layout-watch/display_cutout.xml
new file mode 100644
index 0000000..da8314c
--- /dev/null
+++ b/apps/CtsVerifier/res/layout-watch/display_cutout.xml
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="utf-8"?><!-- Copyright 2020 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">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:id="@+id/enable_buttons_desc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true"
+ android:layout_marginLeft="30dp"
+ android:layout_marginRight="30dp"
+ android:text="@string/display_cutout_test_instruction"
+ android:textSize="20dp" />
+
+ <include
+ android:id="@+id/pass_fail_buttons"
+ layout="@layout/pass_fail_buttons"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/enable_buttons_desc"
+ android:layout_marginLeft="30dp"
+ android:layout_marginRight="30dp" />
+
+ <LinearLayout
+ android:id="@+id/top_buttons"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/display_cutout_test_button_size"
+ android:layout_alignParentTop="true"
+ android:orientation="horizontal"
+ android:visibility="gone">
+
+ <Button
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="0"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="1"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="2"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="3"
+ android:textSize="10dp" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/bottom_buttons"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/display_cutout_test_button_size"
+ android:layout_alignParentBottom="true"
+ android:orientation="horizontal"
+ android:visibility="gone">
+
+ <Button
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="11"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="10"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="9"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="8"
+ android:textSize="10dp" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/left_buttons"
+ android:layout_width="@dimen/display_cutout_test_button_size"
+ android:layout_height="match_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_marginTop="@dimen/display_cutout_test_button_size"
+ android:layout_marginBottom="@dimen/display_cutout_test_button_size"
+ android:orientation="vertical"
+ android:visibility="gone">
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="15"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="14"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="13"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="12"
+ android:textSize="10dp" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/right_buttons"
+ android:layout_width="@dimen/display_cutout_test_button_size"
+ android:layout_height="match_parent"
+ android:layout_alignParentRight="true"
+ android:layout_marginTop="@dimen/display_cutout_test_button_size"
+ android:layout_marginBottom="@dimen/display_cutout_test_button_size"
+ android:orientation="vertical"
+ android:visibility="gone">
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="4"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="5"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="6"
+ android:textSize="10dp" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@drawable/display_cutout_test_button"
+ android:onClick="onButtonClicked"
+ android:text="7"
+ android:textSize="10dp" />
+ </LinearLayout>
+
+ </RelativeLayout>
+</ScrollView>
diff --git a/apps/CtsVerifier/res/layout-watch/pass_fail_set_password_complexity.xml b/apps/CtsVerifier/res/layout-watch/pass_fail_set_password_complexity.xml
new file mode 100644
index 0000000..49b0fb1
--- /dev/null
+++ b/apps/CtsVerifier/res/layout-watch/pass_fail_set_password_complexity.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2021 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">
+
+ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentTop="true"
+ android:divider="@android:color/white"
+ android:orientation="vertical"
+ android:showDividers="middle">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <Button
+ android:id="@+id/set_complexity_high_btn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/set_complexity_high_txt" />
+
+ <TextView
+ android:id="@+id/set_complexity_high_desc"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="none"
+ android:text="@string/set_complexity_high_desc" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <Button
+ android:id="@+id/set_complexity_medium_btn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/set_complexity_medium_txt" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="none"
+ android:text="@string/set_complexity_medium_desc" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <Button
+ android:id="@+id/set_complexity_low_btn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/set_complexity_low_txt" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="none"
+ android:text="@string/set_complexity_low_desc" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <Button
+ android:id="@+id/set_complexity_none_btn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/set_complexity_none_txt" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="none"
+ android:text="@string/set_complexity_none_desc" />
+ </LinearLayout>
+
+ </LinearLayout>
+
+ <include
+ layout="@layout/pass_fail_buttons"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true" />
+ </RelativeLayout>
+</ScrollView>
\ No newline at end of file