<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="com.nauk.coinfolio.Activities.CurrencyDetailsActivity">

    <ViewFlipper
        android:id="@+id/vfCurrencyDetails"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="56dp">

        <LinearLayout
            android:id="@+id/chartsLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

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

                <Button
                    android:text="Line chart"
                    android:id="@+id/lineChartButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.5"
                    android:enabled="false"
                    style="@style/Widget.AppCompat.Button.Colored"/>

                <Button
                    android:text="Candle stick chart"
                    android:id="@+id/candleStickChartButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.5"
                    style="@style/Widget.AppCompat.Button.Colored"/>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/progressLayoutChart"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.405"
                android:visibility="gone"
                android:gravity="center">

                <ProgressBar
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    style="?android:attr/progressBarStyleLarge"
                    android:layout_gravity="center"
                    android:background="@drawable/circular_progress_bar"/>

            </LinearLayout>

            <com.github.mikephil.charting.charts.LineChart
                android:id="@+id/chartPriceView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.5"/>

            <com.github.mikephil.charting.charts.CandleStickChart
                android:id="@+id/chartCandleStickView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.5"
                android:visibility="gone"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.85"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/timestampHightlight"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:gravity="center_horizontal"
                    android:layout_weight="0.33"
                    android:text="\n" />

                <TextView
                    android:id="@+id/priceHightlight"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:gravity="center_horizontal"
                    android:layout_weight="0.33"
                    android:text="\n" />

                <TextView
                    android:id="@+id/volumeHightlight"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:gravity="center_horizontal"
                    android:layout_weight="0.33"
                    android:text="\n"/>

            </LinearLayout>

            <com.github.mikephil.charting.charts.BarChart
                android:id="@+id/chartVolumeView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.8"
                android:layout_marginTop="5dp" />

            <LinearLayout
                android:id="@+id/layoutChartButtons"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.82"
                android:orientation="horizontal">

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:autoSizeTextType="uniform"
                    android:maxLines="1"
                    android:text="@string/button1h"/>

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:autoSizeTextType="uniform"
                    android:maxLines="1"
                    android:text="@string/button3h"/>

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:enabled="false"
                    android:autoSizeTextType="uniform"
                    android:maxLines="1"
                    android:text="@string/button1d"/>

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:autoSizeTextType="uniform"
                    android:maxLines="1"
                    android:text="@string/button3d"/>

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:autoSizeTextType="uniform"
                    android:maxLines="1"
                    android:text="@string/button1w"/>

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:autoSizeTextType="uniform"
                    android:maxLines="1"
                    android:text="@string/button1m"/>

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:text="@string/button3m"/>

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:autoSizeTextType="uniform"
                    android:maxLines="1"
                    android:text="@string/button6m"/>

                <Button
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="11.1"
                    android:autoSizeTextType="uniform"
                    android:text="@string/button1y"/>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/llCharts"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.71"
                android:orientation="horizontal"
                android:paddingStart="4dp">

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

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:text="Beginning price"
                            android:layout_weight="0.5"
                            android:textStyle="bold"/>

                        <TextView
                            android:id="@+id/txtViewPriceStart"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:layout_weight="0.5"/>

                    </LinearLayout>

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:text="Current price"
                            android:layout_weight="0.5"
                            android:textStyle="bold"/>

                        <TextView
                            android:id="@+id/txtViewPriceNow"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:layout_weight="0.5"/>

                    </LinearLayout>

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:text="Delta"
                            android:layout_weight="0.5"
                            android:textStyle="bold"/>

                        <TextView
                            android:id="@+id/txtViewPercentage"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:layout_weight="0.5"/>

                    </LinearLayout>

                </LinearLayout>

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

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:text="Total volume"
                            android:layout_weight="0.5"
                            android:textStyle="bold"/>

                        <TextView
                            android:id="@+id/totalVolume"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:layout_weight="0.5" />

                    </LinearLayout>

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:text="Highest price"
                            android:layout_weight="0.5"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/highestPrice"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:layout_weight="0.5" />

                    </LinearLayout>

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:text="Lowest price"
                            android:layout_weight="0.5"
                            android:textStyle="bold"/>

                        <TextView
                            android:id="@+id/lowestPrice"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:autoSizeTextType="uniform"
                            android:layout_weight="0.5" />

                    </LinearLayout>

                </LinearLayout>

            </LinearLayout>


        </LinearLayout>

        <LinearLayout
            android:id="@+id/infosLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <ProgressBar
                android:id="@+id/currencyPortfolioDominance"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/Widget.AppCompat.ProgressBar.Horizontal"
                android:visibility="invisible"
                android:background="@color/colorAccent"
                android:padding="@dimen/mdtp_ampm_left_padding"/>

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

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

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="Total supply"
                        android:textStyle="bold"/>

                    <TextView
                        android:id="@+id/txtViewTotalSupply"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>

                </LinearLayout>

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

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="Circulating supply"
                        android:textStyle="bold"/>

                    <TextView
                        android:id="@+id/txtViewCirculatingSupply"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                </LinearLayout>

            </LinearLayout>

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

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

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="Market capitalizaion"
                        android:textStyle="bold"/>

                    <TextView
                        android:id="@+id/txtViewMarketCapitalization"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>

                </LinearLayout>

            </LinearLayout>

        </LinearLayout>

        <LinearLayout
            android:id="@+id/transactionsLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <TextView
                android:text="Transaction history"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:elevation="@dimen/cardview_elevation"/>

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.5">

                <LinearLayout
                    android:id="@+id/listTransactions"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical"/>

            </ScrollView>

            <TextView
                android:text="Trade history"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:elevation="@dimen/cardview_elevation" />

            <ScrollView
                android:id="@+id/svTransactions"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="0.5">

                <LinearLayout
                    android:id="@+id/listTrades"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <ProgressBar
                        android:id="@+id/tradeProgressBar"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_gravity="center"/>

                </LinearLayout>

            </ScrollView>

        </LinearLayout>

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </ScrollView>

    </ViewFlipper>

    <android.support.design.widget.BottomNavigationView
        android:id="@+id/navigation_details"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginEnd="0dp"
        android:layout_marginStart="0dp"
        android:background="?android:attr/windowBackground"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:menu="@menu/navigation_details"
        android:layout_alignParentBottom="true"/>

</RelativeLayout>