account_row.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
 5    <RelativeLayout
 6        android:layout_width="match_parent"
 7        android:layout_height="wrap_content"
 8        android:background="?selectableItemBackground"
 9        android:paddingLeft="8dp"
10        android:paddingBottom="8dp"
11        android:paddingTop="8dp">
12
13        <com.makeramen.roundedimageview.RoundedImageView
14            android:id="@+id/account_image"
15            android:layout_width="48dp"
16            android:layout_height="48dp"
17            android:layout_alignParentLeft="true"
18            android:contentDescription="@string/account_image_description"
19            app:riv_corner_radius="2dp" />
20
21        <LinearLayout
22            android:layout_width="fill_parent"
23            android:layout_height="wrap_content"
24            android:layout_centerVertical="true"
25            android:layout_toRightOf="@+id/account_image"
26            android:orientation="vertical"
27            android:paddingLeft="@dimen/avatar_item_distance"
28            android:layout_toLeftOf="@+id/tgl_account_status"
29            android:layout_toStartOf="@+id/tgl_account_status">
30
31            <TextView
32                android:id="@+id/account_jid"
33                android:layout_width="wrap_content"
34                android:layout_height="wrap_content"
35                android:scrollHorizontally="false"
36                android:singleLine="true"
37                android:textAppearance="@style/TextAppearance.Conversations.Subhead" />
38
39            <TextView
40                android:id="@+id/account_status"
41                android:layout_width="wrap_content"
42                android:layout_height="wrap_content"
43                android:text="@string/account_status_unknown"
44                android:textAppearance="@style/TextAppearance.Conversations.Body2" />
45        </LinearLayout>
46
47        <androidx.appcompat.widget.SwitchCompat
48            android:id="@+id/tgl_account_status"
49            android:layout_width="wrap_content"
50            android:layout_height="wrap_content"
51            android:layout_alignParentRight="true"
52            android:layout_centerVertical="true"
53            android:padding="16dp"
54            android:focusable="false" />
55
56    </RelativeLayout>
57</layout>