xref: /aosp_15_r20/external/grpc-grpc/examples/android/helloworld/app/src/main/res/layout/activity_helloworld.xml (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2              xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
3              android:layout_height="match_parent"
4              tools:context=".HelloworldActivity"
5              android:orientation="vertical" >
6
7    <TextView
8        android:layout_width="match_parent"
9        android:layout_height="wrap_content"
10        android:paddingTop="12dp"
11        android:paddingBottom="12dp"
12        android:textSize="16sp"
13        android:text="gRPC Client Configuration"
14        android:textStyle="bold" />
15
16    <LinearLayout
17            android:layout_width="match_parent"
18            android:layout_height="wrap_content"
19            android:orientation="horizontal">
20        <EditText
21                android:id="@+id/host_edit_text"
22                android:layout_weight="2"
23                android:layout_width="0dp"
24                android:layout_height="wrap_content"
25                android:hint="Enter Host" />
26        <EditText
27                android:id="@+id/port_edit_text"
28                android:layout_weight="1"
29                android:layout_width="0dp"
30                android:layout_height="wrap_content"
31                android:inputType="numberDecimal"
32                android:hint="Enter Port" />
33    </LinearLayout>
34
35
36    <EditText
37            android:id="@+id/message_edit_text"
38            android:layout_width="match_parent"
39            android:layout_height="wrap_content"
40            android:hint="Enter message to send" />
41
42    <Button
43            android:id="@+id/send_button"
44            android:layout_width="match_parent"
45            android:layout_height="wrap_content"
46            android:onClick="sendMessage"
47            android:text="Send gRPC Request" />
48
49    <TextView
50        android:layout_width="match_parent"
51        android:layout_height="wrap_content"
52        android:paddingTop="12dp"
53        android:paddingBottom="12dp"
54        android:textSize="16sp"
55        android:text="Response:" />
56
57    <TextView
58        android:id="@+id/grpc_response_text"
59        android:layout_width="match_parent"
60        android:layout_height="wrap_content"
61        android:scrollbars = "vertical"
62        android:textSize="16sp" />
63
64    <TextView
65        android:layout_width="match_parent"
66        android:layout_height="wrap_content"
67        android:paddingTop="12dp"
68        android:paddingBottom="12dp"
69        android:textSize="16sp"
70        android:text="gRPC Server Configuration"
71        android:textStyle="bold" />
72
73    <EditText
74        android:id="@+id/server_port_edit_text"
75        android:layout_width="match_parent"
76        android:layout_height="wrap_content"
77        android:hint="Server port" />
78
79    <Button
80        android:id="@+id/server_button"
81        android:layout_width="match_parent"
82        android:layout_height="wrap_content"
83        android:onClick="startOrStopServer"
84        android:text="Start gRPC Server" />
85
86</LinearLayout>
87