1<?xml version="1.0" encoding="utf-8"?><!--
2 Copyright 2023 The Android Open Source Project
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
16<androidx.constraintlayout.widget.ConstraintLayout
17    xmlns:android="http://schemas.android.com/apk/res/android"
18    xmlns:tools="http://schemas.android.com/tools"
19    xmlns:app="http://schemas.android.com/apk/res-auto"
20    android:id="@+id/container_view"
21    android:layout_width="match_parent"
22    android:layout_height="match_parent"
23    android:layout_gravity="center"
24    android:background="@color/bg"
25    tools:context=".DeviceAsWebcamPreview">
26
27    <FrameLayout
28        android:id="@+id/texture_view_container"
29        android:layout_width="0dp"
30        android:layout_height="0dp"
31        android:layout_marginEnd="8dp"
32        android:layout_marginStart="8dp"
33        android:contentDescription="@string/view_finder_description"
34        app:layout_constraintEnd_toEndOf="parent"
35        app:layout_constraintStart_toStartOf="parent"
36        app:layout_constraintBottom_toTopOf="@id/ui_control_container"
37        app:layout_constraintTop_toTopOf="parent">
38
39        <androidx.cardview.widget.CardView
40            android:id="@+id/texture_view_card"
41            android:layout_width="match_parent"
42            android:layout_height="match_parent"
43            android:layout_gravity="center"
44            app:cardCornerRadius="10dp">
45            <TextureView
46                android:id="@+id/texture_view"
47                android:layout_width="match_parent"
48                android:layout_height="match_parent"/>
49
50            <ImageView
51                android:id="@+id/focus_indicator"
52                android:layout_width="@dimen/focus_indicator_size"
53                android:layout_height="@dimen/focus_indicator_size"
54                android:contentDescription="@null"
55                android:visibility="gone" />
56
57            <ImageButton
58                android:id="@+id/high_quality_button"
59                android:layout_width="32dp"
60                android:layout_height="32dp"
61                android:layout_gravity="top|left"
62                android:layout_marginTop="20dp"
63                android:layout_marginLeft="20dp"
64                android:background="@drawable/ic_high_quality_bg"
65                android:padding="6dp"
66                android:scaleType="fitCenter"
67                android:src="@drawable/ic_high_quality_on" />
68        </androidx.cardview.widget.CardView>
69    </FrameLayout>
70
71    <androidx.constraintlayout.widget.ConstraintLayout
72        android:id="@+id/ui_control_container"
73        android:layout_width="0dp"
74        android:layout_height="175dp"
75        app:layout_constraintTop_toBottomOf="@id/texture_view_container"
76        app:layout_constraintBottom_toBottomOf="parent"
77        app:layout_constraintStart_toStartOf="parent"
78        app:layout_constraintEnd_toEndOf="parent">
79
80        <ImageButton
81            android:id="@+id/toggle_camera_button"
82            android:layout_width="64dp"
83            android:layout_height="64dp"
84            android:layout_marginStart="32dp"
85            android:layout_marginEnd="32dp"
86            android:src="@drawable/ic_switch"
87            android:visibility="visible"
88            android:background="@drawable/ic_camera_switch_bg"
89            app:layout_constraintStart_toEndOf="@id/zoom_ui_controller"
90            app:layout_constraintEnd_toEndOf="parent"
91            app:layout_constraintTop_toTopOf="parent"
92            app:layout_constraintBottom_toBottomOf="parent"
93            app:layout_constraintHorizontal_bias="0.5"
94            app:layout_constraintHorizontal_chainStyle="packed" />
95
96        <com.android.deviceaswebcam.view.ZoomController
97            android:id="@+id/zoom_ui_controller"
98            android:layout_width="0dp"
99            android:layout_height="0dp"
100            app:layout_constraintStart_toStartOf="parent"
101            app:layout_constraintEnd_toStartOf="@id/toggle_camera_button"
102            app:layout_constraintTop_toTopOf="parent"
103            app:layout_constraintBottom_toBottomOf="parent"
104            app:layout_constraintWidth_max="@dimen/zoom_seekbar_width"
105            app:layout_constraintHorizontal_bias="0.5"
106            app:layout_constraintHorizontal_chainStyle="packed"/>
107    </androidx.constraintlayout.widget.ConstraintLayout>
108
109</androidx.constraintlayout.widget.ConstraintLayout>
110