修改了底层页面布局,增加了便签置顶/取消置顶、撤回/取消撤回、设为私密/取消私密、富文本编辑、修改列表视图功能的界面布局 #25

Merged
pvexk5qol merged 1 commits from caoweiqiong_branch into master 4 weeks ago

@ -1,99 +1,140 @@
<?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.
-->
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/list_background"
xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/note_edit_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/list_background">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/main_background_gray"
app:titleTextColor="@color/primary_text_black"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<LinearLayout
android:id="@+id/note_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:padding="8dp">
<TextView
android:id="@+id/tv_modified_date"
android:layout_width="0dip"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:layout_marginRight="8dip"
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" />
android:background="@drawable/title_alert"
android:visibility="gone" />
<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="2dip"
android:layout_marginRight="8dip"
android:textAppearance="@style/TextAppearanceSecondaryItem" />
android:layout_marginLeft="2dp"
android:layout_marginRight="8dp"
android:textAppearance="@style/TextAppearanceSecondaryItem"
android:visibility="gone" />
<ImageButton
<!-- 新增:撤销按钮 -->
<ImageView
android:id="@+id/btn_undo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_btn_set_color" />
android:src="@android:drawable/ic_menu_revert"
android:padding="8dp"
android:alpha="0.3"
android:clickable="false" />
<!-- 新增:重做按钮 -->
<ImageView
android:id="@+id/btn_redo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_menu_revert"
android:scaleX="-1"
android:padding="8dp"
android:alpha="0.3"
android:clickable="false" />
<ImageView
android:id="@+id/btn_set_bg_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bg_btn_set_color"
android:padding="5dp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/sv_note_edit"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:layout_width="fill_parent"
android:layout_height="7dip"
android:background="@drawable/bg_color_btn_mask" />
android:layout_width="match_parent"
android:layout_height="7dp"
android:background="@drawable/bg_color_btn_mask"
android:visibility="gone" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:id="@+id/note_scroll_view"
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="0dip">
android:overScrollMode="never">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- [新增] 图片附件栏容器 -->
<!-- 放在 NoteEditText 之前,确保它能随页面滚动 -->
<HorizontalScrollView
android:id="@+id/attachment_bar_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:clipToPadding="false"
android:scrollbars="none">
<LinearLayout
android:id="@+id/attachment_bar_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<!-- 图片将动态添加到这里 -->
</LinearLayout>
</HorizontalScrollView>
<net.micode.notes.ui.NoteEditText
android:id="@+id/note_edit_view"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left|top"
android:gravity="top|left"
android:background="@null"
android:autoLink="all"
android:autoLink="none"
android:linksClickable="false"
android:minLines="12"
android:textAppearance="@style/TextAppearancePrimaryItem"
@ -101,145 +142,246 @@
<LinearLayout
android:id="@+id/note_edit_list"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="-10dip"
android:layout_marginLeft="-10dp"
android:visibility="gone" />
</LinearLayout>
</ScrollView>
<!-- [位置确认] 工具栏必须在 ScrollView 之外LinearLayout 之内 -->
<LinearLayout
android:id="@+id/bottom_toolbar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="#F5F5F5"
android:orientation="horizontal"
android:gravity="center_vertical"
android:elevation="8dp">
<ImageButton
android:id="@+id/btn_insert_image"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@android:drawable/ic_menu_gallery" /> <!-- 改用你刚生成的本地图标 -->
<ImageButton
android:id="@+id/btn_toggle_list"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@android:drawable/checkbox_off_background" />
<ImageButton
android:id="@+id/btn_format_text"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@android:drawable/ic_menu_edit" />
</LinearLayout>
<!-- 在原有 bottom_toolbar 同级位置添加 -->
<HorizontalScrollView
android:id="@+id/format_toolbar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="#F8F8F8"
android:visibility="gone"
android:scrollbars="none"
android:elevation="8dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp">
<!-- 字体大小组 -->
<Button android:id="@+id/btn_font_small" android:layout_width="50dp" android:layout_height="wrap_content" android:text="S" android:textColor="#333333" android:textSize="10sp" style="?android:attr/borderlessButtonStyle"/>
<Button android:id="@+id/btn_font_normal" android:layout_width="50dp" android:layout_height="wrap_content" android:text="M" android:textColor="#333333" android:textSize="14sp" style="?android:attr/borderlessButtonStyle"/>
<Button android:id="@+id/btn_font_large" android:layout_width="50dp" android:layout_height="wrap_content" android:text="L" android:textColor="#333333" android:textSize="18sp" style="?android:attr/borderlessButtonStyle"/>
<Button android:id="@+id/btn_font_super" android:layout_width="50dp" android:layout_height="wrap_content" android:text="XL" android:textColor="#333333" android:textSize="22sp" style="?android:attr/borderlessButtonStyle"/>
<View android:layout_width="1dp" android:layout_height="30dp" android:background="#DDD"/>
<!-- 样式组 -->
<ImageButton android:id="@+id/btn_bold" android:layout_width="48dp" android:layout_height="48dp" android:src="@android:drawable/ic_menu_edit" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="加粗"/>
<ImageButton android:id="@+id/btn_italic" android:layout_width="48dp" android:layout_height="48dp" android:src="@android:drawable/ic_menu_compass" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="斜体"/>
<ImageButton android:id="@+id/btn_underline" android:layout_width="48dp" android:layout_height="48dp" android:src="@android:drawable/ic_menu_sort_alphabetically" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="下划线"/>
<ImageButton android:id="@+id/btn_strike" android:layout_width="48dp" android:layout_height="48dp" android:src="@android:drawable/ic_menu_close_clear_cancel" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="中划线/清除"/>
<ImageButton android:id="@+id/btn_highlight" android:layout_width="48dp" android:layout_height="48dp" android:src="@android:drawable/ic_menu_view" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="高亮"/>
<ImageButton android:id="@+id/btn_color_toggle" android:layout_width="48dp" android:layout_height="48dp" android:src="@android:drawable/button_onoff_indicator_on" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="切换黑白颜色"/>
<View android:layout_width="1dp" android:layout_height="30dp" android:background="#DDD"/>
<!-- 关闭按钮 -->
<ImageButton android:id="@+id/btn_close_format" android:layout_width="48dp" android:layout_height="48dp" android:src="@android:drawable/ic_menu_close_clear_cancel" android:background="?attr/selectableItemBackgroundBorderless"/>
</LinearLayout>
</HorizontalScrollView>
<ImageView
android:layout_width="fill_parent"
android:layout_height="7dip"
android:layout_width="match_parent"
android:layout_height="7dp"
android:background="@drawable/bg_color_btn_mask" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/btn_set_bg_color"
android:layout_height="43dip"
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="30dip"
android:layout_marginRight="8dip"
android:layout_height="60dp"
android:background="@android:drawable/dialog_holo_light_frame"
android:layout_marginTop="?attr/actionBarSize"
android:layout_marginRight="8dp"
android:layout_gravity="top|right"
android:orientation="horizontal"
android:weightSum="6"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center_vertical"
android:visibility="gone">
<FrameLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1">
<!-- 1. 黄色 -->
<FrameLayout
android:layout_width="48dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_bg_yellow"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/edit_yellow" />
<ImageView
android:id="@+id/iv_bg_yellow_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="bottom|right"
android:layout_marginRight="5dip"
android:focusable="false"
android:layout_marginBottom="8dp"
android:layout_marginRight="4dp"
android:visibility="gone"
android:src="@drawable/selected" />
</FrameLayout>
<!-- 2. 蓝色 -->
<FrameLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1">
android:layout_width="48dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_bg_blue"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/edit_blue" />
<ImageView
android:id="@+id/iv_bg_blue_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="bottom|right"
android:focusable="false"
android:layout_marginBottom="8dp"
android:layout_marginRight="4dp"
android:visibility="gone"
android:layout_marginRight="3dip"
android:src="@drawable/selected" />
</FrameLayout>
<!-- 3. 白色 -->
<FrameLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1">
android:layout_width="48dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_bg_white"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/edit_white" />
<ImageView
android:id="@+id/iv_bg_white_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="bottom|right"
android:focusable="false"
android:layout_marginBottom="8dp"
android:layout_marginRight="4dp"
android:visibility="gone"
android:layout_marginRight="2dip"
android:src="@drawable/selected" />
</FrameLayout>
<!-- 4. 绿色 -->
<FrameLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1">
android:layout_width="48dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_bg_green"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/edit_green" />
<ImageView
android:id="@+id/iv_bg_green_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="bottom|right"
android:focusable="false"
android:layout_marginBottom="8dp"
android:layout_marginRight="4dp"
android:visibility="gone"
android:src="@drawable/selected" />
</FrameLayout>
<!-- 5. 红色 -->
<FrameLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1">
android:layout_width="48dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_bg_red"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/edit_red" />
<ImageView
android:id="@+id/iv_bg_red_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="bottom|right"
android:focusable="false"
android:layout_marginBottom="8dp"
android:layout_marginRight="4dp"
android:visibility="gone"
android:src="@drawable/selected" />
</FrameLayout>
<!-- 6. 自定义图片按钮 -->
<FrameLayout
android:layout_width="48dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_bg_custom"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center"
android:src="@android:drawable/ic_menu_gallery"
android:padding="6dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:scaleType="fitCenter" />
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/font_size_selector"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/font_size_selector_bg"
android:layout_gravity="bottom"
@ -247,37 +389,33 @@
<FrameLayout
android:id="@+id/ll_font_small"
android:layout_width="0dip"
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="5dip" />
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="6dip"
android:layout_marginBottom="-7dip"
android:layout_marginRight="6dp"
android:layout_marginBottom="-7dp"
android:focusable="false"
android:visibility="gone"
android:src="@drawable/selected" />
@ -285,68 +423,59 @@
<FrameLayout
android:id="@+id/ll_font_normal"
android:layout_width="0dip"
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="5dip" />
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="6dip"
android:layout_marginBottom="-7dip"
android:src="@drawable/selected" />
android:layout_marginRight="6dp"
android:layout_marginBottom="-7dp"
android:src="@drawable/selected"
android:visibility="gone" />
</FrameLayout>
<FrameLayout
android:id="@+id/ll_font_large"
android:layout_width="0dip"
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="5dip" />
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"
@ -354,37 +483,33 @@
android:layout_gravity="bottom|right"
android:focusable="false"
android:visibility="gone"
android:layout_marginRight="6dip"
android:layout_marginBottom="-7dip"
android:layout_marginRight="6dp"
android:layout_marginBottom="-7dp"
android:src="@drawable/selected" />
</FrameLayout>
<FrameLayout
android:id="@+id/ll_font_super"
android:layout_width="0dip"
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="5dip" />
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"
@ -392,9 +517,24 @@
android:layout_gravity="bottom|right"
android:focusable="false"
android:visibility="gone"
android:layout_marginRight="6dip"
android:layout_marginBottom="-7dip"
android:layout_marginRight="6dp"
android:layout_marginBottom="-7dp"
android:src="@drawable/selected" />
</FrameLayout>
</LinearLayout>
</FrameLayout>
<!-- [新增] 字数统计悬浮球 -->
<TextView
android:id="@+id/tv_char_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginRight="16dp"
android:layout_marginBottom="74dp"
android:background="@drawable/bg_char_count"
android:textColor="@android:color/white"
android:textSize="12sp"
android:text="0"
android:visibility="visible" />
</FrameLayout>

