activity_contact_details.xml

  1<?xml version="1.0" encoding="utf-8"?>
  2<layout 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
  6    <LinearLayout
  7        android:layout_width="match_parent"
  8        android:layout_height="match_parent"
  9        android:fitsSystemWindows="true"
 10        android:orientation="vertical">
 11
 12        <com.google.android.material.appbar.AppBarLayout
 13            android:layout_width="match_parent"
 14            android:layout_height="wrap_content">
 15
 16            <com.google.android.material.appbar.MaterialToolbar
 17                android:id="@+id/toolbar"
 18                android:layout_width="match_parent"
 19                android:layout_height="wrap_content"
 20                android:minHeight="?attr/actionBarSize" />
 21
 22        </com.google.android.material.appbar.AppBarLayout>
 23
 24        <ScrollView
 25            android:layout_width="fill_parent"
 26            android:layout_height="fill_parent">
 27
 28            <LinearLayout
 29                android:id="@+id/details_main_layout"
 30                android:layout_width="fill_parent"
 31                android:layout_height="wrap_content"
 32                android:orientation="vertical">
 33
 34                <com.google.android.material.card.MaterialCardView
 35                    android:layout_width="match_parent"
 36                    android:layout_height="wrap_content"
 37                    android:layout_marginLeft="@dimen/activity_horizontal_margin"
 38                    android:layout_marginTop="@dimen/activity_vertical_margin"
 39                    android:layout_marginRight="@dimen/activity_horizontal_margin"
 40                    android:layout_marginBottom="@dimen/activity_vertical_margin">
 41
 42                    <RelativeLayout
 43                        android:layout_width="match_parent"
 44                        android:layout_height="wrap_content"
 45                        android:padding="@dimen/card_padding_regular">
 46
 47                        <com.google.android.material.imageview.ShapeableImageView
 48                            android:id="@+id/details_avatar"
 49                            android:layout_width="@dimen/avatar_on_details_screen_size"
 50                            android:layout_height="@dimen/avatar_on_details_screen_size"
 51                            android:layout_alignParentTop="true"
 52                            android:layout_centerHorizontal="true"
 53                            app:shapeAppearance="@style/ShapeAppearanceOverlay.Photo"
 54                            android:scaleType="centerCrop" />
 55
 56                        <TextView
 57                            android:id="@+id/details_contact_xmpp_address"
 58                            android:layout_width="wrap_content"
 59                            android:layout_height="wrap_content"
 60                            android:layout_below="@+id/details_avatar"
 61                            android:layout_centerHorizontal="true"
 62                            android:layout_marginTop="16sp"
 63                            android:gravity="center_horizontal"
 64                            android:minWidth="288dp"
 65                            android:text="@string/account_settings_example_jabber_id"
 66                            android:textIsSelectable="true"
 67                            android:textAppearance="?textAppearanceTitleLarge" />
 68
 69                        <LinearLayout
 70                            android:id="@+id/button_box"
 71                            android:layout_width="wrap_content"
 72                            android:layout_height="wrap_content"
 73                            android:layout_below="@+id/details_contact_xmpp_address"
 74                            android:layout_centerHorizontal="true"
 75                            android:layout_marginTop="16dp"
 76                            android:orientation="horizontal">
 77
 78                            <Button
 79                                android:id="@+id/add_contact_button"
 80                                android:layout_width="wrap_content"
 81                                android:layout_height="wrap_content"
 82                                android:layout_marginHorizontal="8dp"
 83                                android:text="@string/add_contact" />
 84
 85                            <Button
 86                                android:id="@+id/add_address_book"
 87                                style="@style/Widget.Material3.Button.TonalButton"
 88                                android:layout_width="wrap_content"
 89                                android:layout_height="wrap_content"
 90                                android:layout_marginHorizontal="8dp"
 91                                android:text="@string/save_to_contact"
 92                                app:icon="@drawable/ic_contacts_24dp" />
 93                        </LinearLayout>
 94
 95                        <androidx.constraintlayout.widget.ConstraintLayout
 96                            android:id="@+id/tags"
 97                            android:layout_width="wrap_content"
 98                            android:layout_height="wrap_content"
 99                            android:layout_below="@+id/button_box"
