Add button to take a photo
[android-PittiHelloWorld.git] / app / src / main / res / layout / activity_main.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3     xmlns:app="http://schemas.android.com/apk/res-auto"
4     xmlns:tools="http://schemas.android.com/tools"
5     android:layout_width="match_parent"
6     android:layout_height="match_parent"
7     tools:context=".MainActivity">
8
9     <EditText
10         android:id="@+id/messageText"
11         android:layout_width="0dp"
12         android:layout_height="wrap_content"
13         android:ems="10"
14         android:hint="@string/edit_message"
15         android:inputType="textPersonName"
16         app:layout_constraintEnd_toStartOf="@+id/sendButton"
17         app:layout_constraintHorizontal_bias="0.5"
18         app:layout_constraintStart_toStartOf="parent"
19         app:layout_constraintTop_toTopOf="parent"/>
20
21     <Button
22         android:id="@+id/sendButton"
23         android:layout_width="wrap_content"
24         android:layout_height="wrap_content"
25         android:layout_marginStart="16dp"
26         android:layout_marginEnd="16dp"
27         android:onClick="sendMessage"
28         android:text="@string/button_send"
29         app:layout_constraintBaseline_toBaselineOf="@+id/messageText"
30         app:layout_constraintEnd_toEndOf="parent"
31         app:layout_constraintHorizontal_bias="0.5"
32         app:layout_constraintStart_toEndOf="@+id/messageText" />
33
34     <Button
35         android:id="@+id/button_photo"
36         android:layout_width="wrap_content"
37         android:layout_height="wrap_content"
38         android:layout_marginStart="16dp"
39         android:layout_marginLeft="16dp"
40         android:layout_marginTop="16dp"
41         android:onClick="takePhoto"
42         android:text="@string/button_photo"
43         app:layout_constraintStart_toStartOf="parent"
44         app:layout_constraintTop_toBottomOf="@+id/messageText" />
45
46     <ImageView
47         android:id="@+id/imageViewPhoto"
48         android:layout_width="0dp"
49         android:layout_height="0dp"
50         android:layout_marginStart="16dp"
51         android:layout_marginLeft="16dp"
52         android:layout_marginTop="16dp"
53         android:layout_marginEnd="16dp"
54         android:layout_marginRight="16dp"
55         app:layout_constraintEnd_toEndOf="parent"
56         app:layout_constraintStart_toStartOf="parent"
57         app:layout_constraintTop_toBottomOf="@+id/button_photo"
58         app:srcCompat="@android:drawable/btn_dialog" />
59
60     <TextView
61         android:id="@+id/textViewPhotoResult"
62         android:layout_width="wrap_content"
63         android:layout_height="wrap_content"
64         android:layout_marginStart="16dp"
65         android:layout_marginLeft="16dp"
66         android:layout_marginTop="16dp"
67         android:text="@string/text_nocamresult"
68         app:layout_constraintStart_toEndOf="@+id/button_photo"
69         app:layout_constraintTop_toBottomOf="@+id/messageText" />
70 </androidx.constraintlayout.widget.ConstraintLayout>