@ -15,64 +15,71 @@
limitations under the License.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/note_item"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dp">
<LinearLayout
android:layout_width="fill_parent"
<!-- 1. 标题栏:占一行,多出部分加省略号 -->
<TextView
android:id="@+id/tv_note_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical">
android:singleLine="true"
android:ellipsize="end"
android:textStyle="bold"
android:textColor="@color/primary_text_black"
android:textSize="16sp"
android:layout_marginBottom="6dp" />
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:textAppearance="@style/TextAppearancePrimaryItem"
android:visibility="gone" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearanceSecondaryItem" />
</LinearLayout>
</LinearLayout>
<!-- 2. 预览内容:限高逻辑 -->
<!-- maxHeight 设为 120dp结合 wrap_content 实现:不到上限全显示,超上限截断 -->
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxHeight="120dp"
android:ellipsize="end"
android:lineSpacingMultiplier="1.2"
android:textColor="#666666"
android:textSize="14sp" />
<CheckBox
android:id="@android:id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:clickable="false"
android:visibility="gone" />
</LinearLayout>
<!-- 3. 时间底部栏 -->
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textSize="12sp"
android:textColor="#999999" />
<CheckBox
android:id="@android:id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:clickable="false"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_alert_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"/>
</FrameLayout>
android:layout_gravity="top|right"
android:visibility="gone"/>
<!-- [新增] 置顶图标 -->
<!-- 使用系统自带的 star_on 图标代替置顶图钉,位置同样靠右 -->
<ImageView
android:id="@+id/iv_pin_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/star_on"
android:layout_gravity="top|right"
android:layout_marginTop="-20dp"
android:contentDescription="Pinned"
android:visibility="gone"/>
</LinearLayout>

