• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3    Copyright (C) 2015 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
18<com.android.messaging.ui.mediapicker.CameraMediaChooserView
19    xmlns:android="http://schemas.android.com/apk/res/android"
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.messaging.ui.mediapicker.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.messaging.ui.mediapicker.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        <!-- Need a background on this view in order for the ripple effect to have a place to draw -->
50        <FrameLayout
51            android:id="@+id/camera_button_container"
52            android:layout_width="match_parent"
53            android:layout_height="wrap_content"
54            android:background="@android:color/transparent"
55            android:paddingTop="20dp"
56            android:layout_gravity="bottom">
57
58            <FrameLayout
59                android:layout_width="wrap_content"
60                android:layout_height="wrap_content"
61                android:layout_gravity="start|center_vertical"
62                style="@style/CameraChooserFrameStyle">
63
64                <ImageButton
65                    android:id="@+id/camera_swap_mode_button"
66                    android:layout_width="wrap_content"
67                    android:layout_height="wrap_content"
68                    android:minWidth="48dp"
69                    android:minHeight="48dp"
70                    android:background="@drawable/transparent_button_background"
71                    android:src="@drawable/ic_mp_video_small_light"
72                    android:contentDescription="@string/camera_switch_to_video_mode"/>
73
74                <Chronometer
75                    android:id="@+id/camera_video_counter"
76                    android:layout_width="wrap_content"
77                    android:layout_height="wrap_content"
78                    android:textColor="@android:color/white"
79                    android:textSize="18sp"
80                    android:padding="16dp"
81                    android:visibility="gone" />
82
83            </FrameLayout>
84
85            <ImageButton
86                android:id="@+id/camera_capture_button"
87                android:layout_width="wrap_content"
88                android:layout_height="wrap_content"
89                android:layout_gravity="center"
90                android:minWidth="96dp"
91                android:minHeight="96dp"
92                android:background="@drawable/transparent_button_background"
93                android:src="@drawable/ic_checkmark_large_light"
94                android:contentDescription="@string/camera_take_picture"/>
95
96            <FrameLayout
97                android:layout_width="wrap_content"
98                android:layout_height="wrap_content"
99                android:layout_gravity="end|center_vertical"
100                android:paddingEnd="16dp">
101
102                <ImageButton
103                    android:id="@+id/camera_fullScreen_button"
104                    android:layout_width="wrap_content"
105                    android:layout_height="wrap_content"
106                    android:minWidth="48dp"
107                    android:minHeight="48dp"
108                    android:background="@drawable/transparent_button_background"
109                    android:src="@drawable/ic_mp_full_screen_light"
110                    android:contentDescription="@string/camera_switch_full_screen" />
111
112                <ImageButton
113                    android:id="@+id/camera_swapCamera_button"
114                    android:layout_width="wrap_content"
115                    android:layout_height="wrap_content"
116                    android:minWidth="48dp"
117                    android:minHeight="48dp"
118                    android:background="@drawable/transparent_button_background"
119                    android:visibility="gone"
120                    android:contentDescription="@string/camera_switch_camera_facing"/>
121
122                <ImageButton
123                    android:id="@+id/camera_cancel_button"
124                    android:layout_width="wrap_content"
125                    android:layout_height="wrap_content"
126                    android:minWidth="48dp"
127                    android:minHeight="48dp"
128                    android:background="@drawable/transparent_button_background"
129                    android:src="@drawable/ic_remove_small_light"
130                    android:visibility="gone"
131                    android:contentDescription="@string/camera_cancel_recording" />
132
133            </FrameLayout>
134
135        </FrameLayout>
136
137    </FrameLayout>
138
139    <!-- This view will hide all other views if the required permission is not granted -->
140    <TextView
141        android:id="@+id/missing_permission_view"
142        android:layout_width="match_parent"
143        android:layout_height="match_parent"
144        android:text="@string/enable_permission_procedure"
145        android:contentDescription="@string/enable_permission_procedure_description"
146        android:background="@android:color/white"
147        android:gravity="center"
148        android:visibility="gone" />
149
150</com.android.messaging.ui.mediapicker.CameraMediaChooserView>
151