<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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">

    <ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="vertical">

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

            <!-- header -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="8dp"
                android:layout_marginBottom="8dp"
                android:orientation="horizontal">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:paddingStart="8dp"
                    android:paddingEnd="8dp">

                    <TextView
                        android:id="@+id/activityname"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="2dp"
                        android:fontFamily="sans-serif-black"
                        android:scrollHorizontally="false"
                        android:text="Activity Name"
                        android:textSize="16sp"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/activitydate"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="2dp"
                        android:layout_weight="1"
                        android:gravity="start"
                        android:text="Today, 10:00 - 12:00"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/activityduration"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="end"
                        android:text="30min"
                        tools:ignore="HardcodedText" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/top_layout2"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:foregroundGravity="top"
                    android:gravity="end"
                    android:orientation="horizontal"
                    android:paddingStart="8dp"
                    android:paddingEnd="8dp">

                    <ImageView
                        android:id="@+id/item_image"
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:contentDescription="@string/icon_placeholder"
                        app:srcCompat="@drawable/ic_activity_unknown" />
                </LinearLayout>

            </LinearLayout>

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

                <!-- details -->
                <LinearLayout
                    android:id="@+id/summaryDetails"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" />

                <!--
                    Heart Rate chart
                    TODO: Merge this into the dynamic charts
                -->
                <LinearLayout
                    android:id="@+id/heartRateChartWrapper"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:fontFamily="sans-serif-black"
                        android:gravity="center"
                        android:padding="16dp"
                        android:text="@string/heart_rate"
                        android:textSize="18sp" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="2dp"
                        android:background="?attr/row_separator" />

                    <FrameLayout
                        android:id="@+id/chartsFragmentHolder"
                        android:layout_width="match_parent"
                        android:layout_height="300dp" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="2dp"
                        android:background="?attr/row_separator" />

                </LinearLayout>

                <!-- Dynamic charts, provided by the device -->
                <LinearLayout
                    android:id="@+id/dynamic_charts"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical" />

                <!-- Map for gpx track -->
                <FrameLayout
                    android:id="@+id/gpsFragmentHolder"
                    android:layout_width="match_parent"
                    android:layout_height="300dp" />
            </LinearLayout>
        </LinearLayout>
    </ScrollView>

    <ProgressBar
        android:id="@+id/loading_spinner"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:visibility="gone" />

    <TextView
        android:id="@+id/error_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:padding="16dp"
        android:text="@string/agps_status_error"
        android:textColor="?android:attr/textColorSecondary"
        android:visibility="gone" />

</FrameLayout>
