<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    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:id="@+id/event_scrollview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <RelativeLayout
        android:id="@+id/event_holder"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.simplemobiletools.commons.views.MyEditText
            android:id="@+id/event_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/activity_margin"
            android:layout_marginTop="@dimen/activity_margin"
            android:layout_marginRight="@dimen/activity_margin"
            android:hint="@string/title"
            android:inputType="textCapSentences"
            android:maxLength="180"
            android:maxLines="1"
            android:minEms="20"
            android:textCursorDrawable="@null"
            android:textSize="@dimen/day_text_size"/>

        <com.simplemobiletools.commons.views.MyEditText
            android:id="@+id/event_location"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_title"
            android:layout_marginLeft="@dimen/activity_margin"
            android:layout_marginTop="@dimen/activity_margin"
            android:layout_toLeftOf="@+id/event_show_on_map"
            android:hint="@string/location"
            android:inputType="textCapWords"
            android:maxLength="180"
            android:maxLines="1"
            android:minEms="20"
            android:textCursorDrawable="@null"
            android:textSize="@dimen/day_text_size"/>

        <ImageView
            android:id="@+id/event_show_on_map"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignTop="@+id/event_location"
            android:layout_alignBottom="@+id/event_location"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginEnd="@dimen/activity_margin"
            android:layout_marginRight="@dimen/activity_margin"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:paddingLeft="@dimen/small_margin"
            android:paddingRight="@dimen/small_margin"
            android:src="@drawable/ic_place"/>

        <com.simplemobiletools.commons.views.MyEditText
            android:id="@+id/event_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_location"
            android:layout_marginLeft="@dimen/activity_margin"
            android:layout_marginTop="@dimen/activity_margin"
            android:layout_marginRight="@dimen/activity_margin"
            android:autoLink="all"
            android:gravity="top"
            android:hint="@string/description"
            android:inputType="textCapSentences|textMultiLine"
            android:linksClickable="true"
            android:minEms="20"
            android:textCursorDrawable="@null"
            android:textSize="@dimen/day_text_size"/>

        <ImageView
            android:id="@+id/event_description_divider"
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_below="@+id/event_description"
            android:layout_marginTop="@dimen/activity_margin"
            android:layout_marginBottom="@dimen/normal_margin"
            android:background="@color/divider_grey"
            android:importantForAccessibility="no"/>

        <ImageView
            android:id="@+id/event_time_image"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_below="@+id/event_description_divider"
            android:layout_alignTop="@+id/event_all_day"
            android:layout_alignBottom="@+id/event_all_day"
            android:layout_marginStart="@dimen/normal_margin"
            android:layout_marginLeft="@dimen/normal_margin"
            android:alpha="0.8"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_clock"/>

        <com.simplemobiletools.commons.views.MySwitchCompat
            android:id="@+id/event_all_day"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_description_divider"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginStart="@dimen/small_margin"
            android:layout_marginLeft="@dimen/small_margin"
            android:layout_marginEnd="@dimen/normal_margin"
            android:layout_marginRight="@dimen/normal_margin"
            android:layout_toEndOf="@+id/event_time_image"
            android:layout_toRightOf="@+id/event_time_image"
            android:paddingTop="@dimen/normal_margin"
            android:paddingBottom="@dimen/normal_margin"
            android:text="@string/all_day"
            android:textSize="@dimen/day_text_size"
            app:switchPadding="@dimen/small_margin"/>

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/event_start_date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_time_image"
            android:layout_alignStart="@+id/event_all_day"
            android:layout_alignLeft="@+id/event_all_day"
            android:background="?attr/selectableItemBackground"
            android:paddingTop="@dimen/activity_margin"
            android:paddingEnd="@dimen/activity_margin"
            android:paddingRight="@dimen/activity_margin"
            android:paddingBottom="@dimen/activity_margin"
            android:textSize="@dimen/day_text_size"
            tools:text="January 1 1970"/>

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/event_start_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_time_image"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:background="?attr/selectableItemBackground"
            android:padding="@dimen/activity_margin"
            android:textSize="@dimen/day_text_size"
            tools:text="00:00"/>

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/event_end_date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_start_date"
            android:layout_alignStart="@+id/event_all_day"
            android:layout_alignLeft="@+id/event_all_day"
            android:background="?attr/selectableItemBackground"
            android:paddingTop="@dimen/activity_margin"
            android:paddingEnd="@dimen/activity_margin"
            android:paddingRight="@dimen/activity_margin"
            android:paddingBottom="@dimen/activity_margin"
            android:textSize="@dimen/day_text_size"
            tools:text="January 1 1970"/>

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/event_end_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_start_time"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:background="?attr/selectableItemBackground"
            android:padding="@dimen/activity_margin"
            android:textSize="@dimen/day_text_size"
            tools:text="00:00"/>

        <ImageView
            android:id="@+id/event_date_time_divider"
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_below="@+id/event_end_date"
            android:layout_marginTop="@dimen/medium_margin"
            android:layout_marginBottom="@dimen/medium_margin"
            android:background="@color/divider_grey"
            android:importantForAccessibility="no"/>

        <ImageView
            android:id="@+id/event_reminder_image"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_below="@+id/event_date_time_divider"
            android:layout_alignTop="@+id/event_reminder_1"
            android:layout_alignBottom="@+id/event_reminder_1"
            android:layout_marginStart="@dimen/normal_margin"
            android:layout_marginLeft="@dimen/normal_margin"
            android:alpha="0.8"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_bell"/>

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/event_reminder_1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_date_time_divider"
            android:layout_marginStart="@dimen/small_margin"
            android:layout_marginLeft="@dimen/small_margin"
            android:layout_toEndOf="@+id/event_reminder_image"
            android:layout_toRightOf="@+id/event_reminder_image"
            android:background="?attr/selectableItemBackground"
            android:paddingTop="@dimen/activity_margin"
            android:paddingBottom="@dimen/activity_margin"
            android:textSize="@dimen/day_text_size"/>

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/event_reminder_2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_reminder_1"
            android:layout_alignStart="@+id/event_reminder_1"
            android:layout_alignLeft="@+id/event_reminder_1"
            android:alpha="0.4"
            android:background="?attr/selectableItemBackground"
            android:paddingTop="@dimen/activity_margin"
            android:paddingBottom="@dimen/activity_margin"
            android:text="@string/add_another_reminder"
            android:textSize="@dimen/day_text_size"
            android:visibility="gone"/>

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/event_reminder_3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_reminder_2"
            android:layout_alignStart="@+id/event_reminder_1"
            android:layout_alignLeft="@+id/event_reminder_1"
            android:alpha="0.4"
            android:background="?attr/selectableItemBackground"
            android:paddingTop="@dimen/activity_margin"
            android:paddingBottom="@dimen/activity_margin"
            android:text="@string/add_another_reminder"
            android:textSize="@dimen/day_text_size"
            android:visibility="gone"/>

        <ImageView
            android:id="@+id/event_reminder_divider"
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_below="@+id/event_reminder_3"
            android:layout_marginTop="@dimen/medium_margin"
            android:layout_marginBottom="@dimen/medium_margin"
            android:background="@color/divider_grey"
            android:importantForAccessibility="no"/>

        <ImageView
            android:id="@+id/event_repetition_image"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_below="@+id/event_date_time_divider"
            android:layout_alignTop="@+id/event_repetition"
            android:layout_alignBottom="@+id/event_repetition"
            android:layout_marginStart="@dimen/normal_margin"
            android:layout_marginLeft="@dimen/normal_margin"
            android:alpha="0.8"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_repeat"/>

        <com.simplemobiletools.commons.views.MyTextView
            android:id="@+id/event_repetition"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_reminder_divider"
            android:layout_marginStart="@dimen/small_margin"
            android:layout_marginLeft="@dimen/small_margin"
            android:layout_toEndOf="@+id/event_repetition_image"
            android:layout_toRightOf="@+id/event_repetition_image"
            android:background="?attr/selectableItemBackground"
            android:paddingTop="@dimen/normal_margin"
            android:paddingBottom="@dimen/normal_margin"
            android:textSize="@dimen/day_text_size"/>

        <RelativeLayout
            android:id="@+id/event_repetition_rule_holder"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_repetition"
            android:layout_alignStart="@+id/event_repetition"
            android:layout_alignLeft="@+id/event_repetition"
            android:background="?attr/selectableItemBackground"
            android:visibility="gone">

            <com.simplemobiletools.commons.views.MyTextView
                android:id="@+id/event_repetition_rule_label"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:clickable="false"
                android:paddingTop="@dimen/activity_margin"
                android:paddingBottom="@dimen/activity_margin"
                android:text="@string/repeat_on"
                android:textSize="@dimen/day_text_size"/>

            <com.simplemobiletools.commons.views.MyTextView
                android:id="@+id/event_repetition_rule"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_toEndOf="@+id/event_repetition_rule_label"
                android:layout_toRightOf="@+id/event_repetition_rule_label"
                android:clickable="false"
                android:gravity="end"
                android:padding="@dimen/activity_margin"
                android:text="@string/every_day"
                android:textSize="@dimen/day_text_size"/>
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/event_repetition_limit_holder"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_repetition_rule_holder"
            android:layout_alignStart="@+id/event_repetition"
            android:layout_alignLeft="@+id/event_repetition"
            android:background="?attr/selectableItemBackground"
            android:visibility="gone">

            <com.simplemobiletools.commons.views.MyTextView
                android:id="@+id/event_repetition_limit_label"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_toStartOf="@+id/event_repetition_limit"
                android:layout_toLeftOf="@+id/event_repetition_limit"
                android:clickable="false"
                android:paddingTop="@dimen/activity_margin"
                android:paddingBottom="@dimen/activity_margin"
                android:text="@string/repeat_till"
                android:textSize="@dimen/day_text_size"/>

            <com.simplemobiletools.commons.views.MyTextView
                android:id="@+id/event_repetition_limit"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:clickable="false"
                android:padding="@dimen/activity_margin"
                android:text="@string/forever"
                android:textSize="@dimen/day_text_size"/>
        </RelativeLayout>

        <ImageView
            android:id="@+id/event_repetition_divider"
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_below="@+id/event_repetition_limit_holder"
            android:layout_marginTop="@dimen/medium_margin"
            android:background="@color/divider_grey"
            android:importantForAccessibility="no"/>

        <ImageView
            android:id="@+id/event_caldav_calendar_image"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_below="@+id/event_repetition_divider"
            android:layout_alignTop="@+id/event_caldav_calendar_holder"
            android:layout_alignBottom="@+id/event_caldav_calendar_holder"
            android:layout_marginStart="@dimen/normal_margin"
            android:layout_marginLeft="@dimen/normal_margin"
            android:alpha="0.8"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_calendar"
            android:visibility="gone"/>

        <RelativeLayout
            android:id="@+id/event_caldav_calendar_holder"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_repetition_divider"
            android:layout_toEndOf="@+id/event_caldav_calendar_image"
            android:layout_toRightOf="@+id/event_caldav_calendar_image"
            android:background="?attr/selectableItemBackground"
            android:visibility="gone">

            <com.simplemobiletools.commons.views.MyTextView
                android:id="@+id/event_caldav_calendar_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/small_margin"
                android:layout_marginLeft="@dimen/small_margin"
                android:layout_toLeftOf="@+id/event_caldav_calendar_color"
                android:ellipsize="end"
                android:maxLines="1"
                android:paddingTop="@dimen/medium_margin"
                android:paddingRight="@dimen/medium_margin"
                android:paddingBottom="@dimen/tiny_margin"
                android:textSize="@dimen/day_text_size"
                tools:text="My calendar"/>

            <com.simplemobiletools.commons.views.MyTextView
                android:id="@+id/event_caldav_calendar_email"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/event_caldav_calendar_name"
                android:layout_marginStart="@dimen/small_margin"
                android:layout_marginLeft="@dimen/small_margin"
                android:layout_toLeftOf="@+id/event_caldav_calendar_color"
                android:ellipsize="end"
                android:maxLines="1"
                android:paddingRight="@dimen/medium_margin"
                android:paddingBottom="@dimen/medium_margin"
                android:textSize="@dimen/meta_text_size"
                tools:text="hello@simplemobiletools.com"/>

            <ImageView
                android:id="@+id/event_caldav_calendar_color"
                android:layout_width="@dimen/color_sample_size"
                android:layout_height="@dimen/color_sample_size"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_margin"
                android:layout_marginRight="@dimen/activity_margin"
                android:clickable="false"/>

        </RelativeLayout>

        <ImageView
            android:id="@+id/event_caldav_calendar_divider"
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_below="@+id/event_caldav_calendar_holder"
            android:background="@color/divider_grey"
            android:importantForAccessibility="no"
            android:visibility="gone"/>

        <ImageView
            android:id="@+id/event_type_image"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_below="@+id/event_caldav_calendar_divider"
            android:layout_alignTop="@+id/event_type_holder"
            android:layout_alignBottom="@+id/event_type_holder"
            android:layout_marginStart="@dimen/normal_margin"
            android:layout_marginLeft="@dimen/normal_margin"
            android:alpha="0.8"
            android:padding="@dimen/medium_margin"
            android:src="@drawable/ic_color"/>

        <RelativeLayout
            android:id="@+id/event_type_holder"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_caldav_calendar_divider"
            android:layout_marginTop="@dimen/medium_margin"
            android:layout_marginBottom="@dimen/medium_margin"
            android:layout_toEndOf="@+id/event_type_image"
            android:layout_toRightOf="@+id/event_type_image"
            android:background="?attr/selectableItemBackground">

            <com.simplemobiletools.commons.views.MyTextView
                android:id="@+id/event_type"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/small_margin"
                android:layout_marginLeft="@dimen/small_margin"
                android:layout_marginRight="@dimen/medium_margin"
                android:layout_toLeftOf="@+id/event_type_color"
                android:paddingTop="@dimen/normal_margin"
                android:paddingBottom="@dimen/normal_margin"
                android:textSize="@dimen/day_text_size"/>

            <ImageView
                android:id="@+id/event_type_color"
                android:layout_width="@dimen/color_sample_size"
                android:layout_height="@dimen/color_sample_size"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_margin"
                android:layout_marginRight="@dimen/activity_margin"
                android:clickable="false"/>

        </RelativeLayout>

        <ImageView
            android:id="@+id/event_type_divider"
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_below="@+id/event_type_holder"
            android:background="@color/divider_grey"
            android:importantForAccessibility="no"/>
    </RelativeLayout>
</ScrollView>
