diff --git a/01src/XiaoMiNotes/MyApplication/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java b/01src/XiaoMiNotes/MyApplication/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
index c67a1bc..02c2e1c 100644
--- a/01src/XiaoMiNotes/MyApplication/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
+++ b/01src/XiaoMiNotes/MyApplication/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
@@ -190,10 +190,34 @@ public class NoteEditActivity extends Activity implements OnClickListener,
}
public void ReadNow(){
- ;
+ String noteContent = getCurrentNoteContent();
+ if (noteContent.isEmpty()){
+ MediaPlayer player=MediaPlayer.create(this,R.raw.pleaseinput);
+ player.start();
+ Toast.makeText(NoteEditActivity.this, "请输入内容", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ Toast.makeText(NoteEditActivity.this, "开始阅读", Toast.LENGTH_SHORT).show();
+ // 开始朗读(使用本地语音)
+ tts.speak(noteContent, TextToSpeech.QUEUE_ADD, null, "test");
}
+ private String getCurrentNoteContent() {//获取文本
+ if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) {
+ StringBuilder content = new StringBuilder();
+ for (int i = 0; i < mEditTextList.getChildCount(); i++) {
+ View itemView = mEditTextList.getChildAt(i);
+ CheckBox checkBox = itemView.findViewById(R.id.cb_edit_item);
+ NoteEditText editText = itemView.findViewById(R.id.et_edit_text);
+ String prefix = checkBox.isChecked() ? "已完成: " : "未完成: ";
+ content.append(prefix).append(editText.getText()).append("\n");
+ }
+ return content.toString();
+ } else {
+ return mNoteEditor.getText().toString();
+ }
+ }//
/**
* Current activity may be killed when the memory is low. Once it is killed, for another time
diff --git a/01src/XiaoMiNotes/MyApplication/app/src/main/res/layout/note_edit.xml b/01src/XiaoMiNotes/MyApplication/app/src/main/res/layout/note_edit.xml
index 10b2aa7..90b3056 100644
--- a/01src/XiaoMiNotes/MyApplication/app/src/main/res/layout/note_edit.xml
+++ b/01src/XiaoMiNotes/MyApplication/app/src/main/res/layout/note_edit.xml
@@ -69,6 +69,17 @@
android:layout_height="fill_parent"
android:orientation="vertical">
+
+
+
+
+
@@ -396,5 +409,7 @@
android:layout_marginBottom="-7dip"
android:src="@drawable/selected" />
+
+