<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (c) 2023 to present Androidacy and contributors. Names, logos, icons, and the Androidacy name are all trademarks of Androidacy and may not be used without license. See LICENSE for more information.
  -->

<androidx.constraintlayout.widget.ConstraintLayout 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"
    tools:context=".UpdateActivity">

    <LinearLayout
        android:id="@+id/update_container"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:gravity="center"
        android:orientation="vertical"
        app:layout_constraintBottom_toTopOf="@id/bottom_navigation"
        app:layout_constraintTop_toTopOf="parent">

        <!-- Activity used to download and install app updates -->
        <!-- first, upgrade icon -->
        <ImageView
            android:layout_width="101dp"
            android:layout_height="101dp"
            android:layout_gravity="center"
            android:layout_margin="8dp"
            android:contentDescription="@string/update"
            android:src="@drawable/baseline_system_update_24" />

        <com.google.android.material.textview.MaterialTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="16dp"
            android:text="@string/update_title"
            android:textAppearance="?attr/textAppearanceHeadline6" />

        <com.google.android.material.textview.MaterialTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="8dp"
            android:text="@string/update_message"
            android:textAppearance="?attr/textAppearanceBody2" />

        <com.google.android.material.progressindicator.LinearProgressIndicator
            android:id="@+id/update_progress"
            style="@style/Widget.Material3.LinearProgressIndicator"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="16dp" />

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/update_progress_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="8dp"
            android:textAppearance="?attr/textAppearanceBody2" />

        <!-- Invisible warning for debug builds -->
        <com.google.android.material.textview.MaterialTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="16dp"
            android:text="@string/update_debug_warning"
            android:textAppearance="?attr/textAppearanceBody2"
            android:visibility="gone" />
        <com.google.android.material.button.MaterialButton
                    android:id="@+id/action_update"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"                                                   android:layout_marginEnd="4dp"
                    android:padding="12dp"
                    android:text="@string/please_wait"
                    android:textSize="16sp"
                    app:icon="@drawable/ic_baseline_warning_24"
                    app:iconGravity="textStart"
                    app:iconPadding="8dp"
                    app:iconTintMode="src_in"
                    android:visibility="invisible"
                    app:rippleColor="@color/gray_800"
                    android:layout_width="match_parent"
                    tools:ignore="DuplicateSpeakableTextCheck" />

        <!-- Changelog view -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <WebView
                android:id="@+id/changelog_webview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="4dp" />

        </LinearLayout>
    </LinearLayout>

    <!-- bottom nav for cancel and finish -->
    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="0dp"
        android:visibility="visible"
        app:compatShadowEnabled="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/update_container"
        app:menu="@menu/update_nav" />

</androidx.constraintlayout.widget.ConstraintLayout>
