<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:minHeight="@dimen/messagelist_item_height"
	android:clickable="true"
	android:focusable="true"
	android:foreground="@drawable/listitem_background_selector">

	<RelativeLayout
		android:id="@+id/session_container"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_marginLeft="@dimen/listitem_message_margin_left_right"
		android:layout_marginRight="@dimen/listitem_message_margin_left_right"
		android:layout_marginTop="16dp"
		android:layout_marginBottom="0dp"
		android:layout_centerVertical="true">

		<FrameLayout
			android:id="@+id/icon_container"
			android:layout_width="@dimen/avatar_size_small"
			android:layout_height="@dimen/avatar_size_small"
			android:layout_centerVertical="true">

			<ImageView
				android:id="@+id/session_browser_icon"
				android:layout_width="@dimen/avatar_size_small"
				android:layout_height="@dimen/avatar_size_small"
				android:visibility="gone"/>

			<ImageView
				android:id="@+id/session_error_icon"
				android:layout_width="@dimen/avatar_size_small"
				android:layout_height="@dimen/avatar_size_small"
				android:src="@drawable/ic_error_red_24dp"
				android:visibility="gone"/>

			<ProgressBar
				android:id="@+id/session_loading"
				android:layout_width="@dimen/avatar_size_small"
				android:layout_height="@dimen/avatar_size_small"
				android:visibility="gone"/>

		</FrameLayout>

		<ImageView
			android:id="@+id/connection_status"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_alignParentRight="true"
			android:layout_centerVertical="true"
			android:src="@drawable/ic_wifi_tethering_black_24dp"/>

		<LinearLayout
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_centerVertical="true"
			android:layout_marginLeft="16dp"
			android:layout_marginRight="16dp"
			android:layout_toLeftOf="@+id/connection_status"
			android:layout_toRightOf="@+id/icon_container"
			android:layout_alignWithParentIfMissing="true"
			android:lineSpacingExtra="-2dp"
			android:orientation="vertical">

			<ch.threema.app.emojis.EmojiTextView
				android:id="@+id/session_name"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:textAppearance="@style/Threema.TextAppearance.List.FirstLine"
				android:text="@string/webclient_unnamed_session"
				android:ellipsize="end"
				android:maxLines="1"
				/>

			<TextView
				android:id="@+id/last_usage"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:textAppearance="@style/Threema.TextAppearance.List.SecondLine"
				android:maxLines="1"
				android:ellipsize="end"
				android:text="@string/webclient_last_usage"/>

			<TextView
				android:id="@+id/created_at"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:textAppearance="@style/Threema.TextAppearance.List.SecondLine.Light"
				android:maxLines="1"
				android:ellipsize="end"
				android:text="@string/webclient_created_at"/>

			<TextView
				android:id="@+id/invalid_push_token"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:textAppearance="@style/Threema.TextAppearance.List.SecondLine.Light"
				android:maxLines="1"
				android:textColor="@color/material_red"
				android:ellipsize="end"
				android:text="@string/webclient_invalid_push_token_message"/>

		</LinearLayout>

	</RelativeLayout>

</RelativeLayout>
