Commit b79e9397bc1a5ed7e06ee8a9603220c0a5c9ea63

Authored by 陈硕
1 parent c824959d

修改布局

app/src/main/res/layout/activity_groupchat.xml
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 android:id="@+id/re_chat" 8 android:id="@+id/re_chat"
9 android:layout_width="match_parent" 9 android:layout_width="match_parent"
10 android:layout_height="match_parent" 10 android:layout_height="match_parent"
11 - android:visibility="invisible"> 11 + android:visibility="visible">
12 12
13 <LinearLayout 13 <LinearLayout
14 android:id="@+id/listVIewTop" 14 android:id="@+id/listVIewTop"
@@ -116,18 +116,6 @@ @@ -116,18 +116,6 @@
116 android:orientation="horizontal"> 116 android:orientation="horizontal">
117 117
118 <Button 118 <Button
119 - android:id="@+id/connectionBtn"  
120 - android:layout_width="wrap_content"  
121 - android:layout_height="wrap_content"  
122 - android:text="连接服务器" />  
123 -  
124 - <Button  
125 - android:id="@+id/disconnect"  
126 - android:layout_width="wrap_content"  
127 - android:layout_height="wrap_content"  
128 - android:text="断开连接" />  
129 -  
130 - <Button  
131 android:id="@+id/creatChat" 119 android:id="@+id/creatChat"
132 android:layout_width="wrap_content" 120 android:layout_width="wrap_content"
133 android:layout_height="wrap_content" 121 android:layout_height="wrap_content"
@@ -155,28 +143,22 @@ @@ -155,28 +143,22 @@
155 android:orientation="horizontal"> 143 android:orientation="horizontal">
156 144
157 <Button 145 <Button
158 - android:id="@+id/user_switch"  
159 - android:layout_width="wrap_content"  
160 - android:layout_height="wrap_content"  
161 - android:text="切换用户" />  
162 -  
163 - <Button  
164 - android:id="@+id/switch_visitors" 146 + android:id="@+id/exit_chat1"
165 android:layout_width="wrap_content" 147 android:layout_width="wrap_content"
166 android:layout_height="wrap_content" 148 android:layout_height="wrap_content"
167 - android:text="切换游客" /> 149 + android:text="退出聊天室1" />
168 150
169 <Button 151 <Button
170 - android:id="@+id/button" 152 + android:id="@+id/exit_chat2"
171 android:layout_width="wrap_content" 153 android:layout_width="wrap_content"
172 android:layout_height="wrap_content" 154 android:layout_height="wrap_content"
173 android:text="退出聊天室2" /> 155 android:text="退出聊天室2" />
174 156
175 <Button 157 <Button
176 - android:id="@+id/button2" 158 + android:id="@+id/user_switch"
177 android:layout_width="wrap_content" 159 android:layout_width="wrap_content"
178 android:layout_height="wrap_content" 160 android:layout_height="wrap_content"
179 - android:text="退出聊天室1" /> 161 + android:text="切换用户" />
180 162
181 </LinearLayout> 163 </LinearLayout>
182 </LinearLayout> 164 </LinearLayout>
@@ -188,7 +170,8 @@ @@ -188,7 +170,8 @@
188 android:layout_width="match_parent" 170 android:layout_width="match_parent"
189 android:layout_height="wrap_content" 171 android:layout_height="wrap_content"
190 android:layout_centerVertical="true" 172 android:layout_centerVertical="true"
191 - android:orientation="vertical"> 173 + android:orientation="vertical"
  174 + android:visibility="invisible">
192 175
193 176
194 <LinearLayout 177 <LinearLayout
app/src/main/res/layout/activity_main.xml
@@ -12,19 +12,29 @@ @@ -12,19 +12,29 @@
12 12
13 13
14 <Button 14 <Button
15 - android:text="群聊" 15 + android:visibility="invisible"
  16 + android:id="@+id/groupChat"
16 android:layout_width="match_parent" 17 android:layout_width="match_parent"
17 android:layout_height="wrap_content" 18 android:layout_height="wrap_content"
18 android:layout_marginTop="140dp" 19 android:layout_marginTop="140dp"
19 - android:id="@+id/groupChat"  
20 - /> 20 + android:text="群聊" />
21 21
22 <Button 22 <Button
23 - android:text="私聊" 23 + android:visibility="invisible"
  24 + android:id="@+id/privateChat"
24 android:layout_width="match_parent" 25 android:layout_width="match_parent"
25 android:layout_height="wrap_content" 26 android:layout_height="wrap_content"
26 android:layout_below="@+id/groupChat" 27 android:layout_below="@+id/groupChat"
27 android:layout_marginTop="34dp" 28 android:layout_marginTop="34dp"
28 - android:id="@+id/privateChat"  
29 - /> 29 + android:text="私聊" />
  30 +
  31 + <Button
  32 + android:id="@+id/connect"
  33 + android:layout_width="match_parent"
  34 + android:layout_height="wrap_content"
  35 + android:layout_below="@+id/privateChat"
  36 + android:layout_marginTop="36dp"
  37 + android:text="连接服务器" />
  38 +
  39 +
30 </RelativeLayout> 40 </RelativeLayout>
app/src/main/res/layout/activity_private_chat.xml
@@ -62,7 +62,20 @@ @@ -62,7 +62,20 @@
62 android:layout_height="wrap_content" 62 android:layout_height="wrap_content"
63 android:layout_gravity="center" 63 android:layout_gravity="center"
64 android:layout_weight="1" /> 64 android:layout_weight="1" />
65 - 65 + <TextView
  66 + android:layout_width="wrap_content"
  67 + android:layout_height="wrap_content"
  68 + android:layout_gravity="center"
  69 + android:gravity="center"
  70 + android:text="name:"
  71 + android:textSize="22dp"
  72 + android:textStyle="bold" />
  73 + <EditText
  74 + android:id="@+id/opposite_name_edit"
  75 + android:layout_width="0dp"
  76 + android:layout_height="wrap_content"
  77 + android:layout_gravity="center"
  78 + android:layout_weight="1"/>
66 79
67 <Button 80 <Button
68 android:id="@+id/userId_btn_top" 81 android:id="@+id/userId_btn_top"
@@ -93,7 +106,23 @@ @@ -93,7 +106,23 @@
93 android:layout_width="0dp" 106 android:layout_width="0dp"
94 android:layout_height="wrap_content" 107 android:layout_height="wrap_content"
95 android:layout_gravity="center" 108 android:layout_gravity="center"
96 - android:layout_weight="1" /> 109 + android:layout_weight="0.5" />
  110 +
  111 + <TextView
  112 + android:layout_width="wrap_content"
  113 + android:layout_height="wrap_content"
  114 + android:layout_gravity="center"
  115 + android:gravity="center"
  116 + android:text="name:"
  117 + android:textSize="22dp"
  118 + android:textStyle="bold" />
  119 +
  120 + <EditText
  121 + android:id="@+id/my_name_edit"
  122 + android:layout_width="0dp"
  123 + android:layout_height="wrap_content"
  124 + android:layout_gravity="center"
  125 + android:layout_weight="0.5" />
97 126
98 <Button 127 <Button
99 android:id="@+id/my_btn_top" 128 android:id="@+id/my_btn_top"