<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2021 PSMForums. All rights reserved.
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    android:animateLayoutChanges="true"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar"/>

    <androidx.core.widget.NestedScrollView
        android:id="@+id/nested_scroll_view"
        android:layout_gravity="fill_vertical"
        tools:fillViewport="true"
        android:scrollbars="horizontal|vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

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

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageView
                    android:id="@+id/image_view"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:scaleType="centerCrop"
                    android:foreground="#BF2B2C28"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/title_text_view"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:padding="16dp"
                    android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
                    android:textColor="@android:color/primary_text_dark"
                    app:layout_constraintBottom_toTopOf="@+id/subtitle_text_view"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintStart_toStartOf="parent"
                    tools:text="Title" />

                <TextView
                    android:id="@+id/subtitle_text_view"
                    android:paddingHorizontal="16dp"
                    android:paddingBottom="16dp"
                    android:textColor="@android:color/primary_text_dark"
                    android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    tools:text="Subtitle"
                    app:layout_constraintBottom_toBottomOf="@+id/image_view"
                    app:layout_constraintEnd_toEndOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <ProgressBar
                android:id="@+id/progress_bar"
                style="?android:attr/progressBarStyleHorizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <WebView
                android:id="@+id/web_view"
                android:layout_margin="8dp"
                android:scrollbars="none"
                android:nestedScrollingEnabled="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
        </LinearLayout>
    </androidx.core.widget.NestedScrollView>
</LinearLayout>