|
|
|
@ -28,6 +28,7 @@ import android.content.DialogInterface;
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
|
import android.graphics.Paint;
|
|
|
|
|
import android.graphics.Typeface;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.preference.PreferenceManager;
|
|
|
|
|
import android.text.Spannable;
|
|
|
|
@ -71,6 +72,14 @@ import java.util.Map;
|
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
import android.app.AlertDialog;
|
|
|
|
|
import android.app.Dialog;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.inputmethod.InputMethodManager;
|
|
|
|
|
import android.app.AlertDialog.Builder;
|
|
|
|
|
|
|
|
|
|
public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
NoteSettingChangedListener, OnTextViewChangeListener {
|
|
|
|
@ -185,9 +194,9 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
* then jump to the NotesListActivity
|
|
|
|
|
*/
|
|
|
|
|
mWorkingNote = null;
|
|
|
|
|
if (TextUtils.equals(Intent.ACTION_VIEW, intent.getAction())) {
|
|
|
|
|
long noteId = intent.getLongExtra(Intent.EXTRA_UID, 0);
|
|
|
|
|
mUserQuery = "";
|
|
|
|
|
if (TextUtils.equals(Intent.ACTION_VIEW, intent.getAction())) {//如果当前请求是查看便签请求
|
|
|
|
|
long noteId = intent.getLongExtra(Intent.EXTRA_UID, 0);//获取便签的ID
|
|
|
|
|
mUserQuery = "";//清空用户查询内容
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Starting from the searched result
|
|
|
|
@ -203,8 +212,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
showToast(R.string.error_note_not_exist);
|
|
|
|
|
finish();
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
mWorkingNote = WorkingNote.load(this, noteId);
|
|
|
|
|
} else {//ID在数据库中找到了
|
|
|
|
|
mWorkingNote = WorkingNote.load(this, noteId);//用WorkingNote中的load方法讲便签内容整个放到一个过渡类型的当前工作便签中
|
|
|
|
|
if (mWorkingNote == null) {
|
|
|
|
|
Log.e(TAG, "load note failed with note id" + noteId);
|
|
|
|
|
finish();
|
|
|
|
@ -214,7 +223,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
getWindow().setSoftInputMode(
|
|
|
|
|
WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN
|
|
|
|
|
| WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
|
|
|
|
} else if(TextUtils.equals(Intent.ACTION_INSERT_OR_EDIT, intent.getAction())) {
|
|
|
|
|
} else if(TextUtils.equals(Intent.ACTION_INSERT_OR_EDIT, intent.getAction())) {//刚刚创建的一个新便签
|
|
|
|
|
// New note
|
|
|
|
|
long folderId = intent.getLongExtra(Notes.INTENT_EXTRA_FOLDER_ID, 0);
|
|
|
|
|
int widgetId = intent.getIntExtra(Notes.INTENT_EXTRA_WIDGET_ID,
|
|
|
|
@ -234,7 +243,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
long noteId = 0;
|
|
|
|
|
if ((noteId = DataUtils.getNoteIdByPhoneNumberAndCallDate(getContentResolver(),
|
|
|
|
|
phoneNumber, callDate)) > 0) {
|
|
|
|
|
mWorkingNote = WorkingNote.load(this, noteId);
|
|
|
|
|
mWorkingNote = WorkingNote.load(this, noteId);//加载便签的结果赋值给mworkingnote,存放当前正在工作的便签信息。
|
|
|
|
|
if (mWorkingNote == null) {
|
|
|
|
|
Log.e(TAG, "load call note failed with note id" + noteId);
|
|
|
|
|
finish();
|
|
|
|
@ -242,12 +251,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
mWorkingNote = WorkingNote.createEmptyNote(this, folderId, widgetId,
|
|
|
|
|
widgetType, bgResId);
|
|
|
|
|
widgetType, bgResId);//调用createEmptyNote方法创建一个新的便签
|
|
|
|
|
mWorkingNote.convertToCallNote(phoneNumber, callDate);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
mWorkingNote = WorkingNote.createEmptyNote(this, folderId, widgetId, widgetType,
|
|
|
|
|
bgResId);
|
|
|
|
|
bgResId);//
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getWindow().setSoftInputMode(
|
|
|
|
@ -258,14 +267,14 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
finish();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
mWorkingNote.setOnSettingStatusChangedListener(this);
|
|
|
|
|
mWorkingNote.setOnSettingStatusChangedListener(this);//设计便签状态,改变监听器
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onResume() {
|
|
|
|
|
super.onResume();
|
|
|
|
|
initNoteScreen();
|
|
|
|
|
initNoteScreen();//根据mWorkingNote中的内容初始化便签的各个控件。
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initNoteScreen() {
|
|
|
|
@ -319,17 +328,18 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
//在Activity即将被销毁时的回调方法,用于保存当前Activity的状态,以便在Activity被恢复时能够正确地加载之前的状态。
|
|
|
|
|
protected void onSaveInstanceState(Bundle outState) {
|
|
|
|
|
super.onSaveInstanceState(outState);
|
|
|
|
|
super.onSaveInstanceState(outState);//用于保存Activity实例状态的方法调用
|
|
|
|
|
/**
|
|
|
|
|
* For new note without note id, we should firstly save it to
|
|
|
|
|
* generate a id. If the editing note is not worth saving, there
|
|
|
|
|
* is no id which is equivalent to create new note
|
|
|
|
|
*/
|
|
|
|
|
if (!mWorkingNote.existInDatabase()) {
|
|
|
|
|
saveNote();
|
|
|
|
|
if (!mWorkingNote.existInDatabase()) {//创建一个新的标签时先在数据库匹配
|
|
|
|
|
saveNote();//如果不存在,在数据库中存储
|
|
|
|
|
}
|
|
|
|
|
outState.putLong(Intent.EXTRA_UID, mWorkingNote.getNoteId());
|
|
|
|
|
outState.putLong(Intent.EXTRA_UID, mWorkingNote.getNoteId());//将ID存储到outState对象中
|
|
|
|
|
Log.d(TAG, "Save working note id: " + mWorkingNote.getNoteId() + " onSaveInstanceState");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -374,7 +384,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
mNoteEditor = (EditText) findViewById(R.id.note_edit_view);
|
|
|
|
|
mNoteEditorPanel = findViewById(R.id.sv_note_edit);
|
|
|
|
|
mNoteBgColorSelector = findViewById(R.id.note_bg_color_selector);
|
|
|
|
|
for (int id : sBgSelectorBtnsMap.keySet()) {
|
|
|
|
|
for (int id : sBgSelectorBtnsMap.keySet()) {//用于遍历 sBgSelectorBtnsMap 集合中的每个键(即布局文件中 ImageView 控件的 ID)
|
|
|
|
|
ImageView iv = (ImageView) findViewById(id);
|
|
|
|
|
iv.setOnClickListener(this);
|
|
|
|
|
}
|
|
|
|
@ -427,10 +437,10 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
int id = v.getId();
|
|
|
|
|
//通过v.getId()获取点击事件的View的ID。然后根据不同的ID进行不同的逻辑处理
|
|
|
|
|
if (id == R.id.btn_set_bg_color) {
|
|
|
|
|
mNoteBgColorSelector.setVisibility(View.VISIBLE);
|
|
|
|
|
findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility(
|
|
|
|
|
- View.VISIBLE);
|
|
|
|
|
findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility(View.VISIBLE);
|
|
|
|
|
} else if (sBgSelectorBtnsMap.containsKey(id)) {
|
|
|
|
|
findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility(
|
|
|
|
|
View.GONE);
|
|
|
|
@ -507,52 +517,169 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
|
|
switch (item.getItemId()) {
|
|
|
|
|
case R.id.menu_new_note:
|
|
|
|
|
createNewNote();
|
|
|
|
|
break;
|
|
|
|
|
case R.id.menu_delete:
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
|
|
|
|
builder.setTitle(getString(R.string.alert_title_delete));
|
|
|
|
|
builder.setIcon(android.R.drawable.ic_dialog_alert);
|
|
|
|
|
builder.setMessage(getString(R.string.alert_message_delete_note));
|
|
|
|
|
builder.setPositiveButton(android.R.string.ok,
|
|
|
|
|
new DialogInterface.OnClickListener() {
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
deleteCurrentNote();
|
|
|
|
|
finish();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
builder.setNegativeButton(android.R.string.cancel, null);
|
|
|
|
|
builder.show();
|
|
|
|
|
break;
|
|
|
|
|
case R.id.menu_font_size:
|
|
|
|
|
mFontSizeSelector.setVisibility(View.VISIBLE);
|
|
|
|
|
findViewById(sFontSelectorSelectionMap.get(mFontSizeId)).setVisibility(View.VISIBLE);
|
|
|
|
|
break;
|
|
|
|
|
case R.id.menu_list_mode:
|
|
|
|
|
mWorkingNote.setCheckListMode(mWorkingNote.getCheckListMode() == 0 ?
|
|
|
|
|
TextNote.MODE_CHECK_LIST : 0);
|
|
|
|
|
break;
|
|
|
|
|
case R.id.menu_share:
|
|
|
|
|
getWorkingText();
|
|
|
|
|
sendTo(this, mWorkingNote.getContent());
|
|
|
|
|
break;
|
|
|
|
|
case R.id.menu_send_to_desktop:
|
|
|
|
|
sendToDesktop();
|
|
|
|
|
break;
|
|
|
|
|
case R.id.menu_alert:
|
|
|
|
|
setReminder();
|
|
|
|
|
break;
|
|
|
|
|
case R.id.menu_delete_remind:
|
|
|
|
|
mWorkingNote.setAlertDate(0, false);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
int itemId = item.getItemId();
|
|
|
|
|
//在这个方法中,首先获取被点击的选项的ID,然后根据ID的不同执行相应的操作
|
|
|
|
|
if (itemId == R.id.menu_new_note) {
|
|
|
|
|
createNewNote();
|
|
|
|
|
}
|
|
|
|
|
/*else if(itemId==R.id.menu_set_password) {
|
|
|
|
|
|
|
|
|
|
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
|
|
|
|
final View view = LayoutInflater.from(this).inflate(R.layout.dialog_edit_text,null);
|
|
|
|
|
//编辑Text
|
|
|
|
|
final EditText etName = (EditText)view.findViewById(R.id.et_foler_name);
|
|
|
|
|
etName.setText("");
|
|
|
|
|
etName.setHint("请输入密码");
|
|
|
|
|
builder.setTitle("为便签设置新密码");
|
|
|
|
|
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
//获取输入的字符串
|
|
|
|
|
String password = etName.getText().toString();
|
|
|
|
|
//设置密码
|
|
|
|
|
mWorkingNote.setPassword(password);
|
|
|
|
|
//设置密码成功提示
|
|
|
|
|
Toast.makeText(NoteEditActivity.this, "密码设置成功", Toast.LENGTH_SHORT).show();
|
|
|
|
|
//关闭软键盘
|
|
|
|
|
InputMethodManager inputMethodManager = (InputMethodManager)
|
|
|
|
|
getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
|
inputMethodManager.hideSoftInputFromWindow(etName.getWindowToken(),0);
|
|
|
|
|
//关闭dialog
|
|
|
|
|
dialog.dismiss();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
//关闭软键盘
|
|
|
|
|
InputMethodManager inputMethodManager = (InputMethodManager)
|
|
|
|
|
getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
|
inputMethodManager.hideSoftInputFromWindow(etName.getWindowToken(),0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
final Dialog dialog = builder.setView(view).show();
|
|
|
|
|
dialog.show();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if(itemId==R.id.menu_delete_password) {
|
|
|
|
|
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
|
|
|
|
final View view = LayoutInflater.from(this).inflate(R.layout.dialog_edit_text,null);
|
|
|
|
|
//编辑Text
|
|
|
|
|
final EditText etName = (EditText)view.findViewById(R.id.et_foler_name);
|
|
|
|
|
builder.setTitle("确定要删除密码吗?");
|
|
|
|
|
etName.setText("");
|
|
|
|
|
etName.setHint("请输入密码核实身份");
|
|
|
|
|
String mPassword = mWorkingNote.getmPassword();
|
|
|
|
|
builder.setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
String password = etName.getText().toString();//获取输入字符
|
|
|
|
|
if(password.equals(mPassword)) {
|
|
|
|
|
Toast.makeText(NoteEditActivity.this, "身份校验正确,密码删除成功", Toast.LENGTH_SHORT).show();
|
|
|
|
|
mWorkingNote.setPassword(null);//删除密码
|
|
|
|
|
//关闭dialog
|
|
|
|
|
dialog.dismiss();
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
Toast.makeText(NoteEditActivity.this, "身份校验错误,密码删除失败", Toast.LENGTH_SHORT).show();
|
|
|
|
|
//关闭dialog
|
|
|
|
|
dialog.dismiss();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
final Dialog dialog = builder.setView(view).show();
|
|
|
|
|
dialog.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
else if (itemId == R.id.menu_delete) {
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
|
|
|
|
builder.setTitle(getString(R.string.alert_title_delete));
|
|
|
|
|
builder.setIcon(android.R.drawable.ic_dialog_alert);
|
|
|
|
|
builder.setMessage(getString(R.string.alert_message_delete_note));
|
|
|
|
|
builder.setPositiveButton(android.R.string.ok,
|
|
|
|
|
new DialogInterface.OnClickListener() {
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
deleteCurrentNote();
|
|
|
|
|
finish();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
builder.setNegativeButton(android.R.string.cancel, null);
|
|
|
|
|
builder.show();
|
|
|
|
|
} else if (itemId == R.id.menu_font_size) {
|
|
|
|
|
mFontSizeSelector.setVisibility(View.VISIBLE);
|
|
|
|
|
findViewById(sFontSelectorSelectionMap.get(mFontSizeId)).setVisibility(View.VISIBLE);
|
|
|
|
|
} else if (itemId == R.id.menu_list_mode) {
|
|
|
|
|
mWorkingNote.setCheckListMode(mWorkingNote.getCheckListMode() == 0 ?
|
|
|
|
|
TextNote.MODE_CHECK_LIST : 0);
|
|
|
|
|
} else if (itemId == R.id.menu_share) {
|
|
|
|
|
getWorkingText();
|
|
|
|
|
sendTo(this, mWorkingNote.getContent());
|
|
|
|
|
} else if (itemId == R.id.menu_send_to_desktop) {
|
|
|
|
|
sendToDesktop();
|
|
|
|
|
} else if (itemId == R.id.menu_alert) {
|
|
|
|
|
setReminder();
|
|
|
|
|
} else if (itemId == R.id.menu_delete_remind) {
|
|
|
|
|
mWorkingNote.setAlertDate(0, false);
|
|
|
|
|
} else if (itemId == R.id.menu_font_change){
|
|
|
|
|
showSingleAlertDiglog();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void showSingleAlertDiglog(){
|
|
|
|
|
final String[] items ={"默认-普通","默认-非衬线","默认-衬线","默认-等宽"};
|
|
|
|
|
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
|
|
|
|
|
alertBuilder.setTitle("选择字体");
|
|
|
|
|
alertBuilder.setSingleChoiceItems(items, 0, new
|
|
|
|
|
DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
|
|
switch (i)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
mNoteEditor.setTypeface(Typeface.DEFAULT);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
mNoteEditor.setTypeface(Typeface.SANS_SERIF);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
mNoteEditor.setTypeface(Typeface.SERIF);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
mNoteEditor.setTypeface(Typeface.MONOSPACE);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Toast.makeText(NoteEditActivity.this,items[i],
|
|
|
|
|
Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
alertBuilder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
|
|
AlertDialog alertDialog1 = alertBuilder.create();
|
|
|
|
|
alertDialog1.dismiss();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
alertBuilder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
|
|
AlertDialog alertDialog1 = alertBuilder.create();
|
|
|
|
|
alertDialog1.dismiss();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
AlertDialog alertDialog1 = alertBuilder.create();
|
|
|
|
|
alertDialog1.show();
|
|
|
|
|
}
|
|
|
|
|
private void setReminder() {
|
|
|
|
|
DateTimePickerDialog d = new DateTimePickerDialog(this, System.currentTimeMillis());
|
|
|
|
|
d.setOnDateTimeSetListener(new OnDateTimeSetListener() {
|
|
|
|
@ -574,7 +701,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
context.startActivity(intent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void createNewNote() {
|
|
|
|
|
private void createNewNote() {//新建便签
|
|
|
|
|
// Firstly, save current editing notes
|
|
|
|
|
saveNote();
|
|
|
|
|
|
|
|
|
@ -583,13 +710,15 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
Intent intent = new Intent(this, NoteEditActivity.class);
|
|
|
|
|
intent.setAction(Intent.ACTION_INSERT_OR_EDIT);
|
|
|
|
|
intent.putExtra(Notes.INTENT_EXTRA_FOLDER_ID, mWorkingNote.getFolderId());
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
//然后创建一个新的Intent对象,指定要启动的NoteEditActivity类,并设置Action为Intent.ACTION_INSERT_OR_EDIT,
|
|
|
|
|
// 并通过Extra传递当前便签所在文件夹的ID。
|
|
|
|
|
startActivity(intent);//启动新的NoteEditActivity。
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void deleteCurrentNote() {
|
|
|
|
|
if (mWorkingNote.existInDatabase()) {
|
|
|
|
|
private void deleteCurrentNote() {//删除便签(需要加入一个删除密码)
|
|
|
|
|
if (mWorkingNote.existInDatabase()) {//判断当前便签是否在数据库中
|
|
|
|
|
HashSet<Long> ids = new HashSet<Long>();
|
|
|
|
|
long id = mWorkingNote.getNoteId();
|
|
|
|
|
long id = mWorkingNote.getNoteId();//如果存在,则获取当前便签的ID,并将其添加到一个HashSet对象中。
|
|
|
|
|
if (id != Notes.ID_ROOT_FOLDER) {
|
|
|
|
|
ids.add(id);
|
|
|
|
|
} else {
|
|
|
|
@ -805,9 +934,9 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
return hasChecked;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean saveNote() {
|
|
|
|
|
getWorkingText();
|
|
|
|
|
boolean saved = mWorkingNote.saveNote();
|
|
|
|
|
private boolean saveNote() {//保存当前正在编辑的笔记的文本内容
|
|
|
|
|
getWorkingText();//获取正在编辑的笔记的文本内容
|
|
|
|
|
boolean saved = mWorkingNote.saveNote();//保存在吗WorkingNote对象中
|
|
|
|
|
if (saved) {
|
|
|
|
|
/**
|
|
|
|
|
* There are two modes from List view to edit view, open one note,
|
|
|
|
|