@ -1,58 +1,93 @@
<?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.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:id="@+id/note_list_root"
android:background="@drawable/list_background">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<!-- [Fix] 将根布局改为 RelativeLayout 以便精确控制高度 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 1. 顶部 Toolbar -->
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/main_background_gray"
app:titleTextColor="@color/primary_text_black"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:layout_alignParentTop="true" />
<!-- 2. 标题栏 (搜索结果/私密模式标题) -->
<TextView
android:id="@+id/tv_title_bar"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/title_bar_bg"
android:visibility="gone"
android:gravity="center_vertical"
android:singleLine="true"
android:textColor="#FFEAD1AE"
android:textSize="@dimen/text_font_size_medium" />
<ListView
android:id="@+id/notes_list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:cacheColorHint="@null"
android:listSelector="@android:color/transparent"
android:divider="@null"
android:fadingEdge="@null" />
</LinearLayout>
<Button
android:id="@+id/btn_new_note"
android:background="@drawable/new_note"
android:layout_width="match_parent"
android:textSize="@dimen/text_font_size_medium"
android:layout_below="@id/toolbar" />
<!-- 3. 顶部文件夹导航栏 -->
<HorizontalScrollView
android:id="@+id/folder_nav_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/main_background_gray"
android:scrollbars="none"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:layout_below="@id/tv_title_bar">
<LinearLayout
android:id="@+id/folder_nav_container"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:orientation="horizontal"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:gravity="center_vertical" />
</HorizontalScrollView>
<!-- 4. 下拉刷新与列表容器 -->
<!-- [Fix] layout_below 指定在导航栏下方alignParentBottom 指定拉伸到底部 -->
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/folder_nav_scroll"
android:layout_alignParentBottom="true">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/notes_list_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="80dp" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>
<!-- 底部悬浮按钮 (FAB) 保持不变 -->
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_add_note"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:layout_gravity="bottom" />
</FrameLayout>
android:layout_gravity="bottom|left"
android:layout_margin="24dp"
android:contentDescription="@string/notelist_menu_new"
android:src="@android:drawable/ic_input_add"
app:backgroundTint="@color/mi_gold"
app:fabSize="normal"
app:rippleColor="@color/pure_white"
app:elevation="6dp" />
</FrameLayout>

