item_account.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    <RelativeLayout
 7        android:layout_width="match_parent"
 8        android:layout_height="wrap_content"
 9        android:background="?selectableItemBackground"
10        android:paddingStart="8dp"
11        android:paddingTop="8dp"
12        android:paddingBottom="8dp">
13
14        <com.makeramen.roundedimageview.RoundedImageView
15            android:id="@+id/account_image"
16            android:layout_width="48dp"
17            android:layout_height="48dp"
18            android:layout_alignParentStart="true"
19            android:contentDescription="@string/account_image_description"
20            app:riv_corner_radius="6dp" />
21
22        <LinearLayout
23            android:layout_width="fill_parent"
24            android:layout_height="wrap_content"
25            android:layout_centerVertical="true"
26            android:layout_marginStart="@dimen/avatar_item_distance"
27            android:layout_toStartOf="@+id/tgl_account_status"
28            android:layout_toEndOf="@+id/account_image"
29            android:orientation="vertical">
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="?textAppearanceBodyLarge"
38                tools:text="juliet@example.com" />
39
40            <TextView
41                android:id="@+id/account_status"
42                android:layout_width="wrap_content"
43                android:layout_height="wrap_content"
44                android:text="@string/account_status_unknown"
45                android:textAppearance="?textAppearanceBodyMedium" />
46        </LinearLayout>
47
48        <com.google.android.material.materialswitch.MaterialSwitch
49            android:id="@+id/tgl_account_status"
50            android:layout_width="wrap_content"
51            android:layout_height="wrap_content"
52            android:layout_alignParentEnd="true"
53            android:layout_centerVertical="true"
54            android:focusable="false"
55            android:padding="16dp" />
56
57    </RelativeLayout>
58</layout>