|
|
|
@ -473,16 +473,15 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
|
|
|
|
|
new AsyncTask<Void, Void, HashSet<AppWidgetAttribute>>() {
|
|
|
|
|
protected HashSet<AppWidgetAttribute> doInBackground(Void... unused) {
|
|
|
|
|
HashSet<AppWidgetAttribute> widgets = mNotesListAdapter.getSelectedWidget();
|
|
|
|
|
if (!isSyncMode()) {
|
|
|
|
|
// if not synced, delete notes directly
|
|
|
|
|
if (mCurrentFolderId == Notes.ID_TRASH_FOLER){ // 只需要修改这里
|
|
|
|
|
// if in trash, really delete notes
|
|
|
|
|
if (DataUtils.batchDeleteNotes(mContentResolver, mNotesListAdapter
|
|
|
|
|
.getSelectedItemIds())) {
|
|
|
|
|
} else {
|
|
|
|
|
Log.e(TAG, "Delete notes error, should not happens");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// in sync mode, we'll move the deleted note into the trash
|
|
|
|
|
// folder
|
|
|
|
|
// move notes to trash
|
|
|
|
|
if (!DataUtils.batchMoveToFolder(mContentResolver, mNotesListAdapter
|
|
|
|
|
.getSelectedItemIds(), Notes.ID_TRASH_FOLER)) {
|
|
|
|
|
Log.e(TAG, "Move notes to trash folder error, should not happens");
|
|
|
|
@ -812,12 +811,27 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
|
|
|
|
|
case R.id.menu_search:
|
|
|
|
|
onSearchRequested();
|
|
|
|
|
break;
|
|
|
|
|
case R.id.menu_trash:
|
|
|
|
|
openTrashFolder();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void openTrashFolder() {
|
|
|
|
|
// 将当前列表的编辑状态设置为子文件夹模式
|
|
|
|
|
mState = ListEditState.SUB_FOLDER;
|
|
|
|
|
// 将当前文件夹 ID 设置为垃圾箱的 ID
|
|
|
|
|
mCurrentFolderId = Notes.ID_TRASH_FOLER;
|
|
|
|
|
startAsyncNotesListQuery();
|
|
|
|
|
// 不显示底部的“写便签”
|
|
|
|
|
mAddNewNote.setVisibility(View.GONE);
|
|
|
|
|
// 将顶部栏设置为 data.getSnippet 文件夹名称
|
|
|
|
|
mTitleBar.setText(NotesListActivity.this
|
|
|
|
|
.getString(R.string.menu_trash));
|
|
|
|
|
mTitleBar.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onSearchRequested() {
|
|
|
|
|
startSearch(null, false, null /* appData */, false);
|
|
|
|
|