|
|
|
@ -55,6 +55,9 @@ public class NoteItemData {
|
|
|
|
|
private static final int WIDGET_ID_COLUMN = 10;
|
|
|
|
|
private static final int WIDGET_TYPE_COLUMN = 11;
|
|
|
|
|
|
|
|
|
|
/** 以下这些数据,对照着NotesDatabaseHelper.java看
|
|
|
|
|
* 都是数据行里设置好的属性
|
|
|
|
|
* @zhoukexing 2023/12/25 20:22 */
|
|
|
|
|
private long mId;
|
|
|
|
|
private long mAlertDate;
|
|
|
|
|
private int mBgColorId;
|
|
|
|
@ -76,8 +79,16 @@ public class NoteItemData {
|
|
|
|
|
private boolean mIsOneNoteFollowingFolder;
|
|
|
|
|
private boolean mIsMultiNotesFollowingFolder;
|
|
|
|
|
|
|
|
|
|
public NoteItemData(Context context, Cursor cursor) {
|
|
|
|
|
mId = cursor.getLong(ID_COLUMN);
|
|
|
|
|
/**
|
|
|
|
|
* @method: NoteItemData
|
|
|
|
|
* @description: 描述一下方法的作用
|
|
|
|
|
* @date: 2023/12/25 19:58
|
|
|
|
|
* @author: zhoukexing
|
|
|
|
|
* @param: [context, cursor]
|
|
|
|
|
* @return:
|
|
|
|
|
*/
|
|
|
|
|
public NoteItemData(Context context, Cursor cursor) { // 把cursor理解为这样一个指针,指向一个表格 @zhoukexing 2023/12/25 20:12
|
|
|
|
|
mId = cursor.getLong(ID_COLUMN); // 可以根据传入的列号获取到表格里对应列的值 @zhoukexing 2023/12/25 20:12
|
|
|
|
|
mAlertDate = cursor.getLong(ALERTED_DATE_COLUMN);
|
|
|
|
|
mBgColorId = cursor.getInt(BG_COLOR_ID_COLUMN);
|
|
|
|
|
mCreatedDate = cursor.getLong(CREATED_DATE_COLUMN);
|
|
|
|
@ -93,8 +104,9 @@ public class NoteItemData {
|
|
|
|
|
mWidgetType = cursor.getInt(WIDGET_TYPE_COLUMN);
|
|
|
|
|
|
|
|
|
|
mPhoneNumber = "";
|
|
|
|
|
if (mParentId == Notes.ID_CALL_RECORD_FOLDER) {
|
|
|
|
|
if (mParentId == Notes.ID_CALL_RECORD_FOLDER) { //Q: 文件夹为什么有电话记录之说?怎么是通过一个便签的父文件夹来判断便签内有无电话号码?@zkx 2023/12/25
|
|
|
|
|
mPhoneNumber = DataUtils.getCallNumberByNoteId(context.getContentResolver(), mId);
|
|
|
|
|
// 根据电话号码锁定联系人名称,若不在联系人里,直接使用电话号码 @zhoukexing 2023/12/25 20:17
|
|
|
|
|
if (!TextUtils.isEmpty(mPhoneNumber)) {
|
|
|
|
|
mName = Contact.getContact(context, mPhoneNumber);
|
|
|
|
|
if (mName == null) {
|
|
|
|
|