<?xml version="1.0" encoding="utf-8"?>

<ScrollView
    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.constraintlayout.widget.ConstraintLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navigationIcon="@drawable/ic_arrow_left_24"
        app:title="@string/CreateProfileActivity__profile" />

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/manage_profile_avatar_background"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_marginTop="16dp"
        android:src="@drawable/circle_tintable"
        android:tint="@color/core_grey_05"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/toolbar"
        app:layout_goneMarginTop="?attr/actionBarSize" />

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/manage_profile_avatar_placeholder"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:tint="@color/core_grey_75"
        app:layout_constraintBottom_toBottomOf="@+id/manage_profile_avatar_background"
        app:layout_constraintEnd_toEndOf="@+id/manage_profile_avatar_background"
        app:layout_constraintStart_toStartOf="@+id/manage_profile_avatar_background"
        app:layout_constraintTop_toTopOf="@+id/manage_profile_avatar_background"
        app:srcCompat="@drawable/ic_profile_outline_40" />

    <org.thoughtcrime.securesms.components.emoji.EmojiTextView
        android:id="@+id/manage_profile_avatar_initials"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:fontFamily="sans-serif-medium"
        android:gravity="center"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@id/manage_profile_avatar_background"
        app:layout_constraintEnd_toEndOf="@id/manage_profile_avatar_background"
        app:layout_constraintStart_toStartOf="@id/manage_profile_avatar_background"
        app:layout_constraintTop_toTopOf="@id/manage_profile_avatar_background"
        tools:ignore="SpUsage"
        tools:text="AF"
        tools:visibility="visible" />

    <ImageView
        android:id="@+id/manage_profile_avatar"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:contentDescription="@string/CreateProfileActivity_set_avatar_description"
        app:layout_constraintBottom_toBottomOf="@+id/manage_profile_avatar_background"
        app:layout_constraintEnd_toEndOf="@+id/manage_profile_avatar_background"
        app:layout_constraintStart_toStartOf="@+id/manage_profile_avatar_background"
        app:layout_constraintTop_toTopOf="@+id/manage_profile_avatar_background" />

      <org.thoughtcrime.securesms.badges.BadgeImageView
          android:id="@+id/manage_profile_badge"
          android:layout_width="36dp"
          android:layout_height="36dp"
          android:layout_marginStart="44dp"
          android:layout_marginTop="52dp"
          app:badge_size="large"
          app:layout_constraintStart_toStartOf="@+id/manage_profile_avatar_background"
          app:layout_constraintTop_toTopOf="@+id/manage_profile_avatar_background" />

      <TextView
          android:id="@+id/manage_profile_edit_photo"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="@dimen/dsl_settings_gutter"
          android:layout_marginTop="14dp"
          android:layout_marginEnd="@dimen/dsl_settings_gutter"
          android:background="@drawable/rounded_rectangle_tertiary"
          android:paddingStart="21dp"
          android:paddingTop="7dp"
          android:paddingEnd="21dp"
          android:paddingBottom="7dp"
          android:text="@string/ManageProfileFragment__edit_photo"
          android:textAppearance="@style/TextAppearance.Signal.Body2.Bold"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@id/manage_profile_avatar_background" />

      <androidx.constraintlayout.widget.ConstraintLayout
          android:id="@+id/manage_profile_name_container"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="20dp"
          android:background="?selectableItemBackground"
          android:paddingStart="@dimen/dsl_settings_gutter"
          android:paddingTop="16dp"
          android:paddingEnd="@dimen/dsl_settings_gutter"
          android:paddingBottom="16dp"
          app:layout_constraintTop_toBottomOf="@id/manage_profile_edit_photo">

      <ImageView
          android:id="@+id/manage_profile_name_icon"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          app:srcCompat="@drawable/ic_profile_name_24"
          app:tint="@color/signal_text_primary"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="@id/manage_profile_name"
          app:layout_constraintBottom_toBottomOf="@id/manage_profile_name_subtitle"/>

      <org.thoughtcrime.securesms.components.emoji.EmojiTextView
          android:id="@+id/manage_profile_name"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginStart="24dp"
          style="@style/Signal.Text.Body"
          android:textAlignment="viewStart"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintStart_toEndOf="@id/manage_profile_name_icon"
          app:layout_constraintEnd_toEndOf="parent"
          tools:text="Peter Parker"/>

      <TextView
          android:id="@+id/manage_profile_name_subtitle"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          style="@style/Signal.Text.Preview"
          android:text="@string/ManageProfileFragment_your_name"
          android:textColor="@color/signal_text_secondary"
          app:layout_constraintTop_toBottomOf="@id/manage_profile_name"
          app:layout_constraintStart_toStartOf="@id/manage_profile_name"
          app:layout_constraintEnd_toEndOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/manage_profile_username_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/dsl_settings_gutter"
        android:paddingEnd="@dimen/dsl_settings_gutter"
        android:paddingTop="16dp"
        android:paddingBottom="16dp"
        android:background="?selectableItemBackground"
        app:layout_constraintTop_toBottomOf="@id/manage_profile_name_container">

      <ImageView
          android:id="@+id/manage_profile_username_icon"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          app:srcCompat="@drawable/ic_at_24"
          app:tint="@color/signal_text_primary"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="@id/manage_profile_username"
          app:layout_constraintBottom_toBottomOf="@id/manage_profile_username_subtitle"/>

      <org.thoughtcrime.securesms.components.emoji.EmojiTextView
          android:id="@+id/manage_profile_username"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginStart="24dp"
          style="@style/Signal.Text.Body"
          android:textAlignment="viewStart"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintStart_toEndOf="@id/manage_profile_username_icon"
          app:layout_constraintEnd_toEndOf="parent"
          tools:text="\@spiderman"/>

      <TextView
          android:id="@+id/manage_profile_username_subtitle"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          style="@style/Signal.Text.Preview"
          android:text="@string/ManageProfileFragment_your_username"
          android:textColor="@color/signal_text_secondary"
          app:layout_constraintTop_toBottomOf="@id/manage_profile_username"
          app:layout_constraintStart_toStartOf="@id/manage_profile_username"
          app:layout_constraintEnd_toEndOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/manage_profile_about_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/dsl_settings_gutter"
        android:paddingEnd="@dimen/dsl_settings_gutter"
        android:paddingTop="16dp"
        android:paddingBottom="16dp"
        android:background="?selectableItemBackground"
        app:layout_constraintTop_toBottomOf="@id/manage_profile_username_container">

      <androidx.appcompat.widget.AppCompatImageView
          android:id="@+id/manage_profile_about_icon"
          android:layout_width="24dp"
          android:layout_height="24dp"
          android:scaleType="fitCenter"
          app:srcCompat="@drawable/ic_compose_24"
          app:tint="@color/signal_text_primary"
          app:layout_constraintTop_toTopOf="@id/manage_profile_about"
          app:layout_constraintBottom_toBottomOf="@id/manage_profile_about_subtitle"
          app:layout_constraintStart_toStartOf="parent"/>

      <org.thoughtcrime.securesms.components.emoji.EmojiTextView
          android:id="@+id/manage_profile_about"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginStart="24dp"
          style="@style/Signal.Text.Body"
          android:textAlignment="viewStart"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintStart_toEndOf="@id/manage_profile_about_icon"
          app:layout_constraintEnd_toEndOf="parent"
          app:emoji_forceCustom="true"
          tools:text="Photographer for the Daily Bugle"/>

      <TextView
          android:id="@+id/manage_profile_about_subtitle"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          style="@style/Signal.Text.Preview"
          android:text="@string/ManageProfileFragment_write_a_few_words_about_yourself"
          android:textColor="@color/signal_text_secondary"
          app:layout_constraintTop_toBottomOf="@id/manage_profile_about"
          app:layout_constraintStart_toStartOf="@id/manage_profile_about"
          app:layout_constraintEnd_toEndOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/manage_profile_badges_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/dsl_settings_gutter"
        android:paddingEnd="@dimen/dsl_settings_gutter"
        android:paddingTop="16dp"
        android:paddingBottom="16dp"
        android:background="?selectableItemBackground"
        app:layout_constraintTop_toBottomOf="@id/manage_profile_about_container">

      <androidx.appcompat.widget.AppCompatImageView
          android:id="@+id/manage_profile_badges_icon"
          android:layout_width="24dp"
          android:layout_height="24dp"
          android:scaleType="fitCenter"
          app:srcCompat="@drawable/ic_badge_24"
          app:tint="@color/signal_text_primary"
          app:layout_constraintTop_toTopOf="@id/manage_profile_badges"
          app:layout_constraintBottom_toBottomOf="@id/manage_profile_badges"
          app:layout_constraintStart_toStartOf="parent"/>

      <org.thoughtcrime.securesms.components.emoji.EmojiTextView
          android:id="@+id/manage_profile_badges"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginStart="24dp"
          style="@style/Signal.Text.Body"
          android:textAlignment="viewStart"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintStart_toEndOf="@id/manage_profile_badges_icon"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintBottom_toBottomOf="parent"
          android:text="@string/ManageProfileFragment_badges"
          app:emoji_forceCustom="true" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <org.thoughtcrime.securesms.util.views.LearnMoreTextView
        android:id="@+id/description_text"
        style="@style/Signal.Text.Preview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="33dp"
        android:layout_marginBottom="16dp"
        android:padding="@dimen/dsl_settings_gutter"
        android:text="@string/CreateProfileActivity_signal_profiles_are_end_to_end_encrypted"
        android:textColor="@color/signal_text_secondary"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/manage_profile_badges_container"
        app:layout_constraintVertical_bias="1.0" />

  </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>
