<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    android:id="@+id/card_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="4dp"
    custom:cardBackgroundColor="?attr/colorCardViewBackground"
    custom:cardElevation="2dp"
    custom:cardUseCompatPadding="true"
    custom:cardCornerRadius="4dp"
    >

    <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="4dp"
        android:paddingBottom="4dp"
        android:paddingRight="8dp"
        android:paddingLeft="8dp"
        android:inAnimation="@anim/fade_in"
        android:outAnimation="@anim/fade_out"
        android:id="@+id/view_animator"
        android:measureAllChildren="false"
        custom:initialView="1"
        android:minHeight="?listPreferredItemHeightSmall"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:orientation="horizontal">

            <ProgressBar
                android:id="@+id/progress"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:padding="4dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/progress_msg"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="8dp"
                android:layout_marginStart="8dp"
                android:layout_gravity="center_vertical"
                android:text="@string/progress_processing"
                android:textAppearance="?android:attr/textAppearanceMedium"
                />

        </LinearLayout>
        <!-- -->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:layout_marginBottom="4dp"
                android:gravity="center_vertical"
                tools:ignore="UseCompoundDrawables">

                <ImageView
                    android:id="@+id/result_encryption_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="4dp"
                    android:src="@drawable/status_lock_open_24dp"
                    />

                <TextView
                    android:id="@+id/result_encryption_text"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_marginLeft="6dp"
                    android:text=""
                    tools:text="Encryption status text" />

                <ImageView
                    android:id="@+id/context_menu"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="4dp"
                    android:scaleType="center"
                    android:clickable="true"
                    android:background="?attr/selectableItemBackgroundBorderless"
                    android:src="@drawable/ic_more_vert_black_24dp" />

            </LinearLayout>

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:layout_marginBottom="4dp"
                android:gravity="center_vertical"
                tools:ignore="UseCompoundDrawables">

                <ImageView
                    android:id="@+id/result_signature_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:padding="4dp"
                    android:src="@drawable/status_signature_unverified_cutout_24dp"
                    />

                <TextView
                    android:id="@+id/result_signature_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_marginLeft="6dp"
                    android:text=""
                    tools:text="Signature status text" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/result_signature_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="2dp"
                android:layout_marginBottom="2dp"
                android:clickable="true"
                android:background="?android:selectableItemBackground"
                android:orientation="horizontal"
                android:minHeight="40dp"
                >

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:paddingRight="4dp"
                    android:paddingLeft="4dp"
                    android:layout_gravity="center_vertical"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/result_signature_name"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text=""
                        tools:text="Alice" />

                    <TextView
                        android:id="@+id/result_signature_email"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:text=""
                        android:singleLine="true"
                        android:ellipsize="end"
                        tools:text="alice@example.com" />

                </LinearLayout>

                <View
                    android:layout_width="1dip"
                    android:layout_height="match_parent"
                    android:gravity="right"
                    android:layout_marginBottom="8dp"
                    android:layout_marginTop="8dp"
                    android:background="?android:attr/listDivider" />

                <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:paddingLeft="8dp"
                    android:paddingRight="8dp"
                    android:id="@+id/result_signature_action"
                    android:measureAllChildren="true"
                    android:inAnimation="@anim/fade_in"
                    android:outAnimation="@anim/fade_out"
                    custom:initialView="0"
                    >

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:drawableRight="@drawable/ic_vpn_key_grey_24dp"
                        android:drawablePadding="8dp"
                        android:text="@string/decrypt_result_action_show"
                        />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:drawableRight="@drawable/ic_file_download_grey_24dp"
                        android:drawablePadding="8dp"
                        android:text="@string/decrypt_result_action_Lookup"
                        />

                    <ProgressBar
                        android:layout_width="30dp"
                        android:layout_height="30dp"
                        android:padding="4dp"
                        android:layout_gravity="center" />

                </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>

            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dip"
                tools:layout_height="2dip"
                android:background="?android:attr/listDivider" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/file_list"
                android:orientation="vertical">

                <include layout="@layout/decrypt_list_file_item" />

            </LinearLayout>

        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:ignore="UseCompoundDrawables">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="4dp"
                android:src="@drawable/status_signature_invalid_cutout_24dp"
                android:tint="@color/android_red_light"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/result_error_msg"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:layout_marginLeft="8dp"
                android:layout_marginStart="8dp"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="8dp"
                android:text=""
                android:layout_gravity="center_vertical"
                tools:text="Error processing data!" />

            <ImageView
                android:id="@+id/result_error_log"
                android:scaleType="center"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:clickable="true"
                android:padding="6dp"
                android:background="?android:selectableItemBackground"
                android:src="@drawable/ic_view_list_grey_24dp"
                android:layout_gravity="center_vertical" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:orientation="horizontal">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_marginLeft="8dp"
                android:layout_marginStart="8dp"
                android:layout_gravity="center_vertical"
                android:drawablePadding="12dp"
                android:text="@string/msg_cancelled"
                android:drawableLeft="@drawable/status_signature_invalid_cutout_24dp"
                android:textAppearance="?android:attr/textAppearanceMedium"
                />

            <ImageView
                android:id="@+id/cancel_retry"
                android:scaleType="center"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:clickable="true"
                android:padding="6dp"
                android:background="?android:selectableItemBackground"
                android:src="@drawable/ic_repeat_grey_24dp"
                android:layout_gravity="center_vertical" />

        </LinearLayout>

    </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>

</android.support.v7.widget.CardView>
