Compare commits

...

88 Commits

Author SHA1 Message Date
fxk d7c0e73f5b j
2 years ago
hui bed9e4bc2c update doc
2 years ago
hui f31022f02a commit 123
2 years ago
hui bb7d3d0f21 Merge branch 'master' of https://bdgit.educoder.net/p2whvruqn/gitProject1
2 years ago
hui 29eeb9ae94 1
2 years ago
chenjr c68a68ed03 Merge branch 'master' of https://bdgit.educoder.net/p2whvruqn/gitProject1
2 years ago
chenjr 6e786317be 泛读报告
2 years ago
hui 63fc6f227a 12
2 years ago
hui 05ecb4fb7b 1
2 years ago
hui 02d92e225b Merge branch 'master' of https://bdgit.educoder.net/p2whvruqn/gitProject1
2 years ago
hui e9fcc6c528 1
2 years ago
hui 91c18b220f Merge branch 'dev' of https://bdgit.educoder.net/p2whvruqn/gitProject1
2 years ago
hui 3a7edd98fc h
2 years ago
p2whvruqn 755f329ed4 Delete 'doc/小米便签开源代码的泛读报告.docx'
2 years ago
p2whvruqn f0c2ab2854 ADD file via upload
2 years ago
hui f30460317d 1
2 years ago
hui 1e50287393 doc
2 years ago
hui 96e52cd8a5 123
2 years ago
hui 620160c710 Merge branch 'dev' of https://bdgit.educoder.net/p2whvruqn/gitProject1 into dev
2 years ago
hui a0dcc10031 doc
2 years ago
hui f28b11b203 123
2 years ago
hui 346a73b7b9 doc
2 years ago
hui 875083f833 123
2 years ago
hui 384ba99def 1
2 years ago
hui 4b65cef4a1 Merge branch 'master' into dev
2 years ago
hui 72ae1efeca 123
2 years ago
hui 82bfa6fdeb 1
2 years ago
hui 52f027a19c 1
2 years ago
hui 7e2536a1dd Merge branch 'master' of https://bdgit.educoder.net/p2whvruqn/gitProject1 into dev
2 years ago
hui 811584ba08 123
2 years ago
hui df1001eb3a 1
2 years ago
hui ae0beb0025 doc
2 years ago
hui 9323a047da 123
2 years ago
hui 4da11dc8a2 1
2 years ago
hui ec9e2f6975 123
2 years ago
hui 54dbe5f568 123
2 years ago
hui 7a6b6c44e2 1
2 years ago
hui ec7106456d 1
2 years ago
hui 4c1d111626 doc
2 years ago
hui b99ba7e6cc Merge branch 'dev' of https://bdgit.educoder.net/p2whvruqn/gitProject1 into dev
2 years ago
hui a938bde0aa 1
2 years ago
hui f8e505a993 1
2 years ago
hui ca2f5b598c 1
2 years ago
hui b7e3334175 doc
2 years ago
hui cb55e11b91 doc
2 years ago
hui 0804253d15 1
2 years ago
hui 729b2fc8d8 1
2 years ago
hui dd93a764ce doc
2 years ago
hui 0aa11fcdca 1
2 years ago
hui 611c89d1a0 Merge branch 'dev' of https://bdgit.educoder.net/p2whvruqn/gitProject1
2 years ago
hui 7eff3bd202 doc
2 years ago
hui 2d4c103132 1
2 years ago
hui a4c7c3650d 1
2 years ago
hui 573436eb7c Merge branch 'master' of https://bdgit.educoder.net/p2whvruqn/gitProject1
2 years ago
hui ab4f39edd6 1
2 years ago
hui 90802f7065 doc
2 years ago
hui 1a353ab5fa 123
2 years ago
hui 300eea2d8b doc
2 years ago
hui 1a0f92cb0a 1
2 years ago
hui a271454b3b docdoc
2 years ago
hui ce97540ca3 doc
2 years ago
hui 3c4769118a doc
2 years ago
hui 961614f11d doc
2 years ago
hui 1b8be398b0 doc
2 years ago
hui 01d314d5b4 doc
2 years ago
hui 52e67d01c9 1
2 years ago
hui 6876fdfb9d doc
2 years ago
hui 53e27e6412 doc
2 years ago
hui 5f6d20bc1d 1
2 years ago
hui 049a20376c doc
2 years ago
hui dd346cedfd doc
2 years ago
hui 793fe237d9 doc
2 years ago
hui 46cd2c774c doc
2 years ago
hui 3842e674e9 doc
2 years ago
hui 115abee7f4 Merge branch 'llw_branch' of https://bdgit.educoder.net/p2whvruqn/gitProject1 into dev
2 years ago
emptystack1024 c91e4a7ddc 1
2 years ago
hui 89b9c23c3f 1
2 years ago
hui 8b307730e5 Merge branch 'llw_branch' of https://bdgit.educoder.net/p2whvruqn/gitProject1 into dev
2 years ago
hui b6bfe19eef doc
2 years ago
hui 1d97543118 Merge branch 'fxk_branch' of https://bdgit.educoder.net/p2whvruqn/gitProject1 into dev
2 years ago
hui 80005f8890 doc
2 years ago
chenjr 18a67ccd75 chen
2 years ago
chenjr 291d418f3f Merge branch 'cjr_branch' of https://bdgit.educoder.net/p2whvruqn/gitProject1
2 years ago
chenjr e86e474ca6 chen
2 years ago
chenjr 8be528cce2 read
2 years ago
emptystack1024 5f5cff49fc src/Notes-master/.gradle/7.5/checksums/checksums.lock
2 years ago
emptystack1024 0deee0fad3 Merge branch 'master' of https://bdgit.educoder.net/p2whvruqn/gitProject1 into llw_branch
2 years ago
p2whvruqn 2904bfb769 Initial commit
2 years ago

