From 48a6d908540c0ae492a831f41d18a611a3a21d31 Mon Sep 17 00:00:00 2001 From: eazzy <1044745821@qq.com> Date: Sun, 24 Dec 2023 21:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4=E5=88=86=E6=94=AF=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/代码标注分工.docx | Bin 17603 -> 0 bytes .../micode/notes/ui/AlarmAlertActivity.java | 138 ++++++++------- .../net/micode/notes/ui/NoteEditActivity.java | 160 +++++++++++++++--- .../net/micode/notes/ui/NoteEditText.java | 29 ++-- .../net/micode/notes/ui/NoteItemData.java | 84 +++++++-- 5 files changed, 278 insertions(+), 133 deletions(-) delete mode 100644 doc/代码标注分工.docx diff --git a/doc/代码标注分工.docx b/doc/代码标注分工.docx deleted file mode 100644 index c98a2543cf6a7ecb235e6fc2e93ea550adb0b30e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17603 zcmeJFV{~NO_CF3+I#$QFZQHipv2Ck6NyoN39ox2T+qTouKj-S4)Ax>NjOX?5yEAHz z)Y|(q_pViwYt32mQota{05AXq001BWKw6N&dH?|cWncgR5&+_pmXNKDld+AHuClwG zv7-*Ho3#~w4#+3+Y`~|F>;Lcge|QFJ6Gmiv=;1{k#9xGVX(U&x`5{=&z78N#D)4sJ zk(G(OMDuvR^2Cuwz*EBJjFHANIbQH&ipNbESq>Y)5?GizvW|jL15ss6yTsH)ElGJy z#0Ga$DsVz`tOyvzUER%@)!)D)DXt{fkmUGoau1WBBQPCwDdyRALF5{$+tKY7r~^81 zV9pzzP`eC56Tq>eGPB`J5aSML+R7z9#mA6DIU6P`G?QviT%Zu^w8XKb35K?57_s{ zdwpNk<9OOrf^1%%Bi5MGiFQ2Y5)FUO*s%w`v@5g^X?uSM2FU+SWpQIL8!kT1$bM)f z^oPpoIv86y($W4w|4&u_AJ)&meDu=T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D4z@`?QHOG6jnrlw)~_| zbPzmcu~0N^za}ihLd)eHL0mV-rWA^5Vvv_e53~T^eaR^!@Dl`59es~E^Gm&?S;tcB({#F8UG8eWA43Gf7w6vf9w0#Z8NTKANqd!A#(^H z^}!!S!SW8ac8+w0whsRgw~wB{|0@dqFofZ;Z6EEc$bqiJ>jc-CoU+9H3bB%YoC=U3 zgz#xqwpug2RaOn=Z0r6h87U!XpF$csC6?oZKU+N`t7iMY08p_v$D8Y0EMM+C2RBfYEH&cMR#zS3XEKeJ*=#f z!w7QyJ1yhL0GVDrjcZ6)3YdjdhBu$DS9`0cZiOvuHPu28ot{!cDi+)72zGxLJx#px z#G>Q_ROEP3mEl9V63~m+4A-7*1MXxc;$6kypvE^R_v*Vw9oWW$)(|Z+*Nm3KZ3jj{ z4fKE*Il-)S*{|fJ`q&_FcP?#DZF*H}n|PrFDImm=;=1-^lbEybSxbMc6#loR?0Qz` z@cNM4i4Vzz|EuKc+u8kLC;v}yKc?;DNLTzv-*qd|6`aEPthqTtb{PVtAhw$XtX=)7 zjKS7oqBZ=h=X^jAzRhke*9p#qGz=PE8^t<<@Y!i|`b2Rx|3}Yty-t$c-QASAMlW$G zV!wuV5?A;hC?B`qz$SN4E(5Bt{!a6$;`Kqe$dW$Yc6fgxX#{ke_-s&OQ~nfUMY`9? z6lr~7F;Wm7WSOAzu2{E&9=EUDJBf;{iT730y8HHyyx~QJ_~6A&ehNjBhaM4BomBU1 zvsk+(0ss;!?)x1|KT|6$nH&frF*z~&@y)IfH8JU@txXb~|q6gwPK6kv1M z01`)+t+SG|ob|*th`U)U-viV?IVf=ai^Jc-)!*@d4>x&eUCAAf!y3PL0B$GiUz-5KG< diff --git a/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java b/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java index 96f28bf..e6a9d73 100644 --- a/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java +++ b/src/main/java/net/micode/notes/ui/AlarmAlertActivity.java @@ -46,21 +46,23 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - - requestWindowFeature(Window.FEATURE_NO_TITLE);//设置界面显示——无标题 + // 设置界面显示——无标题 + requestWindowFeature(Window.FEATURE_NO_TITLE); final Window win = getWindow(); - - win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);//设置窗体属性——在锁屏时显示 + // 设置窗体属性——在锁屏时显示 + win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); if (!isScreenOn()) { - win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON//保持点亮、点亮屏幕、允许点亮时解锁 + // 设置窗体属性——保持点亮、点亮屏幕、允许点亮时解锁 + win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR); } - Intent intent = getIntent();//获取传递的 Intent + // 获取传递的 Intent + Intent intent = getIntent(); try { // 从 Intent 中获取数据并处理——获取标签 ID @@ -78,33 +80,24 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD mPlayer = new MediaPlayer(); if (DataUtils.visibleInNoteDatabase(getContentResolver(), mNoteId, Notes.TYPE_NOTE)) { - showActionDialog();// 显示对话框 - playAlarmSound();// 播放闹钟提示音 + // 显示对话框 + showActionDialog(); + // 播放闹钟提示音 + playAlarmSound(); } else { - finish();// 结束当前 Activity + // 结束当前 Activity + finish(); } } - /** - * @method isScreenOn - * @description - * 判断屏幕是否锁屏,调用系统函数判断,最后返回值是布尔类型 - * @date: 12/23/2023 11:21 PM - * @author: YangYizhe - * @param - * @return - */ + private boolean isScreenOn() { + //判断屏幕是否锁屏,调用系统函数判断,最后返回值是布尔类型 PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); return pm.isScreenOn(); } - /** - * @method playAlarmSound - * @description - * 播放闹钟提示音 - * @date: 12/23/2023 11:21 PM - * @author: YangYizhe - */ + private void playAlarmSound() { + //闹钟提示音激发 Uri url = RingtoneManager.getActualDefaultRingtoneUri(this, RingtoneManager.TYPE_ALARM); //调用系统的铃声管理URI,得到闹钟提示音 int silentModeStreams = Settings.System.getInt(getContentResolver(), @@ -117,12 +110,19 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD } try { mPlayer.setDataSource(this, url); + //方法:setDataSource(Context context, Uri uri) + //解释:无返回值,设置多媒体数据来源【根据 Uri】 mPlayer.prepare(); - mPlayer.setLooping(true);//设置是否循环播放 - mPlayer.start();//开始播放 + //准备同步 + mPlayer.setLooping(true); + //设置是否循环播放 + mPlayer.start(); + //开始播放 } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); + //e.printStackTrace()函数功能是抛出异常, 还将显示出更深的调用信息 + //System.out.println(e),这个方法打印出异常,并且输出在哪里出现的异常 } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -134,67 +134,61 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD e.printStackTrace(); } } - /** - * @method showActionDialog - * @description - * AlertDialog的构造方法全部是Protected的 - * 所以不能直接通过new一个AlertDialog来创建出一个AlertDialog。 - * 要创建一个AlertDialog,就要用到AlertDialog.Builder中的create()方法 - * 如这里的dialog就是新建了一个AlertDialog - * @date: 12/23/2023 11:28 PM - * @author: YangYizhe - */ + private void showActionDialog() { AlertDialog.Builder dialog = new AlertDialog.Builder(this); - dialog.setTitle(R.string.app_name);//为对话框设置标题 - dialog.setMessage(mSnippet);//为对话框设置内容 - dialog.setPositiveButton(R.string.notealert_ok, this);//给对话框添加"Yes"按钮 + /* AlertDialog的构造方法全部是Protected的 + * 所以不能直接通过new一个AlertDialog来创建出一个AlertDialog。 + * 要创建一个AlertDialog,就要用到AlertDialog.Builder中的create()方法 + * 如这里的dialog就是新建了一个AlertDialog + */ + dialog.setTitle(R.string.app_name); + //为对话框设置标题 + dialog.setMessage(mSnippet); + //为对话框设置内容 + dialog.setPositiveButton(R.string.notealert_ok, this); + //给对话框添加"Yes"按钮 if (isScreenOn()) { - dialog.setNegativeButton(R.string.notealert_enter, this);//对话框添加"No"按钮 - } + dialog.setNegativeButton(R.string.notealert_enter, this); + }//对话框添加"No"按钮 dialog.show().setOnDismissListener(this); } - /** - * @method onClick - * @description 处理点击事件 - * @date: 12/23/2023 11:27 PM - * @author: YangYizhe - * @param dialog - * @param which - */ + public void onClick(DialogInterface dialog, int which) { - switch (which) {//用which来选择click后下一步的操作 - case DialogInterface.BUTTON_NEGATIVE://这是取消操作 - Intent intent = new Intent(this, NoteEditActivity.class);//实现两个类间的数据传输 - intent.setAction(Intent.ACTION_VIEW);//设置动作属性 - intent.putExtra(Intent.EXTRA_UID, mNoteId);//实现key-value对 EXTRA_UID为key;mNoteId为键 - startActivity(intent);//开始动作 + switch (which) { + //用which来选择click后下一步的操作 + case DialogInterface.BUTTON_NEGATIVE: + //这是取消操作 + Intent intent = new Intent(this, NoteEditActivity.class); + //实现两个类间的数据传输 + intent.setAction(Intent.ACTION_VIEW); + //设置动作属性 + intent.putExtra(Intent.EXTRA_UID, mNoteId); + //实现key-value对 + //EXTRA_UID为key;mNoteId为键 + startActivity(intent); + //开始动作 break; default: + //这是确定操作 break; } } - /** - * @method onDismiss - * @description 忽略 - * @date: 12/23/2023 11:25 PM - * @author: YangYizhe - * @param dialog - */ + public void onDismiss(DialogInterface dialog) { - stopAlarmSound();//停止闹钟声音 + //忽略 + stopAlarmSound(); + //停止闹钟声音 finish(); + //完成该动作 } - /** - * @method stopAlarmSound - * @description 停止闹钟的声音 - * @date: 12/23/2023 11:26 PM - * @author: YangYizhe - */ + private void stopAlarmSound() { if (mPlayer != null) { - mPlayer.stop();//停止播放 - mPlayer.release();//释放MediaPlayer对象 + mPlayer.stop(); + //停止播放 + mPlayer.release(); + //释放MediaPlayer对象 mPlayer = null; } } diff --git a/src/main/java/net/micode/notes/ui/NoteEditActivity.java b/src/main/java/net/micode/notes/ui/NoteEditActivity.java index 8f9cea9..18cafd6 100644 --- a/src/main/java/net/micode/notes/ui/NoteEditActivity.java +++ b/src/main/java/net/micode/notes/ui/NoteEditActivity.java @@ -67,9 +67,6 @@ import java.util.regex.Pattern; */ public class NoteEditActivity extends Activity implements OnClickListener, NoteSettingChangedListener, OnTextViewChangeListener { - /** - * 类属性的定义 - */ private class HeadViewHolder { public TextView tvModified; @@ -259,7 +256,12 @@ public class NoteEditActivity extends Activity implements OnClickListener, initNoteScreen(); } - + /** + * @method initNoteScreen + * @description 初始化笔记页面 + * @date: 12/24/2023 6:24 PM + * @author: YangYizhe + */ private void initNoteScreen() { mNoteEditor.setTextAppearance(this, TextAppearanceResources .getTexAppearanceResource(mFontSizeId)); @@ -286,7 +288,17 @@ public class NoteEditActivity extends Activity implements OnClickListener, */ showAlertHeader(); } - + /** + * @method showAlertHeader + * @description + * 根据当前便签是否设置了提醒时间来显示或隐藏提醒信息头部 + * 如果设置了提醒时间,会根据当前时间判断提醒是否过期 + * 如果已经过期,则在头部显示“已过期”字样 + * 否则在头部显示距离提醒时间还有多长时间,同时显示一个提醒图标。 + * 如果没有设置提醒时间,则隐藏提醒信息头部。 + * @date: 12/24/2023 6:24 PM + * @author: YangYizhe + */ private void showAlertHeader() { if (mWorkingNote.hasClockAlert()) { long time = System.currentTimeMillis(); @@ -398,6 +410,12 @@ public class NoteEditActivity extends Activity implements OnClickListener, } clearSettingState(); } + /** + * @method updateWidget + * @description 更新小部件的操作 + * @date: 12/24/2023 6:21 PM + * @author: YangYizhe + */ private void updateWidget() { Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE); if (mWorkingNote.getWidgetType() == Notes.TYPE_WIDGET_2X) { @@ -454,7 +472,13 @@ public class NoteEditActivity extends Activity implements OnClickListener, saveNote(); super.onBackPressed(); } - + /** + * @method clearSettingState + * @description 清除设置状态, + * @date: 12/24/2023 6:22 PM + * @author: YangYizhe + * @return boolean 返回是否成功清除设置状态 + */ private boolean clearSettingState() { if (mNoteBgColorSelector.getVisibility() == View.VISIBLE) { mNoteBgColorSelector.setVisibility(View.GONE); @@ -465,6 +489,12 @@ public class NoteEditActivity extends Activity implements OnClickListener, } return false; } + /** + * @method onBackgroundColorChanged + * @description 当背景颜色改变时调用 + * @date: 12/24/2023 6:23 PM + * @author: YangYizhe + */ public void onBackgroundColorChanged() { findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility( View.VISIBLE); @@ -496,6 +526,14 @@ public class NoteEditActivity extends Activity implements OnClickListener, return true; } @Override + /** + * @method onOptionsItemSelected + * @description 处理菜单项选择的操作 + * @date: 12/24/2023 6:21 PM + * @author: YangYizhe + * @param [item] 被选中的菜单项 + * @return boolean 返回操作是否成功 + */ public boolean onOptionsItemSelected(MenuItem item) { int itemId = item.getItemId(); if (itemId == R.id.menu_new_note) { @@ -626,9 +664,20 @@ public class NoteEditActivity extends Activity implements OnClickListener, showToast(R.string.error_note_empty_for_clock); } } + /** + * 当小部件发生改变时调用updateWidget + */ public void onWidgetChanged() { updateWidget(); } + /** + * @method onEditTextDelete + * @description 删除文本框的操作 + * @date: 12/24/2023 6:19 PM + * @author: YangYizhe + * @param index 文本框索引 + * @param text 文本框中的文本内容 + */ public void onEditTextDelete(int index, String text) { int childCount = mEditTextList.getChildCount(); if (childCount == 1) { @@ -654,6 +703,14 @@ public class NoteEditActivity extends Activity implements OnClickListener, edit.requestFocus(); edit.setSelection(length); } + /** + * @method onEditTextEnter + * @description 编辑文本框中按下回车键的操作 + * @date: 12/24/2023 6:19 PM + * @author: YangYizhe + * @param index 文本框索引 + * @param text 文本框中的文本内容 + */ public void onEditTextEnter(int index, String text) { /** * Should not happen, check for debug @@ -672,6 +729,13 @@ public class NoteEditActivity extends Activity implements OnClickListener, .setIndex(i); } } + /** + * @method switchToListMode + * @description 切换到列表模式 + * @date: 12/24/2023 6:19 PM + * @author: YangYizhe + * @param text 列表文本 + */ private void switchToListMode(String text) { mEditTextList.removeAllViews(); String[] items = text.split("\n"); @@ -688,6 +752,15 @@ public class NoteEditActivity extends Activity implements OnClickListener, mNoteEditor.setVisibility(View.GONE); mEditTextList.setVisibility(View.VISIBLE); } + /** + * @method getHighlightQueryResult + * @description 获取高亮查询结果 + * @date: 12/24/2023 6:18 PM + * @author: YangYizhe + * @param fullText 完整文本 + * @param userQuery 用户查询关键词 + * @return 带有高亮效果的 Spannable 对象 + */ private Spannable getHighlightQueryResult(String fullText, String userQuery) { SpannableString spannable = new SpannableString(fullText == null ? "" : fullText); if (!TextUtils.isEmpty(userQuery)) { @@ -704,6 +777,15 @@ public class NoteEditActivity extends Activity implements OnClickListener, } return spannable; } + /** + * @method getListItem + * @description 获取列表项视图 + * @date: 12/24/2023 6:17 PM + * @author: YangYizhe + * @param item 列表项内容 + * @param index 列表项索引 + * @return 列表项视图 + */ private View getListItem(String item, int index) { View view = LayoutInflater.from(this).inflate(R.layout.note_edit_list_item, null); final NoteEditText edit = (NoteEditText) view.findViewById(R.id.et_edit_text); @@ -734,6 +816,14 @@ public class NoteEditActivity extends Activity implements OnClickListener, edit.setText(getHighlightQueryResult(item, mUserQuery)); return view; } + /** + * @method onTextChange + * @description 当文本内容发生变化时的处理方法 + * @date: 12/24/2023 6:17 PM + * @author: YangYizhe + * @param index 文本索引 + * @param hasText 是否有文本内容 + */ public void onTextChange(int index, boolean hasText) { if (index >= mEditTextList.getChildCount()) { Log.e(TAG, "Wrong index, should not happen"); @@ -745,52 +835,64 @@ public class NoteEditActivity extends Activity implements OnClickListener, mEditTextList.getChildAt(index).findViewById(R.id.cb_edit_item).setVisibility(View.GONE); } } - + /** + * @method onCheckListModeChanged + * @description 当检查列表模式发生变化时的处理方法 + * @date: 12/24/2023 6:17 PM + * @author: YangYizhe + * @param oldMode 旧的模式 + * @param newMode 新的模式 + */ public void onCheckListModeChanged(int oldMode, int newMode) { if (newMode == TextNote.MODE_CHECK_LIST) { switchToListMode(mNoteEditor.getText().toString()); - //检查模式切换到列表模式 } else { if (!getWorkingText()) { mWorkingNote.setWorkingText(mWorkingNote.getContent().replace(TAG_UNCHECKED + " ", "")); } - //若是获取到文本就改变其检查标记 mNoteEditor.setText(getHighlightQueryResult(mWorkingNote.getContent(), mUserQuery)); mEditTextList.setVisibility(View.GONE); mNoteEditor.setVisibility(View.VISIBLE); - //修改文本编辑器的内容和可见性 } } + /** + * @method getWorkingText + * @description 获取正在编辑的文本内容 + * @date: 12/24/2023 6:12 PM + * @author: YangYizhe + * @return 是否存在已打钩的选项 + */ private boolean getWorkingText() { - boolean hasChecked = false; - //初始化check标记 + boolean hasChecked = false;//初始化check标记 if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) { - // 若模式为CHECK_LIST + /** + * 若模式为CHECK_LIST + * 先创建可变字符串 + * 遍历所有子编辑框的视图 + */ StringBuilder sb = new StringBuilder(); - //创建可变字符串 for (int i = 0; i < mEditTextList.getChildCount(); i++) { View view = mEditTextList.getChildAt(i); - //遍历所有子编辑框的视图 NoteEditText edit = (NoteEditText) view.findViewById(R.id.et_edit_text); if (!TextUtils.isEmpty(edit.getText())) { - //若文本不为空 + /** + * 若文本不为空 + * 该选项框已打钩 + * 扩展字符串为已打钩并把标记置true + */ if (((CheckBox) view.findViewById(R.id.cb_edit_item)).isChecked()) { - //该选项框已打钩 sb.append(TAG_CHECKED).append(" ").append(edit.getText()).append("\n"); hasChecked = true; - //扩展字符串为已打钩并把标记置true } else { - sb.append(TAG_UNCHECKED).append(" ").append(edit.getText()).append("\n"); //扩展字符串添加未打钩 + sb.append(TAG_UNCHECKED).append(" ").append(edit.getText()).append("\n"); } } } - mWorkingNote.setWorkingText(sb.toString()); - //利用编辑好的字符串设置运行便签的内容 - } else { + mWorkingNote.setWorkingText(sb.toString());//利用编辑好的字符串设置运行便签的内容 + } else {// 若不是该模式直接用编辑器中的内容设置运行中标签的内容 mWorkingNote.setWorkingText(mNoteEditor.getText().toString()); - // 若不是该模式直接用编辑器中的内容设置运行中标签的内容 } return hasChecked; } @@ -800,8 +902,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, * 保存便签,退出时候会自动调本函数 * @date: 12/21/2023 8:14 AM * @author: YangYizhe - * @param - * @return */ private boolean saveNote() { getWorkingText(); @@ -826,8 +926,6 @@ public class NoteEditActivity extends Activity implements OnClickListener, * send to home功能,发到桌面上 * @date: 12/21/2023 8:15 AM * @author: YangYizhe - * @param - * @return */ private void sendToDesktop() { /** @@ -863,6 +961,14 @@ public class NoteEditActivity extends Activity implements OnClickListener, showToast(R.string.error_note_empty_for_send_to_desktop); } } + /** + * @method makeShortcutIconTitle + * @description 生成快捷方式图标标题 + * @date: 12/24/2023 6:11 PM + * @author: YangYizhe + * @param content 内容 + * @return 生成的快捷方式图标标题 + */ private String makeShortcutIconTitle(String content) { content = content.replace(TAG_CHECKED, ""); content = content.replace(TAG_UNCHECKED, ""); diff --git a/src/main/java/net/micode/notes/ui/NoteEditText.java b/src/main/java/net/micode/notes/ui/NoteEditText.java index c935358..d29d3d2 100644 --- a/src/main/java/net/micode/notes/ui/NoteEditText.java +++ b/src/main/java/net/micode/notes/ui/NoteEditText.java @@ -46,19 +46,12 @@ import java.util.Map; * @Version: 1.0 */ public class NoteEditText extends EditText { - //常量标识 private static final String TAG = "NoteEditText"; - //声明整型变量,文本索引 private int mIndex; - //声明整型变量 private int mSelectionStartBeforeDelete; - - //声明字符串常量,标志电话、网址、邮件 private static final String SCHEME_TEL = "tel:" ; private static final String SCHEME_HTTP = "http:" ; private static final String SCHEME_EMAIL = "mailto:" ; - - //设置映射,将文本内容(电话、网址、邮件)做链接处理 private static final Map sSchemaActionResMap = new HashMap(); static { sSchemaActionResMap.put(SCHEME_TEL, R.string.note_link_tel); @@ -103,7 +96,9 @@ public class NoteEditText extends EditText { mIndex = 0; } - //设置索引号 + /** + * 设置索引号 + */ public void setIndex(int index) { mIndex = index; } @@ -129,15 +124,15 @@ public class NoteEditText extends EditText { // TODO Auto-generated constructor stub } + @Override /** * @method onTouchEvent * @description 处理触摸事件,根据触摸点的位置设置光标的位置 - * @date: 12/21/2023 12:41 AM + * @date: 12/24/2023 6:07 PM * @author: YangYizhe - * @param - * @return + * @param [event] + * @return boolean */ - @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: @@ -240,15 +235,15 @@ public class NoteEditText extends EditText { super.onFocusChanged(focused, direction, previouslyFocusedRect); } + @Override /** * @method onCreateContextMenu - * @description - * @date: 12/21/2023 12:39 AM + * @description 创建上下文菜单 + * @date: 12/24/2023 6:08 PM * @author: YangYizhe - * @param - * @return + * @param [menu] + * @return void */ - @Override protected void onCreateContextMenu(ContextMenu menu) { if (getText() instanceof Spanned) { int selStart = getSelectionStart(); diff --git a/src/main/java/net/micode/notes/ui/NoteItemData.java b/src/main/java/net/micode/notes/ui/NoteItemData.java index 0f5a878..832cbe9 100644 --- a/src/main/java/net/micode/notes/ui/NoteItemData.java +++ b/src/main/java/net/micode/notes/ui/NoteItemData.java @@ -25,7 +25,14 @@ import net.micode.notes.data.Notes; import net.micode.notes.data.Notes.NoteColumns; import net.micode.notes.tool.DataUtils; - +/** + * @Package: net.micode.notes.ui + * @ClassName: NoteItemData + * @Description: 这个类用于封装笔记列表项的数据,包括笔记的各种属性和状态。 + * @Author: YangYizhe + * @CreateDate: 12/24/2023 6:00 PM + * @Version: 1.0 + */ public class NoteItemData { static final String [] PROJECTION = new String [] { NoteColumns.ID, @@ -75,7 +82,16 @@ public class NoteItemData { private boolean mIsOnlyOneItem; private boolean mIsOneNoteFollowingFolder; private boolean mIsMultiNotesFollowingFolder; - + /** + * @method NoteItemData + * @description + * 创建一个笔记项数据对象 + * 通过传入的游标和上下文对象初始化笔记项数据 + * @date: 12/24/2023 6:00 PM + * @author: YangYizhe + * @param context 上下文对象 + * @param cursor 游标对象,用于获取数据库中的笔记数据 + */ public NoteItemData(Context context, Cursor cursor) { mId = cursor.getLong(ID_COLUMN); mAlertDate = cursor.getLong(ALERTED_DATE_COLUMN); @@ -108,7 +124,13 @@ public class NoteItemData { } checkPostion(cursor); } - + /** + * @method checkPostion + * @description 检查当前笔记项在游标中的位置,并设置相应的标志位 + * @date: 12/24/2023 6:00 PM + * @author: YangYizhe + * @param cursor 游标对象 + */ private void checkPostion(Cursor cursor) { mIsLastItem = cursor.isLast() ? true : false; mIsFirstItem = cursor.isFirst() ? true : false; @@ -133,59 +155,87 @@ public class NoteItemData { } } } - + /** + * 判断是否只有一个笔记项跟随在文件夹后面 + */ public boolean isOneFollowingFolder() { return mIsOneNoteFollowingFolder; } - + /** + * 判断是否有多个笔记项跟随在文件夹后面 + */ public boolean isMultiFollowingFolder() { return mIsMultiNotesFollowingFolder; } - + /** + * 判断当前笔记项是否为最后一项 + */ public boolean isLast() { return mIsLastItem; } - + /** + * 获取通话记录对应的联系人姓名 + */ public String getCallName() { return mName; } - + /** + * 判断当前笔记项是否为第一项 + */ public boolean isFirst() { return mIsFirstItem; } - + /** + * 判断当前笔记项是否为唯一一项 + */ public boolean isSingle() { return mIsOnlyOneItem; } - + /** + * 获取笔记项的ID + */ public long getId() { return mId; } - + /** + * 获取笔记项的提醒日期 + */ public long getAlertDate() { return mAlertDate; } - + /** + * 获取笔记项的创建日期 + */ public long getCreatedDate() { return mCreatedDate; } - + /** + * 判断笔记项是否包含附件 + */ public boolean hasAttachment() { return mHasAttachment; } - + /** + * 获取笔记项的修改日期 + */ public long getModifiedDate() { return mModifiedDate; } - + /** + * 获取笔记项的背景颜色ID + */ public int getBgColorId() { return mBgColorId; } - + /** + * 获取笔记项的父文件夹ID + */ public long getParentId() { return mParentId; } - + /** + * 获取笔记项的子笔记数量 + */ public int getNotesCount() { return mNotesCount; }