wll_branch
dev 3 months ago
parent e842081375
commit 336b09b30b

@ -28,7 +28,6 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Paint;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Spannable;
@ -52,11 +51,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.Button;
import android.speech.tts.TextToSpeech;
import android.speech.tts.UtteranceProgressListener;
import java.util.Locale;
import net.micode.notes.R;
import net.micode.notes.data.Notes;
@ -78,7 +72,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class NoteEditActivity extends Activity implements OnClickListener,
NoteSettingChangedListener, OnTextViewChangeListener {
private class HeadViewHolder {
@ -155,33 +148,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private String mUserQuery;
private Pattern mPattern;
private Button readButton;
private TextToSpeech tts;//接口
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.note_edit);
tts = new TextToSpeech(this, new TextToSpeech.OnInitListener() {//tts初始化
@Override
public void onInit(int status) {
if(status == TextToSpeech.SUCCESS) {//设置中文
int result = tts.setLanguage(Locale.CHINA);
if (result != TextToSpeech.LANG_COUNTRY_AVAILABLE && result != TextToSpeech.LANG_AVAILABLE) {
Toast.makeText(NoteEditActivity.this, "正在跳转", Toast.LENGTH_SHORT).show();
}
tts.setSpeechRate(1.0f);//速度
tts.setPitch(1.0f);//音调
}
}
});
readButton=findViewById(R.id.readnote);//按钮
readButton.setOnClickListener(new View.OnClickListener() {//点击阅读
@Override public void onClick(View view) {
ReadNow();
}
});
if (savedInstanceState == null && !initActivityState(getIntent())) {
finish();
return;
@ -189,12 +161,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
initResources();
}
public void ReadNow(){
;
}
/**
* Current activity may be killed when the memory is low. Once it is killed, for another time
* user load this activity, we should restore the former state

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="15dp"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal"
>
<TextView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:text=" "
android:textSize="55dp"
></TextView>
<EditText
android:id="@+id/hour"
android:layout_width="60dp"
android:layout_height="50dp"
></EditText>
<TextView
android:layout_width="40dp"
android:layout_height="wrap_content"
android:text="h"
android:textSize="30dp"></TextView>
<EditText
android:id="@+id/min"
android:layout_width="60dp"
android:layout_height="50dp"
></EditText>
<TextView
android:layout_width="40dp"
android:layout_height="wrap_content"
android:text="m"
android:textSize="30dp"></TextView>
<EditText
android:id="@+id/sec"
android:layout_width="60dp"
android:layout_height="50dp"
></EditText>
<TextView
android:layout_width="40dp"
android:layout_height="wrap_content"
android:text="s"
android:textSize="30dp"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp">
</LinearLayout>
</LinearLayout>
Loading…
Cancel
Save