<!--
  ~ Copyright (c) 2015. Ncomz. All Rights Reserved
  -->

<LinearLayout
    android:id="@+id/llPageRoot"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/color_body_01"
    android:fitsSystemWindows="true"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:orientation="vertical">

  <include layout="@layout/app_toolbar"/>

  <com.ntels.onecable.common.widget.CustomScrollView
          android:id="@+id/svBody"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:fadingEdge="none"
          android:overScrollMode="never"
          android:fillViewport="true">

    <LinearLayout
            android:id="@+id/llSvbody"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:background="@drawable/color_bg_01">

      <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:orientation="horizontal"
                android:paddingLeft="15dp"
                android:paddingRight="76dp"
                android:paddingTop="18dp"
                android:paddingBottom="18dp"
                android:gravity="center_vertical">
          <TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:textStyle="bold"
                  android:text="@string/layout_rules_edit_03"
                  style="@style/list_detail_text"/>
        </LinearLayout>

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/color_bg_01"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:paddingBottom="15dp"
                android:paddingLeft="10dp"
                android:paddingRight="18dp">

          <EditText
                  android:id="@+id/edtRulesName"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_vertical"
                  android:layout_weight="1"
                  android:imeOptions="actionDone"
                  android:includeFontPadding="false"
                  android:inputType="textEmailAddress"
                  android:maxLength="40"
                  android:singleLine="true"
                  style="@style/common_input_edittext"/>
          <ImageView
                  android:id="@+id/ivRulesNameAdd"
                  android:layout_width="40dp"
                  android:layout_height="40dp"
                  android:layout_marginLeft="18dp"
                  android:layout_marginTop="4dp"
                  android:layout_marginBottom="4dp"
                  android:duplicateParentState="false"
                  android:background="@drawable/d_common_list_btn_delete"
                  android:visibility="invisible"/>
          <Button
                  android:id="@+id/btnRulesNameOk"
                  android:layout_width="60dp"
                  android:layout_height="42dp"
                  android:layout_marginLeft="18dp"
                  android:layout_marginTop="4dp"
                  android:layout_marginBottom="4dp"
                  android:text="@string/layout_ok"
                  android:textColor="@color/color_text_05"
                  android:background="@drawable/d_img_btn_common2"
                  android:visibility="gone"/>
        </LinearLayout>
      </LinearLayout>

      <View style="@style/width_Divider_01"/>

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

        <LinearLayout
                android:id="@+id/llTriggerTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:paddingLeft="15dp"
                android:paddingRight="18dp"
        android:background="@drawable/d_common_bg_list1">

          <TextView
                  android:id="@+id/tvTriggerTitle"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:layout_marginTop="18dp"
                  android:layout_marginBottom="18dp"
                  android:textStyle="bold"
                  android:text="@string/layout_rules_edit_04"
                  style="@style/list_detail_text"/>

          <ImageView
                  android:id="@+id/ivTriggerAdd"
                  android:layout_width="40dp"
                  android:layout_height="40dp"
                  android:layout_marginLeft="18dp"
                  android:duplicateParentState="true"
                  android:background="@drawable/d_common_list_btn_add"/>
        </LinearLayout>


        <LinearLayout
                android:id="@+id/llTriggerBody"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="9dp"
                android:layout_marginRight="9dp"
                android:orientation="vertical">
        </LinearLayout>
      </LinearLayout>

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

        <LinearLayout
                android:id="@+id/llActionTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:paddingLeft="15dp"
                android:paddingRight="18dp"
        android:background="@drawable/d_common_bg_list1">

          <TextView
                  android:id="@+id/tvActionTitle"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:layout_marginTop="18dp"
                  android:layout_marginBottom="18dp"
                  android:textStyle="bold"
                  android:text="@string/layout_rules_edit_05"
                  style="@style/list_detail_text"/>

          <ImageView
                  android:id="@+id/ivActionAdd"
                  android:layout_width="40dp"
                  android:layout_height="40dp"
                  android:layout_marginLeft="18dp"
                  android:duplicateParentState="true"
                  android:background="@drawable/d_common_list_btn_add"/>
        </LinearLayout>


        <LinearLayout
                android:id="@+id/llActionBody"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="9dp"
                android:layout_marginRight="9dp"
                android:orientation="vertical">
        </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:orientation="horizontal"
                android:paddingLeft="15dp"
                android:paddingRight="76dp"
                android:paddingTop="18dp"
                android:paddingBottom="18dp"
                android:gravity="center_vertical">
          <TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:textStyle="bold"
                  android:text="@string/layout_rules_edit_06"
                  style="@style/list_detail_text"/>
        </LinearLayout>

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/color_bg_01"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:paddingBottom="15dp"
                android:paddingLeft="10dp"
                android:paddingRight="18dp">

          <EditText
                  android:id="@+id/edtAlarmMsg"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_vertical"
                  android:layout_weight="1"
                  android:imeOptions="actionDone"
                  android:includeFontPadding="false"
                  android:inputType="textMultiLine"
                  android:maxHeight="107dp"
                  android:scrollbars="vertical"
                  style="@style/common_input_edittext"/>
          <ImageView
                  android:id="@+id/ivAlarmMsgAdd"
                  android:layout_width="40dp"
                  android:layout_height="40dp"
                  android:layout_marginLeft="18dp"
                  android:layout_marginTop="4dp"
                  android:layout_marginBottom="4dp"
                  android:duplicateParentState="false"
                  android:background="@drawable/d_common_list_btn_delete"
                  android:visibility="invisible"/>
          <Button
                  android:id="@+id/btnAlarmMsgOk"
                  android:layout_width="60dp"
                  android:layout_height="42dp"
                  android:layout_marginLeft="18dp"
                  android:layout_marginTop="4dp"
                  android:layout_marginBottom="4dp"
                  android:text="@string/layout_ok"
                  android:textColor="@color/color_text_05"
                  android:background="@drawable/d_img_btn_common2"
                  android:visibility="gone"/>
        </LinearLayout>
      </LinearLayout>

      <View style="@style/width_Divider_01"/>

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

        <LinearLayout
                android:id="@+id/llConditionTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:paddingLeft="15dp"
                android:paddingRight="18dp"
        android:background="@drawable/d_common_bg_list1">

          <TextView
                  android:id="@+id/tvConditionTitle"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:textStyle="bold"
                  android:text="@string/layout_rules_edit_07"
                  style="@style/list_detail_text"/>

          <ImageView
                  android:id="@+id/ivConditionAdd"
                  android:layout_width="40dp"
                  android:layout_height="40dp"
                  android:layout_marginLeft="18dp"
                  android:layout_marginTop="8dp"
                  android:layout_marginBottom="8dp"
                  android:duplicateParentState="true"
                  android:background="@drawable/d_common_list_btn_add"/>
        </LinearLayout>


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

          <LinearLayout
                  android:id="@+id/llConditionBody1Title"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:gravity="center_vertical"
                  android:paddingBottom="8dp"
                  android:paddingLeft="15dp"
                  android:paddingRight="15dp"
                  android:paddingTop="10dp"
                  android:visibility="gone">

            <TextView
                    android:id="@+id/tvAddCondition1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:includeFontPadding="false"
                    android:text="@string/layout_rules_edit_08"
                    android:textColor="@color/color_text_03"
                    android:textSize="@dimen/size_font_04"
                    android:textStyle="bold"
                    style="@style/list_detail_text"
            />

            <ImageView
                    android:id="@+id/ivConditionBody1TitleAdd"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="20dp"
                    android:background="@drawable/d_common_list_btn_add"
                    android:visibility="gone"/>
          </LinearLayout>

          <LinearLayout
                  android:id="@+id/llConditionBody1"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="9dp"
                  android:layout_marginRight="9dp"
                  android:orientation="vertical">
          </LinearLayout>

          <LinearLayout
                  android:id="@+id/llConditionBody2Title"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:gravity="center_vertical"
                  android:paddingBottom="8dp"
                  android:paddingLeft="15dp"
                  android:paddingRight="15dp"
                  android:paddingTop="10dp"
                  android:visibility="gone">

            <TextView
                    android:id="@+id/tvAddCondition2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:includeFontPadding="false"
                    android:text="@string/layout_rules_edit_09"
                    android:textColor="@color/color_text_03"
                    android:textSize="@dimen/size_font_04"
                    android:textStyle="bold"
            />

            <ImageView
                    android:id="@+id/ivConditionBody2TitleAdd"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="20dp"
                    android:background="@drawable/d_common_list_btn_add"
                    android:visibility="gone"/>
          </LinearLayout>

          <LinearLayout
                  android:id="@+id/llConditionBody2"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="9dp"
                  android:layout_marginRight="9dp"
                  android:orientation="vertical">
          </LinearLayout>

          <LinearLayout
                  android:id="@+id/llConditionBody3Title"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:gravity="center_vertical"
                  android:paddingBottom="8dp"
                  android:paddingLeft="15dp"
                  android:paddingRight="15dp"
                  android:paddingTop="10dp"
                  android:visibility="gone">

            <TextView
                    android:id="@+id/tvAddCondition3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:includeFontPadding="false"
                    android:text="@string/layout_rules_edit_10"
                    android:textColor="@color/color_text_03"
                    android:textSize="@dimen/size_font_04"
                    android:textStyle="bold"
            />

            <ImageView
                    android:id="@+id/ivConditionBody3TitleAdd"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="20dp"
                    android:background="@drawable/d_common_list_btn_add"
                    android:visibility="gone"/>
          </LinearLayout>

          <LinearLayout
                  android:id="@+id/llConditionBody3"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="9dp"
                  android:layout_marginRight="9dp"
                  android:orientation="vertical">
          </LinearLayout>
        </LinearLayout>
      </LinearLayout>
    </LinearLayout>
  </com.ntels.onecable.common.widget.CustomScrollView>

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

    <View
        style="@style/width_Divider_02"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_gravity="center_horizontal"
        android:gravity="center">

      <LinearLayout
          android:id="@+id/llBtn2"
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:gravity="center"
          android:background="@drawable/d_common_btn_bg">

        <TextView
            android:id="@+id/tvBtn2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/layout_cancel"
            style="@style/bottom_button_text_no"/>
      </LinearLayout>

      <View
          android:id="@+id/vLine"
          style="@style/height_Divider_01"/>

      <LinearLayout
          android:id="@+id/llBtn1"
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:gravity="center"
          android:background="@drawable/d_common_btn_bg">>

        <TextView
            android:id="@+id/tvBtn1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/layout_finish"
            style="@style/bottom_button_text_yes"/>
      </LinearLayout>
    </LinearLayout>
  </LinearLayout>

</LinearLayout>