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:background="@color/bg" 24 tools:context=".DeviceAsWebcamPreview"> 25 26 <FrameLayout 27 android:id="@+id/texture_view_container" 28 android:layout_width="0dp" 29 android:layout_height="0dp" 30 android:layout_marginEnd="8dp" 31 android:layout_marginStart="8dp" 32 android:contentDescription="@string/view_finder_description" 33 app:layout_constraintEnd_toEndOf="parent" 34 app:layout_constraintStart_toStartOf="parent" 35 app:layout_constraintBottom_toTopOf="@id/ui_control_container" 36 app:layout_constraintTop_toTopOf="parent"> 37 38 <androidx.cardview.widget.CardView 39 android:id="@+id/texture_view_card" 40 android:layout_width="match_parent" 41 android:layout_height="match_parent" 42 android:layout_gravity="center" 43 app:cardCornerRadius="10dp"> 44 <TextureView 45 android:id="@+id/texture_view" 46 android:layout_width="match_parent" 47 android:layout_height="match_parent"/> 48 49 <ImageView 50 android:id="@+id/focus_indicator" 51 android:layout_width="@dimen/focus_indicator_size" 52 android:layout_height="@dimen/focus_indicator_size" 53 android:contentDescription="@null" 54 android:visibility="gone" /> 55 </androidx.cardview.widget.CardView> 56 </FrameLayout> 57 58 <androidx.constraintlayout.widget.ConstraintLayout 59 android:id="@+id/ui_control_container" 60 android:layout_width="0dp" 61 android:layout_height="175dp" 62 app:layout_constraintTop_toBottomOf="@id/texture_view_container" 63 app:layout_constraintBottom_toBottomOf="parent" 64 app:layout_constraintStart_toStartOf="parent" 65 app:layout_constraintEnd_toEndOf="parent"> 66 67 <ImageButton 68 android:id="@+id/toggle_camera_button" 69 android:layout_width="64dp" 70 android:layout_height="64dp" 71 android:layout_margin="64dp" 72 android:src="@drawable/ic_switch" 73 app:layout_constraintEnd_toEndOf="parent" 74 app:layout_constraintBottom_toBottomOf="parent" 75 app:layout_constraintTop_toTopOf="parent" 76 android:visibility="visible" 77 android:background="@drawable/ic_camera_switch_bg"/> 78 79 <androidx.constraintlayout.widget.ConstraintLayout 80 android:id="@+id/zoom_ui_container" 81 android:layout_width="0dp" 82 android:layout_height="0dp" 83 app:layout_constraintBottom_toBottomOf="parent" 84 app:layout_constraintTop_toTopOf="parent" 85 app:layout_constraintStart_toStartOf="parent" 86 app:layout_constraintEnd_toStartOf="@id/toggle_camera_button"> 87 <com.android.DeviceAsWebcam.view.ZoomController 88 android:id="@+id/zoom_ui_controller" 89 android:layout_width="0dp" 90 android:layout_height="0dp" 91 app:layout_constraintBottom_toBottomOf="parent" 92 app:layout_constraintTop_toTopOf="parent" 93 app:layout_constraintStart_toStartOf="parent" 94 app:layout_constraintEnd_toEndOf="parent" 95 app:layout_constraintWidth_max="@dimen/zoom_seekbar_width"/> 96 </androidx.constraintlayout.widget.ConstraintLayout> 97 </androidx.constraintlayout.widget.ConstraintLayout> 98 99 <com.android.DeviceAsWebcam.view.SwitchCameraSelectorView 100 android:id="@+id/switch_camera_selector_view" 101 android:layout_width="0dp" 102 android:layout_height="0dp" 103 app:layout_constraintBottom_toBottomOf="parent" 104 app:layout_constraintTop_toTopOf="parent" 105 app:layout_constraintStart_toStartOf="parent" 106 app:layout_constraintEnd_toEndOf="parent" /> 107 108</androidx.constraintlayout.widget.ConstraintLayout> 109