Adjust camera preview area to square
1.Choose the smaller size of both dimensions as its size. 2.Set transform matrix to crop and center the preview picture. Bug: 118797380 Test: make RunSettingsRoboTests Change-Id: Ic65fb1fe0c5082995d6903f50dda48eec16c3fb1
This commit is contained in:
@@ -24,20 +24,19 @@
|
||||
|
||||
<include layout="@layout/wifi_dpp_fragment_header"/>
|
||||
|
||||
<FrameLayout
|
||||
<com.android.settings.wifi.qrcode.QrPreviewLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<SurfaceView
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center">
|
||||
<TextureView
|
||||
android:id="@+id/preview_view"
|
||||
android:layout_width="426dp"
|
||||
android:layout_height="320dp"
|
||||
android:layout_gravity="center"/>
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
<com.android.settings.wifi.qrcode.QrDecorateView
|
||||
android:id="@+id/decorate_view"
|
||||
android:layout_width="426dp"
|
||||
android:layout_height="320dp"
|
||||
android:layout_gravity="center"/>
|
||||
</FrameLayout>
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
</com.android.settings.wifi.qrcode.QrPreviewLayout>
|
||||
|
||||
<TextView android:id="@+id/error_message"
|
||||
android:layout_width="wrap_content"
|
||||
|
@@ -24,20 +24,20 @@
|
||||
|
||||
<include layout="@layout/wifi_dpp_fragment_header"/>
|
||||
|
||||
<FrameLayout
|
||||
<com.android.settings.wifi.qrcode.QrPreviewLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<SurfaceView
|
||||
android:layout_height="match_parent">
|
||||
<TextureView
|
||||
android:id="@+id/preview_view"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="426dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"/>
|
||||
<com.android.settings.wifi.qrcode.QrDecorateView
|
||||
android:id="@+id/decorate_view"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="426dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"/>
|
||||
</FrameLayout>
|
||||
</com.android.settings.wifi.qrcode.QrPreviewLayout>
|
||||
|
||||
<TextView android:id="@+id/error_message"
|
||||
android:layout_width="wrap_content"
|
||||
|
Reference in New Issue
Block a user