<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/app_bar_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="?attr/actionBarSize" />

        </com.google.android.material.appbar.AppBarLayout>

        <ScrollView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_above="@+id/button_bar"
            android:layout_below="@id/app_bar_layout">

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

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/key_error_message_card"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/activity_horizontal_margin"
                    android:layout_marginTop="@dimen/activity_vertical_margin"
                    android:layout_marginRight="@dimen/activity_horizontal_margin"
                    android:layout_marginBottom="@dimen/activity_vertical_margin"
                    android:visibility="gone">

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

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="vertical"
                            android:padding="@dimen/card_padding_regular">

                            <TextView
                                android:id="@+id/key_error_message_title"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="8sp"
                                android:text="@string/error_trustkeys_title"
                                android:textAppearance="?textAppearanceTitleLarge" />

                            <TextView
                                android:id="@+id/key_error_message"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?textAppearanceTitleMedium" />

                            <TextView
                                android:id="@+id/key_error_general"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?textAppearanceBodyMedium" />

                            <TextView
                                android:id="@+id/key_error_hint_mutual"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="8sp"
                                android:text="@string/error_trustkey_hint_mutual"
                                android:textAppearance="?textAppearanceBodyMedium"
                                android:textColor="?colorOnSurfaceVariant" />
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="end"
                            android:gravity="end">

                            <Button
                                android:id="@+id/disable_button"
                                style="@style/Widget.Material3.Button.TextButton"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:paddingLeft="16dp"
                                android:paddingRight="16dp"
                                android:text="@string/disable_encryption" />
                        </LinearLayout>
                    </LinearLayout>

                </com.google.android.material.card.MaterialCardView>

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/own_keys_card"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/activity_horizontal_margin"
                    android:layout_marginTop="@dimen/activity_vertical_margin"
                    android:layout_marginRight="@dimen/activity_horizontal_margin"
                    android:layout_marginBottom="@dimen/activity_vertical_margin"
                    android:visibility="gone">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:padding="@dimen/card_padding_list">

                        <TextView
                            android:id="@+id/own_keys_title"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_margin="@dimen/list_padding"
                            android:textAppearance="?textAppearanceTitleLarge" />

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

                </com.google.android.material.card.MaterialCardView>

                <LinearLayout
                    android:id="@+id/foreign_keys"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:visibility="gone">

                </LinearLayout>

            </LinearLayout>
        </ScrollView>

        <RelativeLayout
            android:id="@+id/button_bar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentBottom="true"
            android:paddingHorizontal="16dp"
            android:paddingVertical="8dp">

            <Button
                android:id="@+id/cancel_button"
                style="@style/Widget.Material3.Button.TextButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:layout_centerInParent="true"
                android:text="@string/cancel" />


            <Button
                android:id="@+id/save_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_centerInParent="true"
                android:enabled="false"
                android:text="@string/save" />
        </RelativeLayout>
    </RelativeLayout>
</layout>