@ -18,22 +18,10 @@
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_new_note"
android:title="@string/notelist_menu_new"/>
<item
android:id="@+id/menu_delete"
android:title="@string/menu_delete"/>
<item
android:id="@+id/menu_font_size"
android:title="@string/menu_font_size"/>
<item
android:id="@+id/menu_list_mode"
android:title="@string/menu_list_mode" />
<item
android:id="@+id/menu_share"
android:title="@string/menu_share"/>

@ -36,4 +36,10 @@
<item
android:id="@+id/menu_search"
android:title="@string/menu_search"/>
<item
android:id="@+id/menu_recycle_bin"
android:title="@string/menu_recycle_bin"
android:icon="@android:drawable/ic_menu_delete"
android:showAsAction="never" />
</menu>

@ -23,9 +23,41 @@
android:icon="@drawable/menu_move"
android:showAsAction="always|withText" />
<item
android:id="@+id/menu_pin"
android:title="@string/menu_pin"
android:icon="@android:drawable/ic_menu_upload"
android:showAsAction="ifRoom|withText" />
<!-- 新增:取消置顶 (默认隐藏,代码逻辑控制显示) -->
<item
android:id="@+id/menu_unpin"
android:title="@string/menu_unpin"
android:icon="@android:drawable/ic_menu_upload"
android:visible="false"
android:showAsAction="ifRoom|withText" />
<!-- 新增:设为私密 -->
<item
android:id="@+id/menu_private"
android:title="@string/menu_private"
android:icon="@android:drawable/ic_menu_view"
android:showAsAction="ifRoom|withText" />
<item
android:id="@+id/delete"
android:title="@string/menu_delete"
android:icon="@drawable/menu_delete"
android:showAsAction="always|withText" />
<item
android:id="@+id/menu_rename"
android:title="Rename"
android:showAsAction="never" />
<item
android:id="@+id/menu_restore"
android:title="@string/menu_restore"
android:icon="@android:drawable/ic_menu_revert"
android:visible="false"
android:showAsAction="ifRoom|withText" />
</menu>

