Compare commits

...

40 Commits

Author SHA1 Message Date
张林浩 6c4f93db5e 其他报告
2 years ago
张林浩 f5ee9897ea 最终版本
2 years ago
张林浩 9dcd5edd09 Merge branch 'develop'
2 years ago
张林浩 b2c771fd54 报告
2 years ago
张林浩 d2f129e6b5 Merge branch 'develop'
2 years ago
张林浩 bb28f0ae76 解决合并冲突
2 years ago
张林浩 48300f3e37 添加缺失的文件
2 years ago
张林浩 fd311cc4c2 合并dev
2 years ago
张林浩 c1d81bcede Merge branch 'develop'
2 years ago
张林浩 b27a1a64da 更名
2 years ago
张林浩 55a8205188 Merge branch 'master' of https://bdgit.educoder.net/mwxbgi697/cantonbro
2 years ago
张林浩 5d5610134d 吴一凡注释文件
2 years ago
mwxbgi697 e37f61a483 Delete 'doc/FoldersListAdapter.java'
2 years ago
mwxbgi697 6a8b152b84 Delete 'doc/DropdownMenu.java'
2 years ago
mwxbgi697 5bddf40522 Delete 'doc/DateTimePickerDialog.java'
2 years ago
mwxbgi697 463e1d3083 Delete 'doc/DateTimePicker.java'
2 years ago
mwxbgi697 cbe8faa1bc Delete 'doc/AlarmReceiver.java'
2 years ago
mwxbgi697 786d9e5e5e Delete 'doc/AlarmInitReceiver.java'
2 years ago
mwxbgi697 7d88501231 Delete 'doc/AlarmAlertActivity.java'
2 years ago
mwxbgi697 189d0f7f58 Delete 'file.txt'
2 years ago
mwxbgi697 9e937cee2b Delete 'create.txt'
2 years ago
张林浩 b4db65e687 analyze quality report
2 years ago
张林浩 25e775d089 update report
2 years ago
mwxbgi697 84940840c7 张林浩标注
2 years ago
张林浩 e2d59eef3d 张林浩标注
2 years ago
mwxbgi697 f71cbfdea5 吴一凡注释
2 years ago
张林浩 766632ecef d
2 years ago
张林浩 533a5e83f0 upload new annotated files
2 years ago
张林浩 47aa745785 remake src
2 years ago
张林浩 5f542173d9 Merge branch 'master' of https://bdgit.educoder.net/mwxbgi697/cantonbro
2 years ago
张林浩 3ca53c9417 delete src
2 years ago
张林浩 b1de843b24 delete disorder file
2 years ago
mwxbgi697 ca441b3fca Update README.md
2 years ago
mwxbgi697 0e76b99d18 Update README.md
2 years ago
mwxbgi697 ddecf8004a Delete 'doc/init.docx'
2 years ago
张林浩 4467dce330 Merge branch 'master' of https://bdgit.educoder.net/mwxbgi697/cantonbro
2 years ago
张林浩 bcc0082932 delete useless document
2 years ago
mwxbgi697 470c97dfc9 upload report
2 years ago
mwxbgi697 9a8b8a9511 Delete '小米便签泛读1.1'
2 years ago
p4hc6qtoi 3925c50aca ADD file via upload
2 years ago

@ -1,2 +1,43 @@
# cantonbro # cantonbro
软件工程
任务:
一、阅读、标注和分析开源软件
1.作业任务描述
-阅读开源软件(如小米便签),掌握开源软件的框架,对开源代码进行标注即注释,撰写开源代码泛读报告和代码质量分析报告。
2.作业质量要求
-确保所绘制的UML图如用例图、类图的准确性和完整性
-确保泛读报告和分析报告的准确性和质量
3.作业组织方式
-以分组方式进行2人一个小组创建针对本作业的项目和软件版本库在版本库中建立“src”和“doc”两个文件夹分别存储软件系统的源代码和报告文档
-建立master、develop以及成员分支(a_branch)将当前版本存入master目录下
4.作业提交成果 根据附件中的报告完成:
-泛读报告
-代码注释
-质量分析报告
分组要求2 ~ 3人
基于项目实施:是
二、维护开源软件
目标:对开源软件(如小米便签)进行维护,提高程序设计能力与素质
形式2人结对
内容:
1添加或修改功能或修复已有缺陷为开源软件实现新增的功能或修改已有功能或修复开源软件中存在的缺陷其中所修改的功能或缺陷总数不少于2项鼓励多做
2代码分析对修改后的代码进行质量分析
3代码测试对修改后的代码进行单元测试
1.作业任务描述
-添加或修改开源软件的功能,或修复开源软件的缺陷
2.作业质量要求
-新功能完成度高、集成度好、体验好,缺陷完成度高
-代码质量:风格、注释、编程技巧、静态质量问题全部处理
3.作业组织方式
-以分组方式进行,创建针对本作业的项目和软件版本库
-在版本库中建立“src”、“doc”两个目录分别存储软件的源代码和维护设计方案文档以及成果报告ppt
4.作业提交成果
-维护后的软件源代码
-维护设计方案文档
-成果演示ppt
分组要求2 ~ 2人
基于项目实施:是

