|
|
@@ -222,7 +222,6 @@ public class WorkDailyAddActivity extends BaseActivity implements RecognizerDial
|
|
|
initView();
|
|
|
doVoiceClickEvent();
|
|
|
}
|
|
|
- String voicewords = new String();
|
|
|
private int voice_type = 0;
|
|
|
private void doVoiceClickEvent() {
|
|
|
final VoiceToWord voice = new VoiceToWord(WorkDailyAddActivity.this,"534e3fe2");
|
|
|
@@ -230,6 +229,7 @@ public class WorkDailyAddActivity extends BaseActivity implements RecognizerDial
|
|
|
voice_summary.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
+ voice_summary.setImageResource(R.drawable.btn_yuyin_pressed);
|
|
|
voice_type = 1;
|
|
|
voice.GetWordFromVoice();
|
|
|
}
|
|
|
@@ -238,6 +238,7 @@ public class WorkDailyAddActivity extends BaseActivity implements RecognizerDial
|
|
|
voice_plan.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
+ voice_plan.setImageResource(R.drawable.btn_yuyin_pressed);
|
|
|
voice_type = 2;
|
|
|
voice.GetWordFromVoice();
|
|
|
}
|
|
|
@@ -246,6 +247,7 @@ public class WorkDailyAddActivity extends BaseActivity implements RecognizerDial
|
|
|
voice_experience.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
+ voice_experience.setImageResource(R.drawable.btn_yuyin_pressed);
|
|
|
voice_type = 3;
|
|
|
voice.GetWordFromVoice();
|
|
|
}
|
|
|
@@ -256,14 +258,16 @@ public class WorkDailyAddActivity extends BaseActivity implements RecognizerDial
|
|
|
String text = JsonParser.parseIatResult(recognizerResult.getResultString());
|
|
|
System.out.println(text);
|
|
|
Toast.makeText(mContext, text, Toast.LENGTH_LONG).show();
|
|
|
- voicewords = voicewords + text;
|
|
|
|
|
|
if (voice_type == 1){
|
|
|
- add_summary.setText(voicewords);
|
|
|
+ add_summary.setText(add_summary.getText().toString() + text);
|
|
|
+ voice_summary.setImageResource(R.drawable.btn_yuyin_nor);
|
|
|
}else if (voice_type == 2){
|
|
|
- add_plan.setText(voicewords);
|
|
|
+ add_plan.setText(add_plan.getText().toString() + text );
|
|
|
+ voice_plan.setImageResource(R.drawable.btn_yuyin_nor);
|
|
|
}else if (voice_type == 3){
|
|
|
- add_experience.setText(voicewords);
|
|
|
+ add_experience.setText(add_experience.getText().toString() + text);
|
|
|
+ voice_experience.setImageResource(R.drawable.btn_yuyin_nor);
|
|
|
}
|
|
|
}
|
|
|
|