<?xml version="1.0" encoding="utf-8"?>

 <!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)

      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

           http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
 -->

<!-- 统一使用Material风格：与列表页面一致 -->
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <!-- 统一使用MaterialToolbar（与列表页面一致） -->
    <com.google.android.material.appbar.MaterialToolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:title="@string/menu_edit_note"
        app:navigationIcon="@android:drawable/ic_menu_close_clear_cancel" />

    <!-- 主内容区域 -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical">

        <LinearLayout
            android:id="@+id/note_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tv_modified_date"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_gravity="left|center_vertical"
                android:layout_marginRight="8dp"
                android:textAppearance="@style/TextAppearanceSecondaryItem" />

            <ImageView
                android:id="@+id/iv_alert_icon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:background="@drawable/title_alert" />

            <TextView
                android:id="@+id/tv_alert_date"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="8dp"
                android:textAppearance="@style/TextAppearanceSecondaryItem" />

            <ImageButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:background="@drawable/bg_btn_set_color" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/sv_note_edit"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="vertical">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="7dp"
                android:background="@drawable/bg_color_btn_mask" />

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:scrollbars="none"
                android:overScrollMode="never"
                android:layout_gravity="left|top"
                android:fadingEdgeLength="0dp">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <net.micode.notes.ui.NoteEditText
                        android:id="@+id/note_edit_view"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="left|top"
                        android:background="@null"
                        android:autoLink="all"
                        android:linksClickable="false"
                        android:minLines="12"
                        android:textAppearance="@style/TextAppearancePrimaryItem"
                        android:lineSpacingMultiplier="1.2" />

                    <LinearLayout
                        android:id="@+id/note_edit_list"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:layout_marginLeft="-10dp"
                        android:visibility="gone" />
                </LinearLayout>
            </ScrollView>

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="7dp"
                android:background="@drawable/bg_color_btn_mask" />
        </LinearLayout>

        <ImageView
            android:id="@+id/btn_set_bg_color"
            android:layout_height="43dp"
            android:layout_width="wrap_content"
            android:background="@drawable/bg_color_btn_mask"
            android:layout_gravity="top|right" />

        <LinearLayout
            android:id="@+id/note_bg_color_selector"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/note_edit_color_selector_panel"
            android:layout_marginTop="30dp"
            android:layout_marginRight="8dp"
            android:layout_gravity="top|right"
            android:visibility="gone">

            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1">

                <ImageView
                    android:id="@+id/iv_bg_yellow"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

                <ImageView
                    android:id="@+id/iv_bg_yellow_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:layout_marginRight="5dp"
                    android:focusable="false"
                    android:visibility="gone"
                    android:src="@drawable/selected" />
            </FrameLayout>

            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1">

                <ImageView
                    android:id="@+id/iv_bg_blue"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

                <ImageView
                    android:id="@+id/iv_bg_blue_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:focusable="false"
                    android:visibility="gone"
                    android:layout_marginRight="3dp"
                    android:src="@drawable/selected" />
            </FrameLayout>

            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1">

                <ImageView
                    android:id="@+id/iv_bg_white"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

                <ImageView
                    android:id="@+id/iv_bg_white_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:focusable="false"
                    android:visibility="gone"
                    android:layout_marginRight="2dp"
                    android:src="@drawable/selected" />
            </FrameLayout>

            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1">

                <ImageView
                    android:id="@+id/iv_bg_green"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

                <ImageView
                    android:id="@+id/iv_bg_green_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:focusable="false"
                    android:visibility="gone"
                    android:layout_marginRight="5dp"
                    android:src="@drawable/selected" />
            </FrameLayout>

            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1">

                <ImageView
                    android:id="@+id/iv_bg_red"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

                <ImageView
                    android:id="@+id/iv_bg_red_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:focusable="false"
                    android:visibility="gone"
                    android:layout_marginRight="3dp"
                    android:src="@drawable/selected" />
            </FrameLayout>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/font_size_selector"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/font_size_selector_bg"
            android:layout_gravity="bottom"
            android:visibility="gone">

            <FrameLayout
                android:id="@+id/ll_font_small"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_gravity="center"
                    android:gravity="center">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/font_small"
                        android:layout_marginBottom="5dp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/menu_font_small"
                        android:textAppearance="@style/TextAppearanceUnderMenuIcon" />
                </LinearLayout>

                <ImageView
                    android:id="@+id/iv_small_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:layout_marginRight="6dp"
                    android:layout_marginBottom="-7dp"
                    android:focusable="false"
                    android:visibility="gone"
                    android:src="@drawable/selected" />
            </FrameLayout>

            <FrameLayout
                android:id="@+id/ll_font_normal"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_gravity="center"
                    android:gravity="center">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/font_normal"
                        android:layout_marginBottom="5dp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/menu_font_normal"
                        android:textAppearance="@style/TextAppearanceUnderMenuIcon" />
                </LinearLayout>

                <ImageView
                    android:id="@+id/iv_medium_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:focusable="false"
                    android:visibility="gone"
                    android:layout_marginRight="6dp"
                    android:layout_marginBottom="-7dp"
                    android:src="@drawable/selected" />
            </FrameLayout>

            <FrameLayout
                android:id="@+id/ll_font_large"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_gravity="center"
                    android:gravity="center">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/font_large"
                        android:layout_marginBottom="5dp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/menu_font_large"
                        android:textAppearance="@style/TextAppearanceUnderMenuIcon" />
                </LinearLayout>

                <ImageView
                    android:id="@+id/iv_large_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:focusable="false"
                    android:visibility="gone"
                    android:layout_marginRight="6dp"
                    android:layout_marginBottom="-7dp"
                    android:src="@drawable/selected" />
            </FrameLayout>

            <FrameLayout
                android:id="@+id/ll_font_super"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_gravity="center"
                    android:gravity="center">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/font_super"
                        android:layout_marginBottom="5dp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/menu_font_super"
                        android:textAppearance="@style/TextAppearanceUnderMenuIcon" />
                </LinearLayout>

                <ImageView
                    android:id="@+id/iv_super_select"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|right"
                    android:focusable="false"
                    android:visibility="gone"
                    android:layout_marginRight="6dp"
                    android:layout_marginBottom="-7dp"
                    android:src="@drawable/selected" />
            </FrameLayout>
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
