<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
    <data>
        <variable
            name="viewModel"
            type="com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel" />
        <variable
            name="isWeatherVisible"
            type="Boolean" />
    </data>
    <com.tommasoberlose.anotherwidget.components.FixedFocusScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/scrollView"
        android:scrollbarThumbVertical="@color/colorPrimaryDark">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="8dp"
            android:paddingBottom="48dp"
            android:orientation="vertical">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/weather_settings"
                android:alpha="@{isWeatherVisible ? 1f : 1f, default=1}"
                android:orientation="vertical">
                <androidx.appcompat.widget.AppCompatTextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/provider_header"
                    android:paddingTop="16dp"
                    android:paddingLeft="20dp"
                    android:paddingRight="20dp"
                    android:textAppearance="@style/AnotherWidget.Settings.Header" />
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingTop="12dp"
                    android:paddingBottom="12dp"
                    android:paddingLeft="8dp"
                    android:paddingRight="8dp"
                    android:clickable="true"
                    android:focusable="true"
                    android:background="?android:attr/selectableItemBackground"
                    android:gravity="center_vertical"
                    android:id="@+id/action_weather_provider"
                    android:orientation="horizontal">
                    <ImageView
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:padding="12dp"
                        android:src="@drawable/round_travel_explore_24"
                        app:tint="@color/colorPrimaryText"/>
                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_weight="1"
                        android:layout_height="wrap_content"
                        android:paddingLeft="8dp"
                        android:paddingRight="8dp"
                        android:orientation="vertical">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            style="@style/AnotherWidget.Settings.Title"
                            android:text="@string/settings_weather_provider_api"/>
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:id="@+id/label_weather_provider"
                            style="@style/AnotherWidget.Settings.Subtitle"/>
                    </LinearLayout>
                </LinearLayout>
                <androidx.appcompat.widget.AppCompatTextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:duplicateParentState="true"
                    android:textSize="14sp"
                    android:paddingStart="64dp"
                    android:paddingEnd="16dp"
                    android:paddingBottom="8dp"
                    android:id="@+id/weather_provider_error"
                    android:textColor="@color/errorColorText"
                    android:letterSpacing="0"
                    android:fontFamily="@font/google_sans_bold"
                    android:textStyle="bold"
                    android:text="@string/weather_provider_error_missing_key"
                    android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
                    app:textAllCaps="false" />
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingTop="12dp"
                    android:paddingBottom="12dp"
                    android:paddingLeft="8dp"
                    android:paddingRight="8dp"
                    android:clickable="true"
                    android:focusable="true"
                    android:background="?android:attr/selectableItemBackground"
                    android:gravity="center_vertical"
                    android:id="@+id/action_custom_location"
                    android:orientation="horizontal">
                    <ImageView
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:padding="12dp"
                        android:src="@drawable/round_place_24"
                        app:tint="@color/colorPrimaryText"/>
                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_weight="1"
                        android:layout_height="wrap_content"
                        android:paddingLeft="8dp"
                        android:paddingRight="8dp"
                        android:orientation="vertical">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            style="@style/AnotherWidget.Settings.Title"
                            android:text="@string/settings_custom_location_title"/>
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:id="@+id/label_custom_location"
                            style="@style/AnotherWidget.Settings.Subtitle"/>
                    </LinearLayout>
                </LinearLayout>
                <androidx.appcompat.widget.AppCompatTextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:duplicateParentState="true"
                    android:textSize="14sp"
                    android:id="@+id/weather_provider_location_error"
                    android:textColor="@color/errorColorText"
                    android:letterSpacing="0"
                    android:fontFamily="@font/google_sans_bold"
                    android:textStyle="bold"
                    android:layout_marginStart="64dp"
                    android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
                    app:textAllCaps="false" />
                <com.google.android.material.button.MaterialButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    style="@style/Widget.MaterialComponents.Button.TextButton"
                    android:letterSpacing="0"
                    android:textAllCaps="false"
                    android:clickable="true"
                    android:focusable="true"
                    android:layout_marginTop="8dp"
                    android:layout_marginStart="64dp"
                    app:rippleColor="@color/errorColorText_op10"
                    app:backgroundTint="@color/errorColorText_op10"
                    android:id="@+id/location_permission_alert"
                    android:textColor="@color/errorColorText"
                    android:visibility="gone"
                    android:text="@string/action_grant_permission"/>
                <androidx.appcompat.widget.AppCompatTextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/preferences_header"
                    android:paddingTop="16dp"
                    android:paddingLeft="20dp"
                    android:paddingRight="20dp"
                    android:textAppearance="@style/AnotherWidget.Settings.Header" />
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingTop="12dp"
                    android:paddingBottom="12dp"
                    android:paddingLeft="8dp"
                    android:paddingRight="8dp"
                    android:clickable="true"
                    android:focusable="true"
                    android:background="?android:attr/selectableItemBackground"
                    android:gravity="center_vertical"
                    android:id="@+id/action_weather_refresh_period"
                    android:orientation="horizontal">
                    <ImageView
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:padding="12dp"
                        android:src="@drawable/round_update"
                        app:tint="@color/colorPrimaryText"/>
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:paddingLeft="8dp"
                        android:paddingRight="8dp"
                        android:orientation="vertical">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            style="@style/AnotherWidget.Settings.Title"
                            android:text="@string/settings_weather_refresh_period_title"/>
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:id="@+id/label_weather_refresh_period"
                            style="@style/AnotherWidget.Settings.Subtitle"/>
                    </LinearLayout>
                </LinearLayout>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingTop="12dp"
                    android:paddingBottom="12dp"
                    android:paddingLeft="8dp"
                    android:paddingRight="8dp"
                    android:clickable="true"
                    android:focusable="true"
                    android:background="?android:attr/selectableItemBackground"
                    android:gravity="center_vertical"
                    android:id="@+id/action_change_unit"
                    android:orientation="horizontal">
                    <ImageView
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:padding="10dp"
                        android:src="@drawable/round_text_format_24"
                        app:tint="@color/colorPrimaryText"/>
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:paddingLeft="8dp"
                        android:paddingRight="8dp"
                        android:orientation="vertical">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            style="@style/AnotherWidget.Settings.Title"
                            android:text="@string/settings_unit_title"/>
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:id="@+id/temp_unit"
                            style="@style/AnotherWidget.Settings.Subtitle"/>
                    </LinearLayout>
                </LinearLayout>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingTop="12dp"
                    android:paddingBottom="12dp"
                    android:paddingLeft="8dp"
                    android:paddingRight="8dp"
                    android:clickable="true"
                    android:focusable="true"
                    android:background="?android:attr/selectableItemBackground"
                    android:gravity="center_vertical"
                    android:id="@+id/action_weather_icon_pack"
                    android:orientation="horizontal">
                    <ImageView
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:padding="12dp"
                        android:src="@drawable/round_design_services_24"
                        app:tint="@color/colorPrimaryText"/>
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:paddingLeft="8dp"
                        android:paddingRight="8dp"
                        android:orientation="vertical">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            style="@style/AnotherWidget.Settings.Title"
                            android:text="@string/settings_weather_icon_pack_title"/>
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:id="@+id/label_weather_icon_pack"
                            style="@style/AnotherWidget.Settings.Subtitle"/>
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </com.tommasoberlose.anotherwidget.components.FixedFocusScrollView>
</layout>