@ -0,0 +1 @@
Subproject commit ca441b3fcad5f08167cbc8de4632d88279e3354c

@ -33,16 +33,44 @@ import net.micode.notes.tool.ResourceParser.NoteBgResources;
/** /**
* @ProjectName: WorkingNote.java * @ProjectName: WorkingNote.java
* @Package: net.micode.notes.model * @Package: net.micode.notes.model
* @ClassName: WorkingNote * @ClassName: WorkingNote
* @Description: 便 * @Description: 便
* @Author: ZHANGLINHAO * @Author: ZHANGLINHAO
* @CreateDate: 2023/12/22 20:17 * @CreateDate: 2023/12/22 20:17
*/ */
public class WorkingNote { public class WorkingNote {
// Note for the working note
private Note mNote;
// Note Id
private long mNoteId;
// Note content
private String mContent;
// Note mode
private int mMode;
private long mAlertDate;
private long mModifiedDate;
private int mBgColorId;
private int mWidgetId;
private int mWidgetType;
private long mFolderId;
private Context mContext;
private static final String TAG = "WorkingNote";
public static final String[] DATA_PROJECTION = new String[]{ private boolean mIsDeleted;
private NoteSettingChangedListener mNoteSettingStatusListener;
public static final String[] DATA_PROJECTION = new String[] {
DataColumns.ID, DataColumns.ID,
DataColumns.CONTENT, DataColumns.CONTENT,
DataColumns.MIME_TYPE, DataColumns.MIME_TYPE,
@ -51,43 +79,35 @@ public class WorkingNote {
DataColumns.DATA3, DataColumns.DATA3,
DataColumns.DATA4, DataColumns.DATA4,
}; };
public static final String[] NOTE_PROJECTION = new String[]{
public static final String[] NOTE_PROJECTION = new String[] {
NoteColumns.PARENT_ID, NoteColumns.PARENT_ID,
NoteColumns.ALERTED_DATE, NoteColumns.ALERTED_DATE,
NoteColumns.BG_COLOR_ID, NoteColumns.BG_COLOR_ID,
NoteColumns.WIDGET_ID, NoteColumns.WIDGET_ID,
NoteColumns.WIDGET_TYPE, NoteColumns.WIDGET_TYPE,
NoteColumns.MODIFIED_DATE, NoteColumns.MODIFIED_DATE
}; };
private static final String TAG = "WorkingNote";
private static final int DATA_ID_COLUMN = 0; private static final int DATA_ID_COLUMN = 0;
private static final int DATA_CONTENT_COLUMN = 1; private static final int DATA_CONTENT_COLUMN = 1;
private static final int DATA_MIME_TYPE_COLUMN = 2; private static final int DATA_MIME_TYPE_COLUMN = 2;
private static final int DATA_MODE_COLUMN = 3; private static final int DATA_MODE_COLUMN = 3;
private static final int NOTE_PARENT_ID_COLUMN = 0; private static final int NOTE_PARENT_ID_COLUMN = 0;
private static final int NOTE_ALERTED_DATE_COLUMN = 1; private static final int NOTE_ALERTED_DATE_COLUMN = 1;
private static final int NOTE_BG_COLOR_ID_COLUMN = 2; private static final int NOTE_BG_COLOR_ID_COLUMN = 2;
private static final int NOTE_WIDGET_ID_COLUMN = 3; private static final int NOTE_WIDGET_ID_COLUMN = 3;
private static final int NOTE_WIDGET_TYPE_COLUMN = 4; private static final int NOTE_WIDGET_TYPE_COLUMN = 4;
private static final int NOTE_MODIFIED_DATE_COLUMN = 5; private static final int NOTE_MODIFIED_DATE_COLUMN = 5;
// Note content
public String mContent;
// Note for the working note
private final Note mNote;
// Note Id
private long mNoteId;
// Note mode
private int mMode;
private long mAlertDate;
private long mModifiedDate;
private int mBgColorId;
private int mWidgetId;
private int mWidgetType;
private long mFolderId;
private final Context mContext;
private boolean mIsDeleted;
private NoteSettingChangedListener mNoteSettingStatusListener;
// 新便签的构造 // 新便签的构造
private WorkingNote(Context context, long folderId) { private WorkingNote(Context context, long folderId) {
@ -111,44 +131,14 @@ public class WorkingNote {
mNote = new Note(); mNote = new Note();
loadNote(); loadNote();
} }
/** /**
* @method: createEmptyNote * @method: loadNote
* @description:便 * @description:便
* @date: 2023/12/24 20:30 * @date: 2023/12/24 20:19
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: IDIDID * @param:
* @return: note * @return:
*/ */
public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId,
int widgetType, int defaultBgColorId) {
WorkingNote note = new WorkingNote(context, folderId);
note.setBgColorId(defaultBgColorId);
note.setWidgetId(widgetId);
note.setWidgetType(widgetType);
return note;
}
/**
* @method: load
* @description:便
* @date: 2023/12/22 20:44
* @author: ZHANGLINHAO
* @param: ID
* @return: 便
*/
public static WorkingNote load(Context context, long id) {
return new WorkingNote(context, id, 0);
}
/**
* @method: loadNote
* @description:便
* @date: 2023/12/24 20:19
* @author: ZHANGLINHAO
* @param:
* @return:
*/
private void loadNote() { private void loadNote() {
Cursor cursor = mContext.getContentResolver().query( Cursor cursor = mContext.getContentResolver().query(
ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, mNoteId), NOTE_PROJECTION, null, ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, mNoteId), NOTE_PROJECTION, null,
@ -170,19 +160,18 @@ public class WorkingNote {
} }
loadNoteData(); loadNoteData();
} }
/** /**
* @method: loadNoteData * @method: loadNoteData
* @description:便 * @description:便
* @date: 2023/12/22 20:29 * @date: 2023/12/22 20:29
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param:
* @return: * @return:
*/ */
private void loadNoteData() { private void loadNoteData() {
Cursor cursor = mContext.getContentResolver().query(Notes.CONTENT_DATA_URI, DATA_PROJECTION, Cursor cursor = mContext.getContentResolver().query(Notes.CONTENT_DATA_URI, DATA_PROJECTION,
DataColumns.NOTE_ID + "=?", new String[]{ DataColumns.NOTE_ID + "=?", new String[] {
String.valueOf(mNoteId) String.valueOf(mNoteId)
}, null); }, null);
if (cursor != null) { if (cursor != null) {
@ -206,15 +195,41 @@ public class WorkingNote {
throw new IllegalArgumentException("Unable to find note's data with id " + mNoteId); throw new IllegalArgumentException("Unable to find note's data with id " + mNoteId);
} }
} }
/** /**
* @method: saveNote * @method: createEmptyNote
* @description:便 * @description:便
* @date: 2023/12/24 20:45 * @date: 2023/12/24 20:30
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param: IDIDID
* @return: true/false * @return: note
*/ */
public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId,
int widgetType, int defaultBgColorId) {
WorkingNote note = new WorkingNote(context, folderId);
note.setBgColorId(defaultBgColorId);
note.setWidgetId(widgetId);
note.setWidgetType(widgetType);
return note;
}
/**
* @method: load
* @description:便
* @date: 2023/12/22 20:44
* @author: ZHANGLINHAO
* @param: ID
* @return: 便
*/
public static WorkingNote load(Context context, long id) {
return new WorkingNote(context, id, 0);
}
/**
* @method: saveNote
* @description:便
* @date: 2023/12/24 20:45
* @author: ZHANGLINHAO
* @param:
* @return: true/false
*/
public synchronized boolean saveNote() { public synchronized boolean saveNote() {
if (isWorthSaving()) { if (isWorthSaving()) {
if (!existInDatabase()) { if (!existInDatabase()) {
@ -239,52 +254,52 @@ public class WorkingNote {
return false; return false;
} }
} }
/** /**
* @method: existInDatabase * @method: existInDatabase
* @description: * @description:
* @date: 2023/12/22 20:46 * @date: 2023/12/22 20:46
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param:
* @return: 1/0 * @return: 1/0
*/ */
public boolean existInDatabase() { public boolean existInDatabase() {
return mNoteId > 0; return mNoteId > 0;
} }
/** /**
* @method: isWorthSaving * @method: isWorthSaving
* @description: * @description:
* @date: 2023/12/22 20:47 * @date: 2023/12/22 20:47
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param:
* @return: 1/0 * @return: 1/0
*/ */
private boolean isWorthSaving() { private boolean isWorthSaving() {
return !mIsDeleted && (existInDatabase() || !TextUtils.isEmpty(mContent)) if (mIsDeleted || (!existInDatabase() && TextUtils.isEmpty(mContent))
&& (!existInDatabase() || mNote.isLocalModified()); || (existInDatabase() && !mNote.isLocalModified())) {
return false;
} else {
return true;
}
} }
/** /**
* @method: setOnSettingStatusChangedListener * @method: setOnSettingStatusChangedListener
* @description: * @description:
* @date: 2023/12/22/20:50 * @date: 2023/12/22/20:50
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param:
* @return: * @return:
*/ */
public void setOnSettingStatusChangedListener(NoteSettingChangedListener l) { public void setOnSettingStatusChangedListener(NoteSettingChangedListener l) {
mNoteSettingStatusListener = l; mNoteSettingStatusListener = l;
} }
/** /**
* @method: setAlertDate * @method: setAlertDate
* @description: * @description:
* @date: 2023/12/22 21:03 * @date: 2023/12/22 21:03
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param:
* @return: * @return:
*/ */
public void setAlertDate(long date, boolean set) { public void setAlertDate(long date, boolean set) {
if (date != mAlertDate) { if (date != mAlertDate) {
mAlertDate = date; mAlertDate = date;
@ -294,46 +309,105 @@ public class WorkingNote {
mNoteSettingStatusListener.onClockAlertChanged(date, set); mNoteSettingStatusListener.onClockAlertChanged(date, set);
} }
} }
/** /**
* @method: markDeleted * @method: markDeleted
* @description: * @description:
* @date: 2023/12/22 21:04 * @date: 2023/12/22 21:04
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param:
* @return: * @return:
*/ */
public void markDeleted(boolean mark) { public void markDeleted(boolean mark) {
mIsDeleted = mark; mIsDeleted = mark;
if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID if (mWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID
&& mWidgetType != Notes.TYPE_WIDGET_INVALIDE && mNoteSettingStatusListener != null) { && mWidgetType != Notes.TYPE_WIDGET_INVALIDE && mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onWidgetChanged(); mNoteSettingStatusListener.onWidgetChanged();
}
}
/**
* @method: setBgColorId
* @description:ID
* @date: 2023/12/22 21:06
* @author: ZHANGLINHAO
* @param: ID
* @return:
*/
public void setBgColorId(int id) {
if (id != mBgColorId) {
mBgColorId = id;
if (mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onBackgroundColorChanged();
}
mNote.setNoteValue(NoteColumns.BG_COLOR_ID, String.valueOf(id));
}
}
/**
* @method: setCheckListMode
* @description:
* @date: 2023/12/22 21:07
* @author: ZHANGLINHAO
* @param:
* @return:
*/
public void setCheckListMode(int mode) {
if (mMode != mode) {
if (mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onCheckListModeChanged(mMode, mode);
}
mMode = mode;
mNote.setTextData(TextNote.MODE, String.valueOf(mMode));
}
}
/**
* @method: setWidgetType
* @description:
* @date: 2023/12/24 21:07
* @author: ZHANGLINHAO
* @param:
* @return:
*/
public void setWidgetType(int type) {
if (type != mWidgetType) {
mWidgetType = type;
mNote.setNoteValue(NoteColumns.WIDGET_TYPE, String.valueOf(mWidgetType));
}
}
/**
* @method: setWidgetId
* @description:ID
* @date: 2023/12/24 21:08
* @author: ZHANGLINHAO
* @param: ID
* @return:
*/
public void setWidgetId(int id) {
if (id != mWidgetId) {
mWidgetId = id;
mNote.setNoteValue(NoteColumns.WIDGET_ID, String.valueOf(mWidgetId));
} }
} }
/** /**
* @method: setWorkingText * @method: setWorkingText
* @description: * @description:
* @date: 2023/12/24 21:08 * @date: 2023/12/24 21:08
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param:
* @return: * @return:
*/ */
public void setWorkingText(String text) { public void setWorkingText(String text) {
if (!TextUtils.equals(mContent, text)) { if (!TextUtils.equals(mContent, text)) {
mContent = text; mContent = text;
mNote.setTextData(DataColumns.CONTENT, mContent); mNote.setTextData(DataColumns.CONTENT, mContent);
} }
} }
/** /**
* @method: convertToCallNote * @method: convertToCallNote
* @description: * @description:
* @date: 2023/12/24 21:09 * @date: 2023/12/24 21:09
* @author: ZHANGLINHAO * @author: ZHANGLINHAO
* @param: * @param:
* @return: * @return:
*/ */
public void convertToCallNote(String phoneNumber, long callDate) { public void convertToCallNote(String phoneNumber, long callDate) {
mNote.setCallData(CallNote.CALL_DATE, String.valueOf(callDate)); mNote.setCallData(CallNote.CALL_DATE, String.valueOf(callDate));
mNote.setCallData(CallNote.PHONE_NUMBER, phoneNumber); mNote.setCallData(CallNote.PHONE_NUMBER, phoneNumber);
@ -341,7 +415,7 @@ public class WorkingNote {
} }
public boolean hasClockAlert() { public boolean hasClockAlert() {
return (mAlertDate > 0); return (mAlertDate > 0 ? true : false);
} }
public String getContent() { public String getContent() {
@ -364,24 +438,6 @@ public class WorkingNote {
return mBgColorId; return mBgColorId;
} }
/**
* @method: setBgColorId
* @description:ID
* @date: 2023/12/22 21:06
* @author: ZHANGLINHAO
* @param: ID
* @return:
*/
public void setBgColorId(int id) {
if (id != mBgColorId) {
mBgColorId = id;
if (mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onBackgroundColorChanged();
}
mNote.setNoteValue(NoteColumns.BG_COLOR_ID, String.valueOf(id));
}
}
public int getTitleBgResId() { public int getTitleBgResId() {
return NoteBgResources.getNoteTitleBgResource(mBgColorId); return NoteBgResources.getNoteTitleBgResource(mBgColorId);
} }
@ -390,24 +446,6 @@ public class WorkingNote {
return mMode; return mMode;
} }
/**
* @method: setCheckListMode
* @description:
* @date: 2023/12/22 21:07
* @author: ZHANGLINHAO
* @param:
* @return:
*/
public void setCheckListMode(int mode) {
if (mMode != mode) {
if (mNoteSettingStatusListener != null) {
mNoteSettingStatusListener.onCheckListModeChanged(mMode, mode);
}
mMode = mode;
mNote.setTextData(TextNote.MODE, String.valueOf(mMode));
}
}
public long getNoteId() { public long getNoteId() {
return mNoteId; return mNoteId;
} }
@ -420,40 +458,10 @@ public class WorkingNote {
return mWidgetId; return mWidgetId;
} }
/**
* @method: setWidgetId
* @description:ID
* @date: 2023/12/24 21:08
* @author: ZHANGLINHAO
* @param: ID
* @return:
*/
public void setWidgetId(int id) {
if (id != mWidgetId) {
mWidgetId = id;
mNote.setNoteValue(NoteColumns.WIDGET_ID, String.valueOf(mWidgetId));
}
}
public int getWidgetType() { public int getWidgetType() {
return mWidgetType; return mWidgetType;
} }
/**
* @method: setWidgetType
* @description:
* @date: 2023/12/24 21:07
* @author: ZHANGLINHAO
* @param:
* @return:
*/
public void setWidgetType(int type) {
if (type != mWidgetType) {
mWidgetType = type;
mNote.setNoteValue(NoteColumns.WIDGET_TYPE, String.valueOf(mWidgetType));
}
}
public interface NoteSettingChangedListener { public interface NoteSettingChangedListener {
/** /**
* Called when the background color of current note has just changed * Called when the background color of current note has just changed
@ -472,7 +480,6 @@ public class WorkingNote {
/** /**
* Call when switch between check list mode and normal mode * Call when switch between check list mode and normal mode
*
* @param oldMode is previous mode before change * @param oldMode is previous mode before change
* @param newMode is new mode * @param newMode is new mode
*/ */

Loading…
Cancel
Save