<?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:id="@+id/call_holder"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/caller_avatar"
        android:layout_width="@dimen/incoming_call_avatar_size"
        android:layout_height="@dimen/incoming_call_avatar_size"
        android:contentDescription="@null"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.08"
        tools:src="@drawable/ic_call_accept" />

    <com.simplemobiletools.commons.views.MyTextView
        android:id="@+id/caller_name_label"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/normal_margin"
        android:gravity="center_horizontal"
        android:paddingStart="@dimen/medium_margin"
        android:paddingEnd="@dimen/medium_margin"
        android:textSize="@dimen/caller_name_text_size"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/caller_avatar"
        tools:text="Caller name" />

    <com.simplemobiletools.commons.views.MyTextView
        android:id="@+id/caller_number"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/normal_margin"
        android:gravity="center_horizontal"
        android:textSize="@dimen/call_status_text_size"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/caller_name_label"
        tools:text="0912 345 678" />

    <com.simplemobiletools.commons.views.MyTextView
        android:id="@+id/call_status_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/normal_margin"
        android:alpha="0.8"
        android:textSize="@dimen/call_status_text_size"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/caller_number"
        tools:text="Is Calling" />

    <TextView
        android:id="@+id/hold_status_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/small_margin"
        android:alpha="0.8"
        android:text="@string/call_on_hold"
        android:textColor="@color/md_red"
        android:textSize="@dimen/call_status_text_size"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/call_status_label"
        tools:visibility="visible" />

    <ImageView
        android:id="@+id/call_sim_image"
        android:layout_width="@dimen/normal_icon_size"
        android:layout_height="0dp"
        android:alpha="0.8"
        android:background="?selectableItemBackgroundBorderless"
        android:src="@drawable/ic_sim_vector"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@+id/call_status_label"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/call_status_label"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintHorizontal_chainStyle="packed"
        app:layout_constraintStart_toEndOf="@+id/call_status_label"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/call_status_label" />

    <TextView
        android:id="@+id/call_sim_id"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:alpha="0.8"
        android:gravity="center"
        android:textColor="@color/md_grey_black"
        android:textSize="@dimen/bigger_text_size"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@+id/call_sim_image"
        app:layout_constraintEnd_toEndOf="@+id/call_sim_image"
        app:layout_constraintStart_toStartOf="@+id/call_sim_image"
        app:layout_constraintTop_toTopOf="@+id/call_sim_image"
        tools:text="1" />

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/on_hold_status_holder"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:background="@color/cardview_shadow_start_color"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:visibility="visible">

        <ImageView
            android:id="@+id/imageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/normal_margin"
            android:contentDescription="@null"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/ic_phone_vector" />

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/on_hold_caller_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/normal_margin"
            android:ellipsize="end"
            android:maxLines="1"
            android:textSize="@dimen/call_status_text_size"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/on_hold_label"
            app:layout_constraintStart_toEndOf="@+id/imageView"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="0912 345 678" />

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/on_hold_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/normal_margin"
            android:text="@string/call_on_hold"
            android:textSize="@dimen/call_status_text_size"
            app:layout_constraintBottom_toBottomOf="@+id/imageView"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@+id/imageView" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/ongoing_call_holder"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone"
        tools:visibility="visible">

        <ImageView
            android:id="@+id/call_toggle_microphone"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:background="@drawable/circle_background"
            android:contentDescription="@string/turn_microphone_off"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_microphone_off_vector"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/call_toggle_speaker"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.63" />

        <ImageView
            android:id="@+id/call_toggle_speaker"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:background="@drawable/circle_background"
            android:contentDescription="@string/turn_speaker_on"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_volume_up_vector"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/call_dialpad"
            app:layout_constraintStart_toEndOf="@+id/call_toggle_microphone"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.63" />

        <ImageView
            android:id="@+id/call_dialpad"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:background="@drawable/circle_button_background_ripple"
            android:contentDescription="@string/show_dialpad"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_dialpad_vector"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/call_toggle_speaker"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.63" />

        <ImageView
            android:id="@+id/call_toggle_hold"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:layout_marginTop="@dimen/big_margin"
            android:background="@drawable/circle_background"
            android:contentDescription="@string/hold_call"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_pause_vector"
            app:layout_constraintEnd_toEndOf="@+id/call_toggle_microphone"
            app:layout_constraintStart_toStartOf="@+id/call_toggle_microphone"
            app:layout_constraintTop_toBottomOf="@+id/call_toggle_microphone" />

        <ImageView
            android:id="@+id/call_add"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:layout_marginTop="@dimen/big_margin"
            android:background="@drawable/circle_button_background_ripple"
            android:contentDescription="@string/call_add"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_add_call_vector"
            app:layout_constraintEnd_toEndOf="@+id/call_toggle_speaker"
            app:layout_constraintStart_toStartOf="@+id/call_toggle_speaker"
            app:layout_constraintTop_toBottomOf="@+id/call_toggle_speaker" />

        <ImageView
            android:id="@+id/call_manage"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:layout_marginTop="@dimen/big_margin"
            android:background="@drawable/circle_button_background_ripple"
            android:contentDescription="@string/conference_manage"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_people_vector"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="@+id/call_dialpad"
            app:layout_constraintStart_toStartOf="@+id/call_dialpad"
            app:layout_constraintTop_toBottomOf="@+id/call_dialpad"
            tools:visibility="visible" />

        <ImageView
            android:id="@+id/call_swap"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:layout_marginTop="@dimen/big_margin"
            android:background="@drawable/circle_button_background_ripple"
            android:contentDescription="@string/call_swap"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_call_swap_vector"
            app:layout_constraintEnd_toEndOf="@+id/call_toggle_microphone"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="@+id/call_toggle_microphone"
            app:layout_constraintTop_toBottomOf="@+id/call_toggle_microphone" />

        <ImageView
            android:id="@+id/call_merge"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:layout_marginTop="@dimen/big_margin"
            android:background="@drawable/circle_button_background_ripple"
            android:contentDescription="@string/call_merge"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_call_merge_vector"
            app:layout_constraintEnd_toEndOf="@+id/call_toggle_speaker"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="@+id/call_toggle_speaker"
            app:layout_constraintTop_toBottomOf="@+id/call_toggle_speaker" />

        <androidx.constraintlayout.widget.Barrier
            android:id="@+id/call_control_grid_barrier"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:barrierDirection="bottom"
            app:constraint_referenced_ids="call_toggle_microphone,call_toggle_speaker,call_dialpad,call_toggle_hold,call_add,call_swap,call_merge,call_manage" />

        <ImageView
            android:id="@+id/call_end"
            android:layout_width="@dimen/dialpad_button_size"
            android:layout_height="@dimen/dialpad_button_size"
            android:contentDescription="@string/end_call"
            android:src="@drawable/ic_call_end"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/call_control_grid_barrier" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/controls_single_call"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"
            app:constraint_referenced_ids="call_toggle_hold,call_add"
            tools:visibility="visible" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/controls_two_calls"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"
            app:constraint_referenced_ids="call_swap,call_merge" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/incoming_call_holder"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone">

        <ImageView
            android:id="@+id/call_decline"
            android:layout_width="@dimen/incoming_call_button_size"
            android:layout_height="@dimen/incoming_call_button_size"
            android:clickable="false"
            android:contentDescription="@string/decline_call"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_call_end"
            app:layout_constraintBottom_toBottomOf="@+id/call_draggable"
            app:layout_constraintEnd_toStartOf="@+id/call_draggable"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/call_draggable"
            app:layout_constraintVertical_bias="0.85" />

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/call_decline_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/normal_margin"
            android:text="@string/decline"
            android:textSize="@dimen/bigger_text_size"
            app:layout_constraintEnd_toEndOf="@+id/call_decline"
            app:layout_constraintStart_toStartOf="@+id/call_decline"
            app:layout_constraintTop_toBottomOf="@+id/call_decline" />

        <ImageView
            android:id="@+id/call_left_arrow"
            android:layout_width="@dimen/incoming_call_arrow_size"
            android:layout_height="@dimen/incoming_call_arrow_size"
            android:layout_marginBottom="@dimen/activity_margin"
            android:alpha="0.2"
            android:contentDescription="@null"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_chevron_left_vector"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/call_accept"
            app:layout_constraintHorizontal_bias="0.15"
            app:layout_constraintStart_toEndOf="@+id/call_decline"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.8375" />

        <ImageView
            android:id="@+id/call_draggable_background"
            android:layout_width="@dimen/incoming_call_button_size"
            android:layout_height="@dimen/incoming_call_button_size"
            android:layout_marginBottom="@dimen/activity_margin"
            android:alpha="0.2"
            android:contentDescription="@null"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/pulsing_background"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/call_accept"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toEndOf="@+id/call_decline"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.85" />

        <ImageView
            android:id="@+id/call_draggable"
            android:layout_width="@dimen/incoming_call_button_size"
            android:layout_height="@dimen/incoming_call_button_size"
            android:layout_marginBottom="@dimen/activity_margin"
            android:contentDescription="@string/decline_call"
            android:padding="@dimen/activity_margin"
            android:src="@drawable/ic_phone_down_vector"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/call_accept"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toEndOf="@+id/call_decline"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.85" />

        <ImageView
            android:id="@+id/call_right_arrow"
            android:layout_width="@dimen/incoming_call_arrow_size"
            android:layout_height="@dimen/incoming_call_arrow_size"
            android:layout_marginBottom="@dimen/activity_margin"
            android:alpha="0.2"
            android:contentDescription="@null"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_chevron_right_vector"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/call_accept"
            app:layout_constraintHorizontal_bias="0.85"
            app:layout_constraintStart_toEndOf="@+id/call_decline"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.8375" />

        <ImageView
            android:id="@+id/call_accept"
            android:layout_width="@dimen/incoming_call_button_size"
            android:layout_height="@dimen/incoming_call_button_size"
            android:clickable="false"
            android:contentDescription="@string/accept_call"
            android:elevation="@dimen/medium_margin"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_call_accept"
            app:layout_constraintBottom_toBottomOf="@+id/call_draggable"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toEndOf="@+id/call_draggable"
            app:layout_constraintTop_toTopOf="@+id/call_draggable"
            app:layout_constraintVertical_bias="0.85" />

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/call_accept_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/normal_margin"
            android:elevation="@dimen/medium_margin"
            android:text="@string/accept"
            android:textSize="@dimen/bigger_text_size"
            app:layout_constraintEnd_toEndOf="@+id/call_accept"
            app:layout_constraintStart_toStartOf="@+id/call_accept"
            app:layout_constraintTop_toBottomOf="@+id/call_accept" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <LinearLayout
        android:id="@+id/dialpad_wrapper"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="@dimen/medium_margin"
        android:orientation="vertical"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <RelativeLayout
            android:id="@+id/dialpad_input_holder"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.simplemobiletools.commons.views.MyEditText
                android:id="@+id/dialpad_input"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dialpad_button_size"
                android:layout_marginEnd="@dimen/medium_margin"
                android:layout_toStartOf="@+id/dialpad_close"
                android:gravity="center"
                android:inputType="phone"
                android:textCursorDrawable="@null"
                android:textSize="@dimen/dialpad_text_size" />

            <ImageView
                android:id="@+id/dialpad_close"
                android:layout_width="@dimen/normal_icon_size"
                android:layout_height="@dimen/normal_icon_size"
                android:layout_alignTop="@+id/dialpad_input"
                android:layout_alignBottom="@+id/dialpad_input"
                android:layout_alignParentEnd="true"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_margin"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:contentDescription="@string/hide_dialpad"
                android:elevation="@dimen/medium_margin"
                android:padding="@dimen/medium_margin"
                android:src="@drawable/ic_cross_vector" />

        </RelativeLayout>

        <include
            android:id="@+id/dialpad_include"
            layout="@layout/dialpad" />

    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
