cmt: track onCreate 50%

zhengkunpeng_branch
zkx 2 years ago
parent 7552054c2c
commit d88a65106d

@ -176,6 +176,14 @@ public class WorkingNote {
public static WorkingNote createEmptyNote(Context context, long folderId, int widgetId,
int widgetType, int defaultBgColorId) {
/**
* @method: createEmptyNote
* @description: 便
* @date: 2023/12/20 23:55
* @author: zhoukexing
* @param: [context, folderId, widgetId, widgetType, defaultBgColorId]
* @return: net.micode.notes.model.WorkingNote WorkingNote
*/
WorkingNote note = new WorkingNote(context, folderId);
note.setBgColorId(defaultBgColorId);
note.setWidgetId(widgetId);

@ -172,6 +172,7 @@ public class NoteEditActivity extends Activity //NOTE: extends--单继承,但
this.setContentView(R.layout.note_edit);
if (savedInstanceState == null && !initActivityState(getIntent())) {
// savedInstanceState? @zhoukexing 2023/12/20 23:45
finish();
return;
}
@ -250,6 +251,7 @@ public class NoteEditActivity extends Activity //NOTE: extends--单继承,但
ResourceParser.getDefaultBgId(this));
// Parse call-record note
// 解析文档,看是否有号码存在,以便展示的时候渲染 @zhoukexing 2023/12/20 23:49
String phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
long callDate = intent.getLongExtra(Notes.INTENT_EXTRA_CALL_DATE, 0);
if (callDate != 0 && phoneNumber != null) {
@ -259,6 +261,7 @@ public class NoteEditActivity extends Activity //NOTE: extends--单继承,但
long noteId = 0;
if ((noteId = DataUtils.getNoteIdByPhoneNumberAndCallDate(getContentResolver(),
phoneNumber, callDate)) > 0) {
// TODO: 2023/12/20
mWorkingNote = WorkingNote.load(this, noteId);
if (mWorkingNote == null) {
Log.e(TAG, "load call note failed with note id" + noteId);
@ -270,7 +273,7 @@ public class NoteEditActivity extends Activity //NOTE: extends--单继承,但
widgetType, bgResId);
mWorkingNote.convertToCallNote(phoneNumber, callDate);
}
} else {
} else { // 没有要显示的电话
mWorkingNote = WorkingNote.createEmptyNote(this, folderId, widgetId, widgetType,
bgResId);
}

Loading…
Cancel
Save