<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:fillViewport="true"
        app:layout_constraintBottom_toTopOf="@id/insights_dashboard_this_stat_was_generated_locally"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false"
            android:paddingTop="?actionBarSize">

            <com.airbnb.lottie.LottieAnimationView
                android:id="@+id/insights_dashboard_lottie_animation"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:visibility="gone"
                app:layout_constraintBottom_toBottomOf="@id/insights_dashboard_progress"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="@id/insights_dashboard_progress"
                app:lottie_rawRes="@raw/lottie_insights_100" />

            <org.thoughtcrime.securesms.components.ArcProgressBar
                android:id="@+id/insights_dashboard_progress"
                style="@style/Widget.Signal.ArcProgressBar"
                android:layout_width="187dp"
                android:layout_height="187dp"
                android:layout_marginTop="8dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <org.thoughtcrime.securesms.components.AvatarImageView
                android:id="@+id/insights_dashboard_avatar"
                android:layout_width="140dp"
                android:layout_height="140dp"
                app:layout_constraintBottom_toBottomOf="@id/insights_dashboard_progress"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="@id/insights_dashboard_progress" />

            <LinearLayout
                android:id="@+id/insights_dashboard_percent_container"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                app:layout_constrainedWidth="true"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_chainStyle="packed"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/insights_dashboard_avatar">

                <TextView
                    android:id="@+id/insights_dashboard_percent_secure"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:textAppearance="@style/TextAppearance.Signal.Headline.Insights"
                    tools:text="100" />

                <TextView
                    android:id="@+id/insights_dashboard_percent"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:layout_marginBottom="1dp"
                    android:gravity="center"
                    android:text="@string/Insights__percent"
                    android:textAppearance="@style/TextAppearance.Signal.SubHead.Insights" />
            </LinearLayout>

            <TextView
                android:id="@+id/insights_dashboard_encrypted_messages"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="2dp"
                android:text="@string/InsightsDashboardFragment__encrypted_messages"
                android:textAppearance="@style/TextAppearance.Signal.SubHead.Insights"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/insights_dashboard_percent_container" />

            <TextView
                android:id="@+id/insights_dashboard_tagline"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="16dp"
                android:gravity="center"
                android:lineSpacingMultiplier="1.2"
                android:textAppearance="@style/TextAppearance.Signal.Body.Insights"
                app:layout_constrainedWidth="true"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/insights_dashboard_encrypted_messages"
                tools:text="100% of your outgoing messages in the past 7 days were end-to-end encrypted with Signal Protocol." />

            <Button
                android:id="@+id/insights_dashboard_start_a_conversation"
                style="@style/Button.Borderless"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="22dp"
                android:layout_marginEnd="16dp"
                android:text="@string/InsightsDashboardFragment__start_a_conversation"
                android:textAppearance="@style/TextAppearance.Signal.Caption.Insights"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/insights_dashboard_tagline" />

            <TextView
                android:id="@+id/insights_dashboard_make_signal_secure"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="24dp"
                android:gravity="center"
                android:text="@string/InsightsDashboardFragment__spread_the_word"
                android:textAppearance="@style/TextAppearance.Signal.SubHead.Insights"
                app:layout_constrainedWidth="true"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/insights_dashboard_tagline" />

            <TextView
                android:id="@+id/insights_dashboard_invite_your_contacts"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="16dp"
                android:gravity="center"
                android:lineSpacingMultiplier="1.2"
                android:text="@string/InsightsDashboardFragment__invite_your_contacts"
                android:textAppearance="@style/TextAppearance.Signal.Body.Insights"
                app:layout_constrainedWidth="true"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/insights_dashboard_make_signal_secure" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/insights_dashboard_recycler"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                app:layout_constrainedHeight="true"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/insights_dashboard_invite_your_contacts"
                tools:itemCount="10"
                tools:listitem="@layout/insights_dashboard_adapter_item" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.core.widget.NestedScrollView>

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/insights_dashboard_toolbar"
        style="?actionBarStyle"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?android:windowBackground"
        android:theme="?actionBarStyle"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navigationIcon="@drawable/ic_x_tinted"
        app:title="@string/InsightsDashboardFragment__title" />

    <TextView
        android:id="@+id/insights_dashboard_this_stat_was_generated_locally"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/signal_background_secondary"
        android:gravity="center"
        android:lineSpacingMultiplier="1.2"
        android:paddingStart="16dp"
        android:paddingTop="24dp"
        android:paddingEnd="16dp"
        android:paddingBottom="24dp"
        android:text="@string/InsightsDashboardFragment__this_stat_was_generated_locally"
        android:textAppearance="@style/TextAppearance.Signal.Body2.Insights"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>