<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:orientation="vertical"
    android:background="@color/colorPrimaryDark"
    tools:context="com.tommasoberlose.anotherwidget.ui.activities.WeatherProviderActivity">
    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardElevation="2dp"
        app:cardCornerRadius="0dp"
        app:cardBackgroundColor="@color/colorPrimary">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:gravity="center_vertical"
            android:paddingLeft="8dp"
            android:paddingRight="8dp">
            <androidx.appcompat.widget.AppCompatImageView
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:padding="10dp"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:layout_centerVertical="true"
                android:layout_alignParentLeft="true"
                android:id="@+id/action_back"
                app:tint="@color/colorPrimaryText"
                android:src="@drawable/round_arrow_back" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_centerInParent="true"
                android:text="@string/settings_weather_provider_api_key_title"
                android:gravity="center"
                style="@style/AnotherWidget.Main.Title"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/action_save"
                android:gravity="center"
                android:layout_centerVertical="true"
                android:layout_alignParentRight="true"
                android:padding="16dp"
                android:textColor="@color/colorAccent"
                android:id="@+id/action_save"
                android:textAppearance="@style/TextAppearance.MaterialComponents.Button"/>
        </RelativeLayout>
    </com.google.android.material.card.MaterialCardView>
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="24dp">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:descendantFocusability="beforeDescendants"
                android:focusable="true"
                android:id="@+id/api_key_container"
                android:focusableInTouchMode="true"
                android:gravity="center_vertical">
                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/api_key"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textCapWords"
                    android:textStyle="bold"
                    android:nextFocusUp="@id/api_key"
                    android:nextFocusLeft="@id/api_key"
                    android:gravity="center_vertical|start"
                    android:textColor="@color/colorPrimaryText"
                    app:boxBackgroundColor="@color/colorPrimary"
                    app:boxStrokeWidth="0dp"
                    app:hintTextColor="@color/colorAccent"
                    android:hint="@string/api_key_hint"
                    android:fontFamily="@font/product_sans"
                    android:textAlignment="viewStart"
                    android:textDirection="locale"
                    style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox">
                    <com.google.android.material.textfield.TextInputEditText
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textAlignment="viewStart"
                        android:textDirection="locale"
                        android:fontFamily="@font/product_sans"
                        android:gravity="center_vertical|start" />
                </com.google.android.material.textfield.TextInputLayout>
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginTop="24dp"
                android:layout_marginBottom="32dp"
                android:background="@color/disabledButtonBackground" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/AnotherWidget.Settings.Title"
                android:gravity="start"
                android:textAlignment="viewStart"
                android:text="@string/api_key_title_1"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/AnotherWidget.Main.Subtitle"
                android:textSize="16sp"
                android:gravity="start"
                android:textAlignment="viewStart"
                android:text="@string/api_key_subtitle_1"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/AnotherWidget.Settings.Title"
                android:layout_marginTop="12dp"
                android:gravity="start"
                android:textAlignment="viewStart"
                android:text="@string/api_key_title_2"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/AnotherWidget.Main.Subtitle"
                android:textSize="16sp"
                android:gravity="start"
                android:textAlignment="viewStart"
                android:text="@string/api_key_subtitle_2"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/AnotherWidget.Settings.Title"
                android:layout_marginTop="12dp"
                android:gravity="start"
                android:textAlignment="viewStart"
                android:text="@string/api_key_title_3"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/AnotherWidget.Main.Subtitle"
                android:textSize="16sp"
                android:gravity="start"
                android:textAlignment="viewStart"
                android:text="@string/api_key_subtitle_3"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/AnotherWidget.Main.Subtitle"
                android:textSize="16sp"
                android:gravity="start"
                android:textAlignment="viewStart"
                android:text="@string/api_key_info_all_set"/>
            <com.google.android.material.button.MaterialButton
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="@color/colorAccent"
                android:letterSpacing="0"
                android:clickable="true"
                android:focusable="true"
                android:gravity="start|center_vertical"
                android:textAlignment="viewStart"
                android:layout_marginStart="-8dp"
                style="@style/Widget.MaterialComponents.Button.TextButton"
                android:textAllCaps="false"
                android:id="@+id/action_open_provider"
                android:text="@string/action_open_provider"/>
        </LinearLayout>
    </ScrollView>
</LinearLayout>
