<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:viewBindingIgnore="true">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/linkpreview_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/signal_neutralSurface"
        android:padding="6dp">

        <ViewStub
            android:id="@+id/linkpreview_thumbnail"
            android:layout_width="72dp"
            android:layout_height="72dp"
            android:layout="@layout/link_preview_thumbnail_stub"
            app:layout_constraintBottom_toTopOf="@+id/linkpreview_divider"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/linkpreview_title" />

        <org.thoughtcrime.securesms.components.emoji.EmojiTextView
            android:id="@+id/linkpreview_title"
            style="@style/Signal.Text.LabelLarge"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:ellipsize="end"
            android:maxLines="2"
            android:textColor="?attr/colorOnSurface"
            app:layout_constraintEnd_toStartOf="@+id/linkpreview_close"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/linkpreview_thumbnail"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="J. Jonah Jameson on Twitter" />

        <org.thoughtcrime.securesms.components.emoji.EmojiTextView
            android:id="@+id/linkpreview_description"
            style="@style/Signal.Text.BodyMedium"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:ellipsize="end"
            android:maxLines="15"
            android:textColor="?attr/colorOnSurfaceVariant"
            android:textSize="13sp"
            app:layout_constraintEnd_toStartOf="@+id/linkpreview_close"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/linkpreview_thumbnail"
            app:layout_constraintTop_toBottomOf="@id/linkpreview_title"
            tools:text="Wall crawler strikes again!" />

        <org.thoughtcrime.securesms.components.emoji.EmojiTextView
            android:id="@+id/linkpreview_site"
            style="@style/Signal.Text.MaterialCaption"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="2dp"
            android:maxLines="2"
            android:textColor="?attr/colorOnSurfaceVariant"
            app:layout_constraintStart_toEndOf="@+id/linkpreview_thumbnail"
            app:layout_constraintTop_toBottomOf="@+id/linkpreview_description"
            tools:text="dailybugle.com" />

        <View
            android:id="@+id/linkpreview_divider"
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="6dp"
            android:background="@color/signal_divider_major"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/linkpreview_thumbnail"
            app:layout_constraintTop_toBottomOf="@+id/linkpreview_content_barrier"
            app:layout_constraintVertical_bias="0.0"
            tools:visibility="visible" />

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/linkpreview_close"
            android:layout_width="18dp"
            android:layout_height="18dp"
            android:layout_marginTop="4dp"
            android:layout_marginEnd="6dp"
            android:src="@drawable/symbol_x_24"
            android:tint="?attr/signal_icon_tint_secondary"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:visibility="visible" />

        <com.pnikosis.materialishprogress.ProgressWheel
            android:id="@+id/linkpreview_progress_wheel"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginBottom="8dp"
            android:indeterminate="true"
            android:padding="8dp"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@+id/linkpreview_no_preview"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/linkpreview_no_preview"
            app:matProg_barColor="@color/core_ultramarine"
            app:matProg_barWidth="3dp"
            app:matProg_progressIndeterminate="true" />

        <TextView
            android:id="@+id/linkpreview_no_preview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:paddingTop="12dp"
            android:paddingBottom="12dp"
            android:textAppearance="@style/Signal.Text.BodyMedium"
            android:visibility="gone"
            app:layout_constraintBottom_toTopOf="@id/linkpreview_divider"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="@string/LinkPreviewView_no_link_preview_available" />

        <androidx.constraintlayout.widget.Barrier
            android:id="@+id/linkpreview_content_barrier"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:barrierDirection="bottom"
            app:constraint_referenced_ids="linkpreview_thumbnail,linkpreview_close,linkpreview_title,linkpreview_description,linkpreview_site,linkpreview_progress_wheel,linkpreview_no_preview" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</merge>