@ -1,7 +1,12 @@
<<<<<<< HEAD
<<<<<<< HEAD
# gitProject1
1.精读小米便签源代码,写泛读报告
<<<<<<< HEAD
2.
=======
=======
<<<<<<< HEAD
<<<<<<< HEAD
@ -15,3 +20,12 @@ abc
# gitProject1
>>>>>>> 678e0f2fc21bc4a1625205602371ca421396ceee
>>>>>>> 856149d31b3fdb3d65ebb0c2da0a49c2b8417f9e
=======
# gitProject1
=======
# gitProject1
1.精读小米便签源代码,写泛读报告
>>>>>>> ec5b092c2fe5adbe24627fc2992503627dc1795b
>>>>>>> 5f5cff49fcbaa1b5df8823143d84bbfcc52cd49f
>>>>>>> 63fc6f227a94c2fab6101a51858ced17a7619c89

@ -14,48 +14,54 @@
* limitations under the License.
*/
package net.micode.notes.model;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.OperationApplicationException;
import android.net.Uri;
import android.os.RemoteException;
import android.util.Log;
package net.micode.notes.model;//创建一个包,用于区别类名的命名空间
import android.content.ContentProviderOperation;//批量的更新、插入、删除数据。
import android.content.ContentProviderResult;//操作的结果
import android.content.ContentUris;//用于添加和获取Uri后面的ID
import android.content.ContentValues;//一种用来存储基本数据类型数据的存储机制
import android.content.Context;//需要用该类来弄清楚调用者的实例
import android.content.OperationApplicationException;//操作应用程序容错
import android.net.Uri;//表示待操作的数据
import android.os.RemoteException;//远程容错
import android.util.Log;//输出日志,比如说出错、警告等
//引入其余包
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.CallNote;
import net.micode.notes.data.Notes.DataColumns;
import net.micode.notes.data.Notes.NoteColumns;
import net.micode.notes.data.Notes.TextNote;
import java.util.ArrayList;
import java.util.ArrayList;//系统的自带的可变数组的类
public class Note {
private ContentValues mNoteDiffValues;
private NoteData mNoteData;
//mNoteDiffValues和mNoteData
private static final String TAG = "Note";
/**
* Create a new note id for adding a new note to databases
* id
*/
public static synchronized long getNewNoteId(Context context, long folderId) {
// Create a new note in the database
// 在数据库中加入一个新的笔记
ContentValues values = new ContentValues();
long createdTime = System.currentTimeMillis();
values.put(NoteColumns.CREATED_DATE, createdTime);
values.put(NoteColumns.MODIFIED_DATE, createdTime);
values.put(NoteColumns.TYPE, Notes.TYPE_NOTE);
values.put(NoteColumns.LOCAL_MODIFIED, 1);
values.put(NoteColumns.PARENT_ID, folderId);
long createdTime = System.currentTimeMillis();//创建一个变量记录创建的时间
values.put(NoteColumns.CREATED_DATE, createdTime);//将创建日期的值付给 CREATED_DATE创建时间
values.put(NoteColumns.MODIFIED_DATE, createdTime);//将创建日期的值付给 MODIFIED_DATE修改时间
values.put(NoteColumns.TYPE, Notes.TYPE_NOTE);//把type的值赋为0
values.put(NoteColumns.LOCAL_MODIFIED, 1);//把LOCAL_MODIFIED 本地修改 的值赋为1
values.put(NoteColumns.PARENT_ID, folderId);//把文件夹id赋给PARENT_ID 父类id
Uri uri = context.getContentResolver().insert(Notes.CONTENT_NOTE_URI, values);
long noteId = 0;
try {
noteId = Long.valueOf(uri.getPathSegments().get(1));
} catch (NumberFormatException e) {
}
catch (NumberFormatException e) {
Log.e(TAG, "Get note id error :" + e.toString());
noteId = 0;
}
@ -153,7 +159,7 @@ public class Note {
}
void setTextDataId(long id) {
if(id <= 0) {
if (id <= 0) {
throw new IllegalArgumentException("Text data id should larger than 0");
}
mTextDataId = id;
@ -189,7 +195,7 @@ public class Note {
ArrayList<ContentProviderOperation> operationList = new ArrayList<ContentProviderOperation>();
ContentProviderOperation.Builder builder = null;
if(mTextDataValues.size() > 0) {
if (mTextDataValues.size() > 0) {
mTextDataValues.put(DataColumns.NOTE_ID, noteId);
if (mTextDataId == 0) {
mTextDataValues.put(DataColumns.MIME_TYPE, TextNote.CONTENT_ITEM_TYPE);
@ -197,12 +203,14 @@ public class Note {
mTextDataValues);
try {
setTextDataId(Long.valueOf(uri.getPathSegments().get(1)));
} catch (NumberFormatException e) {
}
catch (NumberFormatException e) {
Log.e(TAG, "Insert new text data fail with noteId" + noteId);
mTextDataValues.clear();
return null;
}
} else {
}
else {
builder = ContentProviderOperation.newUpdate(ContentUris.withAppendedId(
Notes.CONTENT_DATA_URI, mTextDataId));
builder.withValues(mTextDataValues);
@ -211,7 +219,7 @@ public class Note {
mTextDataValues.clear();
}
if(mCallDataValues.size() > 0) {
if (mCallDataValues.size() > 0) {
mCallDataValues.put(DataColumns.NOTE_ID, noteId);
if (mCallDataId == 0) {
mCallDataValues.put(DataColumns.MIME_TYPE, CallNote.CONTENT_ITEM_TYPE);
@ -219,12 +227,14 @@ public class Note {
mCallDataValues);
try {
setCallDataId(Long.valueOf(uri.getPathSegments().get(1)));
} catch (NumberFormatException e) {
}
catch (NumberFormatException e) {
Log.e(TAG, "Insert new call data fail with noteId" + noteId);
mCallDataValues.clear();
return null;
}
} else {
}
else {
builder = ContentProviderOperation.newUpdate(ContentUris.withAppendedId(
Notes.CONTENT_DATA_URI, mCallDataId));
builder.withValues(mCallDataValues);
@ -239,10 +249,12 @@ public class Note {
Notes.AUTHORITY, operationList);
return (results == null || results.length == 0 || results[0] == null) ? null
: ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, noteId);
} catch (RemoteException e) {
}
catch (RemoteException e) {
Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
return null;
} catch (OperationApplicationException e) {
}
catch (OperationApplicationException e) {
Log.e(TAG, String.format("%s: %s", e.toString(), e.getMessage()));
return null;
}

@ -2,6 +2,7 @@
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
#
#Tue Mar 28 15:42:34 CST 2023
sdk.dir=D\:\\programming\\androidstudio\\Sdk
# For customization when using a Version Control System, please read the
# header note.
#Thu Apr 13 00:09:07 CST 2023
sdk.dir=C\:\\Users\\33398\\AppData\\Local\\Android\\Sdk

Loading…
Cancel
Save