<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/aftersleep_background"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:id="@+id/layout_titlebar"
        android:layout_width="match_parent"
        android:layout_height="52dp"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:background="#191970">

        <Button
            android:id="@+id/btn_AfterSleep"
            android:layout_width="71dp"
            android:layout_height="match_parent"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:background="#191970"
            android:drawableLeft="@drawable/arrow_back"
            android:drawablePadding="6dp"
            android:ellipsize="end"
            android:gravity="center"
            android:paddingLeft="5dp"
            android:singleLine="true"
            android:text="返回"
            android:textAlignment="center"
            android:textAllCaps="false"
            android:textColor="@color/colorWhite"
            android:textSize="18sp" />

        <ImageView
            android:id="@+id/report"
            android:layout_width="48dp"
            android:layout_height="32dp"
            android:layout_alignParentEnd="true"
            android:src="@drawable/record_0"
            android:layout_centerInParent="true"
            android:layout_marginRight="10dp"
             />

        <TextView
            android:id="@+id/text_title"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:ellipsize="marquee"
            android:gravity="center_horizontal|center"
            android:singleLine="true"
            android:text="睡眠结果"
            android:textAlignment="center"
            android:textColor="#ffffffff"
            android:textSize="20dp" />

    </RelativeLayout>

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="515dp"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="52dp">

        <android.support.constraint.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:orientation="vertical">

            <TextView
                android:id="@+id/startTime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignStart="@+id/mPiechart"
                android:layout_alignParentBottom="true"
                android:layout_marginStart="16dp"
                android:layout_marginTop="32dp"
                android:text="睡觉 00:00"
                android:textColor="@android:color/darker_gray"
                android:textSize="18sp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/mPiechart" />

            <TextView
                android:id="@+id/stopTime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/startTime"
                android:layout_alignEnd="@+id/mPiechart"
                android:layout_marginTop="32dp"
                android:layout_marginEnd="16dp"
                android:text="起床 00:00"
                android:textColor="@android:color/darker_gray"
                android:textSize="18sp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/mPiechart" />

            <TextView
                android:id="@+id/sleepTime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_marginStart="32dp"
                android:layout_marginTop="24dp"
                android:layout_toEndOf="@+id/deep"
                android:text="时长：00:00"
                android:textColor="@color/colorWhite"
                android:textSize="18sp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/startTime" />

            <TextView
                android:id="@+id/deep"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="24dp"
                android:layout_marginEnd="28dp"
                android:text="深度睡眠：00:00"
                android:textColor="@color/colorWhite"
                android:textSize="18sp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/stopTime" />

            <TextView
                android:id="@+id/swallow"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="浅层睡眠：00:00"
                android:textColor="@color/colorWhite"
                android:textSize="18sp"
                app:layout_constraintStart_toStartOf="@+id/sleepTime"
                app:layout_constraintTop_toBottomOf="@+id/sleepTime" />

            <TextView
                android:id="@+id/dream"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="醒/梦：00:00"
                android:textColor="@color/colorWhite"
                android:textSize="18sp"
                app:layout_constraintStart_toStartOf="@+id/deep"
                app:layout_constraintTop_toBottomOf="@+id/deep" />

            <com.github.mikephil.charting.charts.PieChart
                android:id="@+id/mPiechart"
                android:layout_width="300dp"
                android:layout_height="300dp"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:layout_gravity="center"
                android:layout_marginStart="8dp"
                android:layout_marginTop="24dp"
                android:layout_marginEnd="8dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        </android.support.constraint.ConstraintLayout>


    </ScrollView>


</RelativeLayout>