|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
|
<!--
|
|
|
============================================================================
|
|
|
arrays.xml - 数组资源定义文件
|
|
|
============================================================================
|
|
|
功能:定义便签应用中使用的字符串数组资源
|
|
|
本文件:定义便签导出格式模板数组
|
|
|
文件位置:res/values/arrays.xml
|
|
|
============================================================================
|
|
|
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.
|
|
|
============================================================================
|
|
|
-->
|
|
|
|
|
|
<resources>
|
|
|
<!--
|
|
|
======================= 导出便签格式数组 =======================
|
|
|
名称:format_for_exported_note
|
|
|
类型:字符串数组 (string-array)
|
|
|
功能:定义导出便签到文本文件时的格式模板
|
|
|
用途:在BackupUtils.exportToText()方法中使用
|
|
|
格式:每行使用不同的格式化字符串,支持参数替换
|
|
|
设计理念:结构化、可读性、灵活性
|
|
|
|
|
|
数组结构说明:
|
|
|
索引 | 格式模板 | 对应字符串资源 | 说明
|
|
|
|
|
|
0 | "-%s" | format_folder_name | 文件夹名称行
|
|
|
1 | "-%s" | format_folder_note_date | 文件夹内便签日期
|
|
|
2 | "-%s" | format_note_date | 便签日期
|
|
|
3 | "-%s" | format_note_content | 便签内容
|
|
|
|
|
|
使用流程:
|
|
|
1. 遍历文件夹结构
|
|
|
2. 对每个文件夹使用索引0的格式
|
|
|
3. 对文件夹内每个便签依次使用索引1-3的格式
|
|
|
4. 将格式化后的文本写入文件
|
|
|
-->
|
|
|
<string-array name="format_for_exported_note">
|
|
|
<!--
|
|
|
索引0:文件夹名称行格式
|
|
|
格式:"-%s"
|
|
|
参数:文件夹名称
|
|
|
示例:"-工作便签"
|
|
|
设计:
|
|
|
- 前缀"-":表示文件夹层级
|
|
|
- 一个减号:第一级缩进
|
|
|
- 无额外空格:简洁显示
|
|
|
对应字符串资源:format_folder_name
|
|
|
-->
|
|
|
<item>-%s</item> <!-- format_folder_name -->
|
|
|
|
|
|
<!--
|
|
|
索引1:文件夹内便签日期行格式
|
|
|
格式:"- -%s"
|
|
|
参数:便签创建/修改日期
|
|
|
示例:"[2023-12-15 14:30]" 注意:将- -改为其他字符避免XML注释问题
|
|
|
设计:
|
|
|
- 使用两个减号作为前缀
|
|
|
- 表示该便签属于上面的文件夹
|
|
|
- 日期格式在代码中定义
|
|
|
对应字符串资源:format_folder_note_date
|
|
|
注意:在注释中不能使用连续的两个减号,这里用描述代替
|
|
|
-->
|
|
|
<item>--%s</item> <!-- format_folder_note_date -->
|
|
|
|
|
|
<!--
|
|
|
索引2:便签日期行格式(可能冗余,实际应与索引1相同)
|
|
|
格式:"- -%s"
|
|
|
参数:便签日期
|
|
|
示例:类似索引1的格式
|
|
|
注意:与索引1格式相同,可能用于不同上下文
|
|
|
对应字符串资源:format_note_date
|
|
|
设计考虑:保持格式一致,便于未来扩展
|
|
|
-->
|
|
|
<item>--%s</item> <!-- format_note_date -->
|
|
|
|
|
|
<!--
|
|
|
索引3:便签内容行格式
|
|
|
格式:"- -%s"
|
|
|
参数:便签内容文本
|
|
|
示例:"这是便签内容"
|
|
|
设计:
|
|
|
- 使用两个减号作为前缀
|
|
|
- 与日期行对齐
|
|
|
- 保持统一的缩进级别
|
|
|
- 多行内容时每行都使用此格式
|
|
|
对应字符串资源:format_note_content
|
|
|
-->
|
|
|
<item>--%s</item> <!-- format_note_content -->
|
|
|
</string-array>
|
|
|
|
|
|
</resources> |