1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 ~ Copyright (C) 2016 The Android Open Source Project
4 ~
5 ~ Licensed under the Apache License, Version 2.0 (the "License");
6 ~ you may not use this file except in compliance with the License.
7 ~ You may obtain a copy of the License at
8 ~
9 ~      http://www.apache.org/licenses/LICENSE-2.0
10 ~
11 ~ Unless required by applicable law or agreed to in writing, software
12 ~ distributed under the License is distributed on an "AS IS" BASIS,
13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License
16 -->
17<com.android.dialer.callcomposer.cameraui.CameraMediaChooserView
18  xmlns:android="http://schemas.android.com/apk/res/android"
19  android:id="@+id/camera_view"
20  android:layout_width="match_parent"
21  android:layout_height="match_parent"
22  android:background="@android:color/black">
23
24  <FrameLayout
25    android:id="@+id/mediapicker_enabled"
26    android:layout_width="match_parent"
27    android:layout_height="wrap_content">
28
29    <!-- Default to using the hardware rendered camera preview, we will fall back to
30    SoftwareCameraPreview in CameraMediaChooserView if needed -->
31    <com.android.dialer.callcomposer.camera.HardwareCameraPreview
32      android:id="@+id/camera_preview"
33      android:layout_width="match_parent"
34      android:layout_height="match_parent"
35      android:layout_gravity="center" />
36
37    <com.android.dialer.callcomposer.camera.camerafocus.RenderOverlay
38      android:id="@+id/focus_visual"
39      android:layout_width="match_parent"
40      android:layout_height="match_parent"/>
41
42    <View
43      android:id="@+id/camera_shutter_visual"
44      android:layout_width="match_parent"
45      android:layout_height="match_parent"
46      android:background="@android:color/white"
47      android:visibility="gone"/>
48
49    <ImageView
50      android:id="@+id/preview_image_view"
51      android:layout_width="match_parent"
52      android:layout_height="match_parent"
53      android:scaleType="centerCrop"
54      android:background="#000000"
55      android:visibility="gone"/>
56
57    <!-- Need a background on this view in order for the ripple effect to have a place to draw -->
58    <FrameLayout
59      android:id="@+id/camera_button_container"
60      android:layout_width="match_parent"
61      android:layout_height="match_parent"
62      android:background="@android:color/transparent"
63      android:padding="16dp"
64      android:layout_gravity="bottom">
65
66      <ImageButton
67        android:id="@+id/camera_fullscreen"
68        android:layout_width="@dimen/camera_view_button_size"
69        android:layout_height="@dimen/camera_view_button_size"
70        android:layout_gravity="bottom|end"
71        android:layout_marginEnd="@dimen/camera_view_button_margin"
72        android:layout_marginBottom="@dimen/camera_view_button_margin"
73        android:src="@drawable/quantum_ic_fullscreen_white_48"
74        android:background="?android:attr/selectableItemBackgroundBorderless"
75        android:contentDescription="@string/description_camera_switch_full_screen"/>
76
77      <ImageButton
78        android:id="@+id/camera_exit_fullscreen"
79        android:layout_width="@dimen/camera_view_button_size"
80        android:layout_height="@dimen/camera_view_button_size"
81        android:layout_gravity="bottom|end"
82        android:layout_marginEnd="@dimen/camera_view_button_margin"
83        android:layout_marginBottom="@dimen/camera_view_button_margin"
84        android:src="@drawable/quantum_ic_fullscreen_exit_white_48"
85        android:visibility="gone"
86        android:background="?android:attr/selectableItemBackgroundBorderless"
87        android:contentDescription="@string/description_camera_switch_preview_screen"/>
88
89      <ImageButton
90        android:id="@+id/camera_capture_button"
91        android:layout_width="@dimen/capture_button_size"
92        android:layout_height="@dimen/capture_button_size"
93        android:layout_gravity="bottom|center_horizontal"
94        android:layout_marginBottom="@dimen/capture_button_bottom_margin"
95        android:background="?android:attr/selectableItemBackgroundBorderless"
96        android:src="@drawable/ic_capture"
97        android:scaleType="fitXY"
98        android:contentDescription="@string/description_camera_take_picture"/>
99
100      <ImageButton
101        android:id="@+id/swap_camera_button"
102        android:layout_width="@dimen/camera_view_button_size"
103        android:layout_height="@dimen/camera_view_button_size"
104        android:layout_gravity="start|bottom"
105        android:layout_marginStart="@dimen/camera_view_button_margin"
106        android:layout_marginBottom="@dimen/camera_view_button_margin"
107        android:src="@drawable/front_back_switch_button_animation"
108        android:background="@drawable/transparent_button_background"/>
109
110      <ImageButton
111        android:id="@+id/camera_cancel_button"
112        android:layout_width="@dimen/camera_view_button_size"
113        android:layout_height="@dimen/camera_view_button_size"
114        android:layout_gravity="start|bottom"
115        android:layout_marginStart="@dimen/camera_view_button_margin"
116        android:layout_marginBottom="@dimen/camera_view_button_margin"
117        android:visibility="gone"
118        android:background="@drawable/transparent_button_background"
119        android:src="@drawable/quantum_ic_undo_white_48"
120        android:contentDescription="@string/description_camera_cancel_photo" />
121    </FrameLayout>
122  </FrameLayout>
123
124  <ProgressBar
125    android:id="@+id/loading"
126    android:layout_width="wrap_content"
127    android:layout_height="wrap_content"
128    android:layout_gravity="center"
129    android:visibility="gone"/>
130</com.android.dialer.callcomposer.cameraui.CameraMediaChooserView>