Fix QR code scanner layout in "Pair devices over Wi-Fi" page.

The toolbar needs to be disabled to remove the empty space at the top
of the page. Also added the landscape layout xml.

Bug: 193602141
Test: atest SettingsUnitTests and manual

Change-Id: I30368835979b360a8f09e16f70adf57064784517
This commit is contained in:
Joshua Duong
2021-07-14 16:05:57 -07:00
parent 0bf6164584
commit fd009229e5
7 changed files with 216 additions and 54 deletions

View File

@@ -17,10 +17,11 @@
<com.google.android.setupdesign.GlifLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/GlifV3Theme"
android:icon="@drawable/ic_scan_32dp">
android:icon="@drawable/ic_scan_32dp"
app:sudDescriptionText="@string/adb_wireless_qrcode_pairing_description">
<LinearLayout
style="@style/SudContentFrame"
@@ -32,52 +33,34 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:gravity="center_horizontal"
android:id="@+id/camera_layout">
<TextView
android:id="@android:id/summary"
style="@style/TextAppearance.SudGlifBody"
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="true">
<TextureView
android:id="@+id/preview_view"
android:layout_width="match_parent"
android:layout_height="@dimen/qrcode_preview_size"/>
<com.android.settings.wifi.qrcode.QrDecorateView
android:id="@+id/decorate_view"
android:layout_width="match_parent"
android:layout_height="@dimen/qrcode_preview_size"/>
</FrameLayout>
<TextView
android:id="@+id/error_message"
style="@style/TextAppearance.ErrorText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginStart="?attr/sudMarginStart"
android:layout_marginEnd="?attr/sudMarginEnd"
android:textAlignment="center"
android:accessibilityLiveRegion="polite"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="true">
<TextureView
android:id="@+id/preview_view"
android:layout_width="match_parent"
android:layout_height="@dimen/qrcode_preview_size"/>
<com.android.settings.wifi.qrcode.QrDecorateView
android:id="@+id/decorate_view"
android:layout_width="match_parent"
android:layout_height="@dimen/qrcode_preview_size"/>
</FrameLayout>
<TextView
android:id="@+id/error_message"
style="@style/TextAppearance.ErrorText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginStart="?attr/sudMarginStart"
android:layout_marginEnd="?attr/sudMarginEnd"
android:textAlignment="center"
android:visibility="invisible"/>
</LinearLayout>
android:visibility="invisible"/>
</LinearLayout>
@@ -109,4 +92,5 @@
</LinearLayout>
</LinearLayout>
</com.google.android.setupdesign.GlifLayout>