<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
    android:padding="16dp">

    <LinearLayout
        android:id="@+id/rlParent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/dailog_background"
        android:orientation="vertical"
        tools:ignore="UselessParent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/padding_10dp"
            android:baselineAligned="false"
            android:orientation="horizontal"
            android:weightSum="1">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_weight=".8">

                <TextView
                    android:id="@+id/tvDialogTitle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="start|center"
                    android:gravity="center|start"
                    android:padding="@dimen/appbar_padding_top"
                    android:text="Apply For Leave"
                    android:textColor="@color/black"
                    android:textSize="@dimen/text_size_big"
                    android:textStyle="bold" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_weight=".2"
                android:gravity="center|end">

                <ImageView
                    android:id="@+id/img_close"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_margin="@dimen/custom_margin"
                    android:src="@drawable/cross" />
            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/rlLeaveHistory"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/padding_10dp"
            android:layout_marginEnd="@dimen/padding_10dp"
            android:layout_marginBottom="@dimen/padding_10dp"
            android:background="@android:color/transparent"
            android:orientation="vertical"
            android:visibility="visible"
            android:weightSum="1">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/custom_margin"
                android:layout_marginEnd="@dimen/custom_margin"
                android:orientation="vertical"
                android:paddingBottom="10dip">

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

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_weight=".5"
                        android:gravity="center"
                        android:orientation="horizontal">

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="5dp"
                            android:layout_marginBottom="5dp"
                            android:background="@mipmap/counter_id"
                            android:padding="10dp"
                            android:scaleType="fitXY" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_weight="3.5"
                        android:orientation="horizontal">

                        <com.cpm.lorealbaMabeline.utils.CustomEditText
                            android:id="@+id/etEmployeeCodeforHistory"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="10dip"
                            android:background="@android:color/transparent"
                            android:drawableRight="@drawable/search"
                            android:hint="Employee/Legacy Code"
                            android:imeOptions="actionDone"
                            android:inputType="number"
                            android:maxLength="15"
                            android:padding="@dimen/appbar_padding_top"
                            android:singleLine="true"
                            android:textColorHint="@android:color/black"
                            android:textSize="@dimen/text_size_16sp" />
                    </LinearLayout>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="@dimen/custom_margin"
                    android:orientation="vertical"
                    android:visibility="visible">

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="@dimen/margin_30dp"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="@dimen/custom_margin"
                            android:text="Employee Name : "
                            android:textColor="@color/gray"
                            android:textSize="@dimen/text_size_16sp"
                            android:textStyle="normal" />

                        <TextView
                            android:id="@+id/tvEmpNameHistory"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="@dimen/custom_margin"
                            android:text=""
                            android:textColor="@color/black"
                            android:textSize="@dimen/text_size_16sp"
                            android:textStyle="normal" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="@dimen/margin_30dp"
                        android:layout_marginTop="@dimen/custom_margin"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="@dimen/custom_margin"
                            android:text="Enployee Code : "
                            android:textColor="@color/gray"
                            android:textSize="@dimen/text_size_16sp"
                            android:textStyle="normal" />

                        <TextView
                            android:id="@+id/tvEmpCodeHistory"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="@dimen/custom_margin"
                            android:text=""
                            android:textColor="@color/black"
                            android:textSize="@dimen/text_size_16sp"
                            android:textStyle="normal" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="@dimen/margin_30dp"
                        android:layout_marginTop="@dimen/custom_margin"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="@dimen/custom_margin"
                            android:text="Enployee Designation : "
                            android:textColor="@color/gray"
                            android:textSize="@dimen/text_size_16sp"
                            android:textStyle="normal" />

                        <TextView
                            android:id="@+id/tvEmpDesignationHistory"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="@dimen/custom_margin"
                            android:text=""
                            android:textColor="@color/black"
                            android:textSize="@dimen/text_size_16sp"
                            android:textStyle="normal" />
                    </LinearLayout>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/rlLeaveDetailItem"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/padding_10dp"
                    android:background="@drawable/rouded_corner_gray"
                    android:orientation="vertical"
                    android:visibility="gone"
                    android:weightSum="1">

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

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="3.1"
                            android:gravity="center_vertical"
                            android:padding="@dimen/appbar_padding_top"
                            android:text="Date From - To"
                            android:textColor="@color/black"
                            android:textSize="@dimen/text_size_medium"
                            android:textStyle="bold" />

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1.6"
                            android:gravity="center|end"
                            android:padding="@dimen/appbar_padding_top"
                            android:text="Leave Type"
                            android:textColor="@color/black"
                            android:textSize="@dimen/text_size_medium"
                            android:textStyle="bold" />

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1.6"
                            android:gravity="center|end"
                            android:padding="@dimen/appbar_padding_top"
                            android:text="NoOfDays"
                            android:textColor="@color/black"
                            android:textSize="@dimen/text_size_medium"
                            android:textStyle="bold" />


                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1.6"
                            android:gravity="center|end"
                            android:padding="@dimen/appbar_padding_top"
                            android:text="status"
                            android:textColor="@color/black"
                            android:textSize="@dimen/text_size_medium"
                            android:textStyle="bold" />

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="2.1"
                            android:gravity="center|end"
                            android:padding="@dimen/appbar_padding_top"
                            android:text="Remark"
                            android:textColor="@color/black"
                            android:textSize="@dimen/text_size_medium"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/recyclerLeaveDetail"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="@dimen/appbar_padding_top" />
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/rlApplyLeaveDetail"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/padding_10dp"
            android:background="@drawable/rouded_corner_gray"
            android:orientation="vertical"
            android:visibility="gone"
            android:weightSum="1">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="20dp"
                android:layout_marginRight="5dp"
                android:orientation="vertical"
                android:paddingBottom="10dip">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="5dip"
                    android:background="@drawable/edit_text_border"
                    android:orientation="horizontal"
                    android:padding="@dimen/custom_margin"
                    android:weightSum="4">

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_weight=".5"
                        android:gravity="center"
                        android:orientation="horizontal">

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="5dp"
                            android:layout_marginBottom="5dp"
                            android:background="@mipmap/counter_id"
                            android:padding="10dp"
                            android:scaleType="fitXY" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_weight="3.5"
                        android:orientation="horizontal">

                        <com.cpm.lorealbaMabeline.utils.CustomEditText
                            android:id="@+id/etEmployeeCode"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="10dip"
                            android:background="@android:color/transparent"
                            android:drawableRight="@drawable/search"
                            android:hint="Employee Code"
                            android:imeOptions="actionDone"
                            android:inputType="number"
                            android:maxLength="17"
                            android:padding="@dimen/appbar_padding_top"
                            android:singleLine="true"
                            android:textColorHint="@android:color/black"
                            android:textSize="@dimen/text_size_16sp" />
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/padding_10dp"
                android:background="@drawable/dailog_background"
                android:orientation="vertical"
                android:weightSum="1">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/margin_30dp"
                    android:layout_marginTop="@dimen/padding_10dp"
                    android:layout_marginEnd="@dimen/text_margin"
                    android:layout_marginBottom="@dimen/padding_10dp"
                    android:orientation="vertical">

                    <LinearLayout
                        android:id="@+id/rlEmployeeInfo"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="@dimen/appbar_padding_top"
                        android:orientation="vertical">

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:padding="@dimen/custom_margin"
                                android:text="Employee Name : "
                                android:textColor="@color/gray"
                                android:textSize="@dimen/text_size_16sp"
                                android:textStyle="normal" />

                            <TextView
                                android:id="@+id/tvEmpName"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:padding="@dimen/custom_margin"
                                android:singleLine="true"
                                android:text=""
                                android:textColor="@color/black"
                                android:textSize="@dimen/text_size_16sp"
                                android:textStyle="normal" />
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginTop="@dimen/custom_margin"
                            android:orientation="horizontal">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:padding="@dimen/custom_margin"
                                android:text="Enployee Code : "
                                android:textColor="@color/gray"
                                android:textSize="@dimen/text_size_16sp"
                                android:textStyle="normal" />

                            <TextView
                                android:id="@+id/tvEmpCode"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:padding="@dimen/custom_margin"
                                android:text=""
                                android:textColor="@color/black"
                                android:textSize="@dimen/text_size_16sp"
                                android:textStyle="normal" />
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginTop="@dimen/custom_margin"
                            android:orientation="horizontal">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:padding="@dimen/custom_margin"
                                android:text="Enployee Designation : "
                                android:textColor="@color/gray"
                                android:textSize="@dimen/text_size_16sp"
                                android:textStyle="normal" />

                            <TextView
                                android:id="@+id/tvEmpDesignation"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:padding="@dimen/custom_margin"
                                android:text=""
                                android:textColor="@color/black"
                                android:textSize="@dimen/text_size_16sp"
                                android:textStyle="normal" />
                        </LinearLayout>

                    </LinearLayout>

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

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_margin="@dimen/appbar_padding_top"
                            android:orientation="horizontal"
                            android:weightSum="4">

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

                                <RadioButton
                                    android:id="@+id/radioBFullday"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:buttonTint="@color/black"
                                    android:gravity="center_vertical"
                                    android:padding="@dimen/custom_margin"
                                    android:text="Full Day"
                                    android:textSize="@dimen/text_size_16sp" />
                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center_vertical"
                                android:layout_marginStart="@dimen/textview_dialog_head_min_height"
                                android:layout_weight="2"
                                android:orientation="horizontal">

                                <RadioButton
                                    android:id="@+id/radio_half_day"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:buttonTint="@color/black"
                                    android:gravity="center_vertical"
                                    android:padding="@dimen/custom_margin"
                                    android:text="Half Day"
                                    android:textSize="@dimen/text_size_16sp" />
                            </LinearLayout>
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_margin="@dimen/appbar_padding_top"
                            android:orientation="horizontal"
                            android:weightSum="4">

                            <LinearLayout
                                android:id="@+id/rlFromDate"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center_vertical"
                                android:layout_weight="2"
                                android:orientation="vertical">

                                <TextView
                                    android:id="@+id/tvFromDateInfo"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginBottom="@dimen/custom_margin"
                                    android:padding="@dimen/appbar_padding_top"
                                    android:text="Date From"
                                    android:textColor="@color/black"
                                    android:textSize="@dimen/text_size_16sp"
                                    android:textStyle="normal" />

                                <LinearLayout
                                    android:id="@+id/rlFromDateInfo"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:background="@drawable/rouded_corner_gray"
                                    android:orientation="horizontal"
                                    android:padding="@dimen/custom_margin">

                                    <ImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:layout_margin="@dimen/custom_margin"
                                        android:src="@mipmap/calender" />

                                    <TextView
                                        android:id="@+id/tvFromDate"
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center_vertical"
                                        android:gravity="center_vertical"
                                        android:hint="DD/MM/YYYY"
                                        android:padding="@dimen/custom_margin"
                                        android:singleLine="true"
                                        android:textColor="@color/black"
                                        android:textSize="@dimen/txt_size_14sp"
                                        android:textStyle="normal" />
                                </LinearLayout>
                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center_vertical"
                                android:layout_marginStart="@dimen/textview_dialog_head_min_height"
                                android:layout_weight="2"
                                android:orientation="vertical">

                                <TextView
                                    android:id="@+id/tvTodatePlaceholder"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginBottom="@dimen/custom_margin"
                                    android:padding="@dimen/appbar_padding_top"
                                    android:text="Date to"
                                    android:textColor="@color/black"
                                    android:textSize="@dimen/text_size_16sp"
                                    android:textStyle="normal" />

                                <LinearLayout
                                    android:id="@+id/rlToDateInfo"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:background="@drawable/rouded_corner_gray"
                                    android:orientation="horizontal"
                                    android:padding="@dimen/custom_margin">

                                    <ImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:layout_margin="@dimen/custom_margin"
                                        android:src="@mipmap/calender" />

                                    <TextView
                                        android:id="@+id/tvToDate"
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center_vertical"
                                        android:gravity="center_vertical"
                                        android:hint="DD/MM/YYYY"
                                        android:padding="@dimen/custom_margin"
                                        android:singleLine="true"
                                        android:textColor="@color/black"
                                        android:textSize="@dimen/txt_size_14sp"
                                        android:textStyle="normal" />
                                </LinearLayout>
                            </LinearLayout>

                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="@dimen/appbar_padding_top"
                            android:layout_marginTop="@dimen/padding_10dp"
                            android:layout_marginEnd="@dimen/appbar_padding_top"
                            android:layout_marginBottom="@dimen/appbar_padding_top"
                            android:orientation="vertical">

                            <com.cpm.lorealbaMabeline.utils.ActionEditText
                                android:id="@+id/edtapply_forleaveReason"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_gravity="start|left"
                                android:background="@drawable/edit_text_border"
                                android:focusable="true"
                                android:gravity="start|left"
                                android:hint="@string/please_enter_reason"
                                android:imeOptions="actionDone"
                                android:inputType="textCapSentences|textMultiLine"
                                android:maxLength="350"
                                android:maxLines="10"
                                android:padding="@dimen/appbar_padding_top"
                                android:scrollHorizontally="false"
                                android:textColor="@color/black"
                                android:textSize="@dimen/text_size_16sp" />
                        </LinearLayout>
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>

        <Button
            android:id="@+id/btn_submit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/margin_30dp"
            android:background="@drawable/rouded_corner"
            android:text="Submit"
            android:textColor="@color/white"
            android:textSize="@dimen/text_size_normal"
            android:textStyle="bold"
            android:visibility="gone" />
    </LinearLayout>
</FrameLayout>