@ -28,4 +28,14 @@
<item>Messaging</item>
<item>Email</item>
</string-array>
<string-array name="view_mode_entries">
<item>List</item>
<item>Waterfall</item>
</string-array>
<string-array name="view_mode_values">
<item>0</item>
<item>1</item>
</string-array>
</resources>

@ -17,4 +17,11 @@
<resources>
<color name="user_query_highlight">#335b5b5b</color>
<!-- 为 UI 改造新增的颜色资源 -->
<color name="main_background_gray">#F5F5F5</color>
<color name="main_background_dark_gray">#E0E0E0</color>
<color name="mi_gold">#FFD700</color>
<color name="pure_white">#FFFFFF</color>
<color name="primary_text_black">#333333</color>
</resources>

@ -1,5 +1,4 @@
<?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");
@ -58,12 +57,39 @@
<item name="android:textColor">@color/secondary_text_dark</item>
</style>
<style name="NoteTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/NoteActionBarStyle</item>
<style name="NoteTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/main_background_gray</item>
<item name="colorPrimaryDark">@color/main_background_dark_gray</item>
<item name="colorAccent">@color/mi_gold</item>
<item name="android:textColorPrimary">@color/primary_text_black</item>
<!-- <item name="actionBarStyle">@style/NoteActionBarStyle</item> -->
</style>
<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:displayOptions" />
<item name="android:visibility">gone</item>
<style name="NoteActionBarStyle" parent="Widget.AppCompat.ActionBar.Solid">
<item name="background">@color/main_background_gray</item>
<item name="displayOptions">showTitle|useLogo|showHome</item>
<item name="titleTextStyle">@style/NoteActionBarTitle</item>
</style>
<style name="NoteActionBarTitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#000000</item>
</style>
</resources>
<string name="menu_pin">Pin</string>
<string name="menu_unpin">Unpin</string>
<string name="menu_private">Private</string>
<string name="alert_move_to_private">Move selected notes to private folder?</string>
<string name="title_private_folder">Private Folder</string>
<string name="input_password">Input Password</string>
<string name="password_error">Wrong password!</string>
<string name="title_recycle_bin">Recycle Bin</string>
<string name="menu_recycle_bin">Recycle Bin</string>
<string name="menu_restore">Restore</string>
<string name="alert_delete_forever">Delete these notes forever?</string>
<string name="char_count_format">%1$d 字</string>
</resources>

@ -26,5 +26,23 @@
android:key="pref_key_bg_random_appear"
android:title="@string/preferences_bg_random_appear_title"
android:defaultValue="false" />
<ListPreference
android:key="pref_view_mode"
android:title="Switch View"
android:entries="@array/view_mode_entries"
android:entryValues="@array/view_mode_values"
android:defaultValue="0" />
</PreferenceCategory>
<PreferenceCategory android:title="个性化">
<Preference
android:key="pref_key_custom_list_bg"
android:title="更换列表背景图片"
android:summary="选择一张图片作为主列表背景" />
</PreferenceCategory>
<Preference
android:key="pref_key_reset_list_bg"
android:title="恢复默认列表背景"
android:summary="移除自定义图片,还原系统默认风格" />
</PreferenceScreen>

@ -20,6 +20,7 @@
android:label="@string/search_label"
android:hint="@string/search_hint"
android:searchMode="queryRewriteFromText"
android:imeOptions="actionSearch"
android:searchSuggestAuthority="notes"
android:searchSuggestIntentAction="android.intent.action.VIEW"

Loading…
Cancel
Save