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