<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:id="@+id/toolbar_big"
        android:layout_width="match_parent"
        android:layout_height="@dimen/huge_toolbar"
        android:elevation="4dp"
        android:background="?attr/colorPrimary"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/view_key_photo"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@+id/status_bar"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:src="@drawable/ic_launcher"
            android:baselineAlignBottom="false"
            android:cropToPadding="false"
            android:focusable="false"
            android:adjustViewBounds="false"
            android:layout_alignParentTop="false"
            android:scaleType="centerCrop" />

        <ImageView
            android:id="@+id/status_bar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/statusbar_height"
            android:background="?attr/colorPrimary" />

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:background="@color/transparent"
            android:layout_below="@+id/status_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="?attr/actionBarSize"
            android:overScrollMode="always"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            tools:ignore="UnusedAttribute"
            android:transitionGroup="false"
            android:touchscreenBlocksFocus="false" />

        <TextView
            android:id="@+id/view_key_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="48dp"
            android:layout_marginStart="48dp"
            android:layout_marginRight="48dp"
            android:layout_marginEnd="48dp"
            android:text=""
            tools:text="Alice Skywalker"
            android:textColor="@color/icons"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:layout_above="@+id/view_key_status" />

        <TextView
            android:id="@+id/view_key_status"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="48dp"
            android:layout_marginStart="48dp"
            android:layout_marginRight="48dp"
            android:layout_marginEnd="48dp"
            android:text=""
            tools:text="My Key"
            android:textColor="?attr/colorTabText"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:layout_above="@+id/toolbar2" />

        <LinearLayout
            android:id="@+id/toolbar2"
            android:orientation="horizontal"
            android:layout_alignParentBottom="true"
            android:layout_width="wrap_content"
            android:minHeight="?attr/actionBarSize"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_marginLeft="32dp"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true">

            <ImageButton
                android:id="@+id/view_key_action_encrypt_files"
                android:layout_width="64dp"
                android:layout_height="64dp"
                android:visibility="invisible"
                tools:visibility="visible"
                style="?android:attr/borderlessButtonStyle"
                android:src="@drawable/ic_action_encrypt_file_24dp" />

            <ImageButton
                android:id="@+id/view_key_action_encrypt_text"
                android:layout_width="64dp"
                android:layout_height="64dp"
                android:visibility="invisible"
                tools:visibility="visible"
                style="?android:attr/borderlessButtonStyle"
                android:src="@drawable/ic_action_encrypt_text_24dp" />

            <ImageButton
                android:id="@+id/view_key_action_nfc"
                android:layout_width="64dp"
                android:layout_height="64dp"
                android:visibility="invisible"
                tools:visibility="visible"
                style="?android:attr/borderlessButtonStyle"
                android:src="@drawable/ic_nfc_white_24dp" />

        </LinearLayout>

        <ImageView
            android:id="@+id/view_key_status_image"
            android:layout_width="96dp"
            android:visibility="invisible"
            tools:visibility="visible"
            android:src="@drawable/status_signature_unverified_cutout_96dp"
            android:layout_height="96dp"
            android:layout_above="@id/toolbar2"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_marginRight="16dp" />

        <android.support.v7.widget.CardView
            android:id="@+id/view_key_qr_code_layout"
            android:transitionName="qr_code"
            android:visibility="visible"
            android:layout_above="@id/toolbar2"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_marginRight="20dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:foreground="?android:attr/selectableItemBackground"
            tools:visibility="invisible"
            card_view:cardBackgroundColor="@android:color/white"
            card_view:cardElevation="2dp"
            card_view:cardUseCompatPadding="true"
            card_view:cardCornerRadius="4dp">

            <ImageView
                android:id="@+id/view_key_qr_code"
                android:layout_width="96dp"
                android:layout_height="96dp"
                />
        </android.support.v7.widget.CardView>

    </RelativeLayout>

    <LinearLayout
        android:id="@+id/body"
        android:layout_below="@id/toolbar_big"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <View
            android:layout_width="match_parent"
            android:layout_height="1dip"
            android:background="?android:attr/listDivider"
            android:visibility="gone"
            android:id="@+id/view_key_status_divider" />

        <FrameLayout
            android:id="@+id/content_frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <FrameLayout
                android:id="@+id/view_key_fragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" />

        </FrameLayout>
    </LinearLayout>

    <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab"
        android:layout_alignBottom="@id/toolbar_big"
        android:layout_alignParentRight="true"
        android:layout_marginRight="20dp"
        android:layout_marginBottom="-40dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="invisible"
        tools:visibility="visible"
        android:elevation="4dp"
        fab:fab_icon="@drawable/ic_qrcode_white_24dp"
        fab:fab_colorNormal="?attr/colorFab"
        fab:fab_colorPressed="?attr/colorFabPressed" />

</RelativeLayout>
