<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:background="@color/page_bsg"
    android:orientation="vertical"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".reports.TargetAchievementActivity"
    tools:showIn="@layout/activity_reports_sale_details">

    <LinearLayout
        android:id="@+id/rlTVADetails"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="@dimen/margin1dp"
        android:orientation="vertical"
        android:visibility="gone"
        android:weightSum="1">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_margin="@dimen/custom_margin"
            android:layout_weight=".5"
            android:background="@drawable/rouded_corner_gray"
            android:orientation="vertical">

            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="@dimen/custom_margin2dp"
                app:cardBackgroundColor="@color/white"
                app:cardCornerRadius="@dimen/padding_10dp"
                app:cardElevation="@dimen/custom_margin">
                <!--Ui component for our bar chart-->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="@dimen/custom_margin35dp"
                        android:layout_marginStart="@dimen/padding_10dp"
                        android:orientation="horizontal">

                        <ImageView
                            android:layout_width="10dp"
                            android:layout_height="10dp"
                            android:layout_gravity="center"
                            android:layout_margin="@dimen/custom_margin"
                            android:src="@color/achievement" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:fontFamily="sans-serif"
                            android:gravity="center_vertical"
                            android:padding="@dimen/custom_margin"
                            android:text="@string/achievement"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="normal" />

                        <ImageView
                            android:layout_width="10dp"
                            android:layout_height="10dp"
                            android:layout_gravity="center"
                            android:layout_margin="@dimen/custom_margin"
                            android:src="@color/target_color" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:fontFamily="sans-serif"
                            android:gravity="center_vertical"
                            android:padding="@dimen/custom_margin"
                            android:text="@string/targets"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="normal" />


                    </LinearLayout>

                    <com.cpm.lorealbaMabeline.utils.RoundedBarChart
                        android:id="@+id/idBarChart"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginStart="@dimen/custom_margin"
                        android:layout_marginEnd="@dimen/custom_margin"
                        android:layout_marginBottom="@dimen/custom_margin"
                        android:visibility="gone" />

                    <com.github.mikephil.charting.charts.CombinedChart
                        android:id="@+id/combinedChart"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginStart="@dimen/custom_margin"
                        android:layout_marginEnd="@dimen/custom_margin"
                        android:layout_marginBottom="@dimen/custom_margin" />
                </LinearLayout>
            </androidx.cardview.widget.CardView>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginTop="@dimen/fab_margin"
            android:layout_weight=".5"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/custom_margin2dp"
                android:orientation="vertical"
                android:padding="@dimen/custom_margin2dp">

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

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_weight="3.1"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center_vertical"
                            android:padding="@dimen/custom_margin3dp"
                            android:text="@string/product_group_name"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="2.3"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center|end"
                            android:gravity="center|end"
                            android:padding="@dimen/custom_margin3dp"
                            android:text="@string/targets"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="2.3"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center|end"
                            android:gravity="center|end"
                            android:padding="@dimen/custom_margin3dp"
                            android:text="@string/total_sales"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="2.3"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center|end"
                            android:gravity="center|end"
                            android:padding="@dimen/custom_margin3dp"
                            android:text="@string/ach_per"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="bold" />
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/recycle_reports"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_margin="@dimen/custom_margin" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/rlLeaderBInfo"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="@dimen/margin1dp"
        android:orientation="vertical"
        android:visibility="gone"
        android:weightSum="1">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/custom_margin2dp"
                android:orientation="vertical"
                android:padding="@dimen/custom_margin2dp">

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

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_weight="4"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center_vertical"
                            android:padding="@dimen/custom_margin3dp"
                            android:text="@string/counters_name_ids"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="4"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center|end"
                            android:gravity="center|end"
                            android:padding="@dimen/custom_margin3dp"
                            android:text="@string/ba_name"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="2"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center|end"
                            android:gravity="center|end"
                            android:padding="@dimen/custom_margin3dp"
                            android:text="@string/ach_per"
                            android:textColor="@color/black"
                            android:textSize="@dimen/txt_size_12sp"
                            android:textStyle="bold" />
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/recycleLeaderb"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_margin="@dimen/custom_margin" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/rlIncentiveDetail"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="@dimen/margin1dp"
        android:orientation="vertical"
        android:visibility="gone"
        android:weightSum="1">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/custom_margin2dp"
                android:orientation="vertical"
                android:padding="@dimen/custom_margin2dp">

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

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:padding="@dimen/custom_margin3dp"
                        android:text="@string/incentive_details"
                        android:textColor="@color/black"
                        android:textSize="@dimen/txt_size_12sp"
                        android:textStyle="bold" />

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@android:color/transparent"
                        android:orientation="vertical">

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_margin="@dimen/custom_margin2dp"
                            android:background="@drawable/gradient_bsg"
                            android:orientation="horizontal"
                            android:padding="@dimen/custom_margin"
                            android:weightSum="1">

                            <LinearLayout
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center_vertical"
                                android:layout_weight=".4"
                                android:orientation="vertical">

                                <TextView
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="center_vertical"
                                    android:padding="@dimen/custom_margin3dp"
                                    android:text="@string/earned_incentive"
                                    android:textColor="@color/black"
                                    android:textSize="@dimen/txt_size_10sp"
                                    android:textStyle="normal" />

                                <TextView
                                    android:id="@+id/tvEIncentive"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="center_vertical"
                                    android:padding="@dimen/custom_margin3dp"
                                    android:text="3000"
                                    android:textColor="@color/incentive_max"
                                    android:textSize="@dimen/text_size_normal"
                                    android:textStyle="bold" />
                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center_vertical"
                                android:layout_weight=".6"
                                android:orientation="vertical">

                                <TextView
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="center_vertical"
                                    android:padding="@dimen/custom_margin3dp"
                                    android:text="@string/maximum_incentive"
                                    android:textColor="@color/black"
                                    android:textSize="@dimen/txt_size_10sp"
                                    android:textStyle="normal" />

                                <TextView
                                    android:id="@+id/tvMaxIncentive"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="center_vertical"
                                    android:padding="@dimen/custom_margin3dp"
                                    android:text="30000"
                                    android:textColor="@color/black"
                                    android:textSize="@dimen/text_size_normal"
                                    android:textStyle="bold" />
                            </LinearLayout>
                        </LinearLayout>
                    </LinearLayout>

                    <androidx.cardview.widget.CardView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/text_25dp"
                        app:cardBackgroundColor="@color/white"
                        app:cardCornerRadius="@dimen/appbar_padding_top"
                        app:cardElevation="@dimen/custom_margin">

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_margin="@dimen/custom_margin2dp"
                            android:background="@android:color/transparent"
                            android:orientation="vertical"
                            android:padding="@dimen/custom_margin">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_margin="@dimen/custom_margin2dp"
                                android:gravity="center_vertical"
                                android:padding="@dimen/custom_margin3dp"
                                android:text="@string/sale_linked_incentive"
                                android:textColor="@color/black"
                                android:textSize="@dimen/txt_size_10sp"
                                android:textStyle="normal" />

                            <TextView
                                android:id="@+id/tvSaleLinkedIncentive"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="@dimen/custom_margin2dp"
                                android:gravity="center_vertical"
                                android:padding="@dimen/custom_margin3dp"
                                android:text="300000"
                                android:textColor="@color/black"
                                android:textSize="@dimen/txt_size_14sp"
                                android:textStyle="normal" />

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_margin="@dimen/custom_margin2dp"
                                android:orientation="horizontal"
                                android:padding="@dimen/custom_margin"
                                android:weightSum="1">

                                <LinearLayout
                                    android:layout_width="0dp"
                                    android:layout_height="wrap_content"
                                    android:layout_gravity="center_vertical"
                                    android:layout_weight=".4"
                                    android:orientation="vertical">

                                    <TextView
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:gravity="center_vertical"
                                        android:padding="@dimen/custom_margin3dp"
                                        android:text="@string/flat_incentive"
                                        android:textColor="@color/black"
                                        android:textSize="@dimen/txt_size_10sp"
                                        android:textStyle="normal" />

                                    <TextView
                                        android:id="@+id/tvFlatIncentive"
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:gravity="center_vertical"
                                        android:padding="@dimen/custom_margin3dp"
                                        android:text="3000"
                                        android:textColor="@color/black"
                                        android:textSize="@dimen/txt_size_14sp"
                                        android:textStyle="normal" />
                                </LinearLayout>

                                <LinearLayout
                                    android:layout_width="0dp"
                                    android:layout_height="wrap_content"
                                    android:layout_gravity="center_vertical"
                                    android:layout_weight=".6"
                                    android:orientation="vertical">

                                    <TextView
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:gravity="center_vertical"
                                        android:padding="@dimen/custom_margin3dp"
                                        android:text="@string/total_incentive"
                                        android:textColor="@color/black"
                                        android:textSize="@dimen/txt_size_10sp"
                                        android:textStyle="normal" />

                                    <TextView
                                        android:id="@+id/tvTotalIncentive"
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:gravity="center_vertical"
                                        android:padding="@dimen/custom_margin3dp"
                                        android:text="30000"
                                        android:textColor="@color/black"
                                        android:textSize="@dimen/txt_size_14sp"
                                        android:textStyle="normal" />
                                </LinearLayout>
                            </LinearLayout>
                        </LinearLayout>
                    </androidx.cardview.widget.CardView>
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

    <TextView
        android:id="@+id/tvNodata"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:textSize="@dimen/text_size_small18"
        android:textColor="@color/red"
        android:textStyle="bold"
        android:gravity="center"
        android:fontFamily="sans-serif"
        android:visibility="gone"
        android:text="Information Not available,Please re-sync.\n OR\n Contact to supervisor."/>

</LinearLayout>
