<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/primaryBackgroundColor"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:fitsSystemWindows="true">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/Widget.AppCompat.SearchView"
        app:elevation="@dimen/dimen0dp">

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

            <ImageView
                android:id="@+id/close"
                android:layout_width="@dimen/dimen26dp"
                android:layout_height="@dimen/dimen26dp"
                android:layout_marginStart="@dimen/dimen16dp"
                android:layout_marginEnd="@dimen/dimen16dp"
                android:background="?android:attr/selectableItemBackgroundBorderless"
                android:clickable="true"
                android:contentDescription="@string/close"
                android:focusable="true"
                android:gravity="center_vertical"
                android:src="@drawable/ic_close"/>

            <TextView
                android:id="@+id/toolbar_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginEnd="@dimen/dimen20sp"
                android:ellipsize="none"
                android:scrollbars="horizontal"
                android:singleLine="true"
                android:text="@string/defaultFilename"
                android:textColor="?attr/primaryTextColor"
                android:textSize="@dimen/dimen20sp"/>

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

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

    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/progress_bar"
        style="@style/Widget.MaterialComponents.LinearProgressIndicator"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        app:indicatorColor="?attr/progressIndicatorColor"/>

    <androidx.core.widget.NestedScrollView
        android:id="@+id/contentScrollContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:background="?attr/primaryBackgroundColor">

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

            <LinearLayout
                android:id="@+id/markdownFrame"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?attr/primaryBackgroundColor"
                android:orientation="vertical"
                android:padding="@dimen/dimen16dp"
                android:visibility="gone">

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/markdown"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColor="?attr/primaryTextColor"
                    android:textIsSelectable="true"
                    android:textSize="@dimen/dimen14sp"/>

                <TextView
                    android:id="@+id/markdownTv"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColor="?attr/primaryTextColor"
                    android:textIsSelectable="true"
                    android:textSize="@dimen/dimen14sp"
                    android:visibility="gone"/>

            </LinearLayout>

            <org.mian.gitnex.views.ZoomableSyntaxHighlightedArea
                android:id="@+id/contents"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:visibility="gone" />

            <com.github.chrisbanes.photoview.PhotoView
                android:id="@+id/photo_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="@dimen/dimen16dp"
                android:visibility="gone"/>

        </LinearLayout>

    </androidx.core.widget.NestedScrollView>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