100                            android:layout_centerHorizontal="true"
101                            android:layout_marginTop="16sp"
102                            android:visibility="gone">
103
104                            <androidx.constraintlayout.helper.widget.Flow
105                                android:id="@+id/flow_widget"
106                                android:layout_width="0dp"
107                                android:layout_height="wrap_content"
108                                app:flow_horizontalBias="0"
109                                app:flow_horizontalGap="8sp"
110                                app:flow_horizontalStyle="packed"
111                                app:flow_verticalGap="4sp"
112                                app:flow_wrapMode="chain"
113                                app:layout_constraintEnd_toEndOf="parent"
114                                app:layout_constraintStart_toStartOf="parent"
115                                app:layout_constraintTop_toTopOf="parent" />
116                        </androidx.constraintlayout.widget.ConstraintLayout>
117
118                        <TextView
119                            android:id="@+id/details_last_seen"
120                            android:layout_width="wrap_content"
121                            android:layout_height="wrap_content"
122                            android:layout_below="@+id/tags"
123                            android:layout_centerHorizontal="true"
124                            android:layout_marginTop="8sp"
125                            android:textAppearance="?textAppearanceTitleSmall"
126                            tools:text="@string/just_now" />
127
128                        <LinearLayout
129                            android:id="@+id/status_message_subscription_box"
130                            android:layout_width="wrap_content"
131                            android:layout_height="wrap_content"
132                            android:layout_below="@+id/details_last_seen"
133                            android:layout_alignStart="@+id/details_contact_xmpp_address"
134                            android:layout_marginTop="8sp"
135                            android:orientation="vertical">
136
137                            <com.cheogram.android.TagEditorView
138                                android:id="@+id/edit_tags"
139                                android:visibility="gone"
140                                android:hint="Tags"
141                                android:layout_width="match_parent"
142                                android:layout_height="wrap_content"
143                                android:layout_marginBottom="4dp"
144                                android:layout_marginLeft="-4dp"
145                                android:layout_marginTop="-4dp" />
146
147                            <TextView
148                                android:id="@+id/details_lastseen"
149                                android:layout_width="wrap_content"
150                                android:layout_height="wrap_content"
151                                android:layout_marginTop="4dp"
152                                android:textAppearance="?textAppearanceTitleSmall"
153                                tools:text="@string/just_now" />
154
155                            <TextView
156                                android:id="@+id/status_message"
157                                android:layout_width="wrap_content"
158                                android:layout_height="wrap_content"
159                                android:layout_marginBottom="8sp"
160                                android:textAppearance="?textAppearanceBodyMedium"
161                                tools:text="Hey there! I’m using Conversations" />
162
163                            <CheckBox
164                                android:id="@+id/details_send_presence"
165                                android:layout_width="wrap_content"
166                                android:layout_height="wrap_content"
167                                android:text="@string/send_presence_updates" />
168
169                            <CheckBox
170                                android:id="@+id/details_receive_presence"
171                                android:layout_width="wrap_content"
172                                android:layout_height="wrap_content"
173                                android:text="@string/receive_presence_updates" />
174                        </LinearLayout>
175
176                        <TextView
177                            android:id="@+id/details_account"
178                            android:layout_width="wrap_content"
179                            android:layout_height="wrap_content"
180                            android:layout_below="@+id/status_message_subscription_box"
181                            android:layout_alignParentEnd="true"
182                            android:layout_alignParentBottom="true"
183                            android:layout_marginTop="16sp"
184                            android:text="@string/using_account"
185                            android:textAppearance="?textAppearanceLabelMedium" />
186                    </RelativeLayout>
187                </com.google.android.material.card.MaterialCardView>
188
189                <com.google.android.material.card.MaterialCardView
190                    android:id="@+id/profile"
191                    android:layout_width="match_parent"
192                    android:layout_height="wrap_content"
193                    android:layout_marginBottom="@dimen/activity_vertical_margin"
194                    android:layout_marginLeft="@dimen/activity_horizontal_margin"
195                    android:layout_marginRight="@dimen/activity_horizontal_margin"
196                    android:layout_marginTop="@dimen/activity_vertical_margin">
197
198                    <ListView
199                        android:id="@+id/profile_items"
200                        android:layout_width="fill_parent"
201                        android:layout_height="wrap_content"
202                        android:divider="@android:color/transparent"
203                        android:dividerHeight="0dp"></ListView>
204
205                </com.google.android.material.card.MaterialCardView>>
206
207                <com.google.android.material.card.MaterialCardView
208                    android:id="@+id/media_wrapper"
209                    android:layout_width="fill_parent"
210                    android:layout_height="wrap_content"
211                    android:layout_marginLeft="@dimen/activity_horizontal_margin"
212                    android:layout_marginTop="@dimen/activity_vertical_margin"
213                    android:layout_marginRight="@dimen/activity_horizontal_margin"
214                    android:layout_marginBottom="@dimen/activity_vertical_margin">
215
216                    <LinearLayout
217                        android:layout_width="match_parent"
218                        android:layout_height="wrap_content"
219                        android:orientation="vertical"
220                        android:padding="@dimen/card_padding_regular">
221
222                        <RelativeLayout
223                            android:layout_width="match_parent"
224                            android:layout_height="wrap_content">
225
226                            <TextView
227                                android:text="Store media only in cache"
228                                android:layout_width="wrap_content"
229                                android:layout_height="wrap_content"
230                                android:layout_alignParentStart="true"
231                                android:layout_centerVertical="true"
232                                android:singleLine="true"
233                                android:textAppearance="?textAppearanceBodyMedium" />
234
235                            <androidx.appcompat.widget.SwitchCompat
236                                android:id="@+id/store_in_cache"
237                                android:layout_width="wrap_content"
238                                android:layout_height="wrap_content"
239                                android:layout_alignParentEnd="true"
240                                android:layout_centerVertical="true"
241                                android:focusable="false" />
242
243                        </RelativeLayout>
244
245                        <androidx.recyclerview.widget.RecyclerView
246                            android:id="@+id/media"
247                            android:layout_width="match_parent"
248                            android:layout_height="wrap_content"
249                            android:layout_margin="-2dp"
250                            android:orientation="horizontal" />
251
252                        <LinearLayout
253                            android:layout_width="wrap_content"
254                            android:layout_height="match_parent"
255                            android:layout_gravity="end"
256                            android:layout_marginTop="16dp"
257                            android:orientation="horizontal">
258
259                            <Button
260                                android:id="@+id/show_media"
261                                style="?attr/materialButtonOutlinedStyle"
262                                android:layout_width="wrap_content"
263                                android:layout_height="wrap_content"
264                                android:text="@string/view_media" />
265                        </LinearLayout>
266                    </LinearLayout>
267                </com.google.android.material.card.MaterialCardView>
268
269                <com.google.android.material.card.MaterialCardView
270                    android:id="@+id/keys_wrapper"
271                    android:layout_width="fill_parent"
272                    android:layout_height="wrap_content"
273                    android:layout_marginLeft="@dimen/activity_horizontal_margin"
274                    android:layout_marginTop="@dimen/activity_vertical_margin"
275                    android:layout_marginRight="@dimen/activity_horizontal_margin"
276                    android:layout_marginBottom="@dimen/activity_vertical_margin">
277
278                    <LinearLayout
279                        android:layout_width="match_parent"
280                        android:layout_height="wrap_content"
281                        android:orientation="vertical">
282
283                        <LinearLayout
284                            android:id="@+id/details_contact_keys"
285                            android:layout_width="match_parent"
286                            android:layout_height="wrap_content"
287                            android:orientation="vertical"
288                            android:padding="@dimen/card_padding_list" />
289
290                        <LinearLayout
291                            android:id="@+id/unverified_warning"
292                            android:layout_width="match_parent"
293                            android:layout_height="wrap_content"
294                            android:paddingHorizontal="@dimen/card_padding_list">
295
296                            <TextView
297                                android:layout_width="wrap_content"
298                                android:layout_height="wrap_content"
299                                android:layout_marginHorizontal="@dimen/list_padding"
300                                android:text="@string/contact_uses_unverified_keys"
301                                android:textAppearance="?textAppearanceBodyMedium"
302                                android:textColor="?colorOnSurfaceVariant" />
303                        </LinearLayout>
304
305                        <LinearLayout
306                            android:layout_width="wrap_content"
307                            android:layout_height="match_parent"
308                            android:layout_marginTop="8dp"
309                            android:orientation="horizontal"
310                            android:padding="@dimen/card_padding_list">
311
312
313                            <Button
314                                android:id="@+id/scan_button"
315                                style="@style/Widget.Material3.Button.TextButton"
316                                android:layout_width="wrap_content"
317                                android:layout_height="wrap_content"
318                                android:text="@string/scan_qr_code" />
319
320                            <Button
321                                android:id="@+id/show_inactive_devices"
322                                style="@style/Widget.Material3.Button.TextButton"
323                                android:layout_width="wrap_content"
324                                android:layout_height="wrap_content"
325                                android:text="@string/show_inactive_devices" />
326                        </LinearLayout>
327                    </LinearLayout>
328                </com.google.android.material.card.MaterialCardView>
329            </LinearLayout>
330        </ScrollView>
331    </LinearLayout>
332</layout>