<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2018.
  ~
  ~ This file is part of MovieDB.
  ~
  ~ MovieDB is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ MovieDB is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with MovieDB.  If not, see <http://www.gnu.org/licenses/>.
  -->

<android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true"
    tools:context="org.notabug.lifeuser.moviedb.activity.CastActivity">

    <org.notabug.lifeuser.moviedb.NotifyingScrollView
        android:id="@+id/castScrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#FFFFFF">

            <ImageView
                android:id="@+id/actorImage"
                android:layout_width="match_parent"
                android:layout_height="400dp"
                android:background="@color/colorPrimary"
                android:contentDescription="@string/person_image_description"
                android:scaleType="centerCrop" />

            <de.hdodenhof.circleimageview.CircleImageView
                android:id="@+id/actorIcon"
                android:layout_width="150dip"
                android:layout_height="150dip"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="75dp"
                android:background="@color/colorPrimary"
                android:scaleType="centerCrop"
                android:visibility="gone" />

            <RelativeLayout
                android:id="@+id/actorDetails"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/actorImage"
                android:layout_centerHorizontal="true"
                android:layout_margin="16dp">

                <TextView
                    android:id="@+id/actorName"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:textColor="@color/colorBlack"
                    android:textSize="25sp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/actorPlaceOfBirth"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_below="@id/actorName" />

                <TextView
                    android:id="@+id/actorBirthday"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_below="@id/actorPlaceOfBirth" />

            </RelativeLayout>

            <View
                android:id="@+id/firstDivider"
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:layout_below="@id/actorDetails"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:background="?android:attr/listDivider" />

            <TextView
                android:id="@+id/actorBiography"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/firstDivider"
                android:layout_margin="16dp"
                android:ellipsize="end"
                android:maxLines="8" />


            <TextView
                android:id="@+id/castMovieTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/actorBiography"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:text="@string/cast_movie_title"
                android:textSize="16sp" />

            <View
                android:id="@+id/secondDivider"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_below="@id/castMovieTitle"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:background="?android:attr/listDivider" />

            <android.support.v7.widget.RecyclerView
                android:id="@+id/castMovieRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/secondDivider"
                android:scrollbars="none" />

            <TextView
                android:id="@+id/crewMovieTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/castMovieRecyclerView"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:text="@string/crew_movie_title"
                android:textSize="16sp" />

            <View
                android:id="@+id/thirdDivider"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_below="@id/crewMovieTitle"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:background="?android:attr/listDivider" />

            <android.support.v7.widget.RecyclerView
                android:id="@+id/crewMovieRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/thirdDivider"
                android:scrollbars="none" />
        </RelativeLayout>

    </org.notabug.lifeuser.moviedb.NotifyingScrollView>

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:theme="@style/AppTheme.AppBarOverlay"
        app:elevation="0dp">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>

</android.support.design.widget.CoordinatorLayout>
