<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <data>
        <import type="com.adins.mss.foundation.formatter.Formatter"
            alias="fmt" />
        <import type="com.adins.mss.constant.Global"
            alias="const" />
        <variable
            name="is_processed"
            type="String" />
        <variable
            name="status"
            type="String" />
        <variable
            name="surveyHeader"
            type="com.adins.mss.base.dynamicform.SurveyHeaderBean" />
    </data>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/bgColor">

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="60dp">
            <LinearLayout
                android:id="@+id/customer_fragment_form"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_margin="@dimen/card_margin"
                    android:id="@+id/customerNameLayout">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">
                        <TextView
                            android:id="@+id/lblCustomerName"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/lblCustomerName"
                            android:drawableLeft="@drawable/ic_person_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <EditText
                            android:id="@+id/txtCustomerName"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="15dp"
                            android:text=""
                            android:textColor="@drawable/edit_text_selector"
                            android:imeOptions="actionNext"
                            android:inputType="text"
                            android:maxLength="60"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/customerPhoneLayout">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">
                        <TextView
                            android:id="@+id/lblCustomerPhone"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/lblCustomerPhone"
                            android:drawableLeft="@drawable/ic_phone_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <androidx.constraintlayout.widget.ConstraintLayout
                            android:id="@+id/customerPhoneContainer"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content">

                            <EditText
                                android:id="@+id/txtCustomerPhone"
                                android:layout_height="wrap_content"
                                android:layout_width="0dp"
                                android:layout_marginLeft="8dp"
                                android:imeOptions="actionNext"
                                android:inputType="number"
                                android:maxLength="20"
                                android:text=""
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:textColor="@drawable/edit_text_selector"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintEnd_toStartOf="@+id/callPhoneNumber"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent"
                                app:layout_constraintWidth_percent="0.8" />

                            <Button
                                android:id="@+id/callPhoneNumber"
                                android:layout_width="50dp"
                                android:layout_height="25dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginRight="8dp"
                                android:layout_marginBottom="10dp"
                                android:background="@drawable/call_button_background"
                                android:gravity="center"
                                android:padding="5dp"
                                android:text="Call"
                                android:textColor="#ffff"
                                android:textSize="12sp"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintEnd_toEndOf="parent"
                                app:layout_constraintTop_toTopOf="parent" />

                        </androidx.constraintlayout.widget.ConstraintLayout>

                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/customerAddressLayout">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">
                        <TextView
                            android:id="@+id/lblCustomerAddress"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/lblCustomerAddress"
                            android:drawableLeft="@drawable/ic_location_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <EditText
                            android:id="@+id/txtCustomerAddress"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="15dp"
                            android:text=""
                            android:textColor="@drawable/edit_text_selector"
                            android:maxLength="120"
                            android:minLines="2"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/surveyLocationLayout">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">

                        <TextView
                            android:id="@+id/txtSurveyLocationTitle"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/survey_location"
                            android:drawableLeft="@drawable/ic_location_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <EditText
                            android:id="@+id/txtSurveyLocation"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="15dp"
                            android:text=""
                            android:textColor="@drawable/edit_text_selector"
                            android:maxLength="120"
                            android:minLines="2"
                            android:textAppearance="?android:attr/textAppearanceSmall" />
                    </LinearLayout>
                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/customerAgreementLayout"
                    android:visibility="gone">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">
                        <TextView
                            android:id="@+id/lblAgreement"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/lblAgreementNo"
                            android:drawableLeft="@drawable/ic_cash_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <EditText
                            android:id="@+id/txtAgreement"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="15dp"
                            android:text=""
                            android:textColor="@drawable/edit_text_selector"
                            android:enabled="false"
                            android:maxLines="1"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/customerOSAmountLayout"
                    android:visibility="gone">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">
                        <TextView
                            android:id="@+id/lblCustomerOSAmount"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/lblAmountDue"
                            android:drawableLeft="@drawable/ic_cash_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <EditText
                            android:id="@+id/txtCustomerOSAmount"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="15dp"
                            android:text=""
                            android:textColor="@drawable/edit_text_selector"
                            android:enabled="false"
                            android:maxLines="1"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/customerODLayout"
                    android:visibility="gone">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">
                        <TextView
                            android:id="@+id/lblCustomerOD"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/lblOverdue"
                            android:drawableLeft="@drawable/ic_date_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <EditText
                            android:id="@+id/txtCustomerOD"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="15dp"
                            android:text=""
                            android:textColor="@drawable/edit_text_selector"
                            android:maxLines="1"
                            android:enabled="false"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/customerInstallmentNoLayout"
                    android:visibility="gone">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">
                        <TextView
                            android:id="@+id/lblCustomerInstallmentNo"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/lblInstallment"
                            android:drawableLeft="@drawable/ic_no_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <EditText
                            android:id="@+id/txtCustomerInstallmentNo"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="15dp"
                            android:text=""
                            android:textColor="@drawable/edit_text_selector"
                            android:enabled="false"
                            android:maxLines="1"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/customerNotesLayout">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp">
                        <TextView
                            android:id="@+id/lblNotes"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/lblNotes"
                            android:drawableLeft="@drawable/ic_form_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <EditText
                            android:id="@+id/txtNotes"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="15dp"
                            android:text=""
                            android:textColor="@drawable/edit_text_selector"
                            android:minLines="3"
                            android:maxLength="2048"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="@dimen/card_shadow"
                    android:layout_marginLeft="@dimen/card_margin"
                    android:layout_marginRight="@dimen/card_margin"
                    android:layout_marginBottom="@dimen/card_margin"
                    android:id="@+id/ptsLayout"
                    android:visibility="gone">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="horizontal"
                        android:paddingTop="10dp"
                        android:paddingBottom="10dp"
                        android:paddingRight="5dp"
                        android:paddingLeft="5dp"
                        android:id="@+id/ptsDateLayout">
                        <TextView
                            android:id="@+id/lblPtsDate"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/ptsDate"
                            android:drawableLeft="@drawable/ic_date_color"
                            android:drawablePadding="5dp"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                        <TextView
                            android:id="@+id/txtPtsDate"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="right"
                            android:text=""
                            android:textAppearance="?android:attr/textAppearanceSmall"/>
                    </LinearLayout>
                </androidx.cardview.widget.CardView>
            </LinearLayout>

        </ScrollView>

        <LinearLayout
            android:id="@+id/buttons"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btnPts"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/button_background"
                android:text="@string/btnReschedule"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/fontColorWhite"
                android:visibility="gone" />

            <Button
                android:id="@+id/btnReset"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/button_background"
                android:text="@string/btnReset"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/fontColorWhite"/>

            <Button
                android:id="@+id/btnStartSurvey"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/button_background"
                android:text="@string/btnStart"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/fontColorWhite" />

            <Button
                android:id="@+id/btnRevisit"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/button_background"
                android:text="@string/btnRevisit"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/fontColorWhite"
                android:visibility="gone" />

            <Button
                android:id="@+id/btnViewTask"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/button_background"
                android:text="@string/btnView"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/fontColorWhite"
                android:visibility="gone" />

            <Button
                android:id="@+id/btnPrint"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/button_background"
                android:text="@string/btnPrint"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/fontColorWhite"
                android:visibility="gone" />

            <Button
                android:id="@+id/btnChangePlan"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/button_background"
                android:text="@string/btnChangePlan"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/fontColorWhite"
                android:visibility="gone" />

        </LinearLayout>
    </RelativeLayout>
</layout>