private void sendComment() { String comment = getComment(); String userinput = getUserInput(); if (userinput != null) { appendComment(BotAdapter.Type.Voice, userinput); etComment.setText(null); btnSendComment.setCurrentState(SendRequestButton.STATE_DONE); } if (comment != null) { appendComment(BotAdapter.Type.Voice, comment); etComment.setText(null); btnSendComment.setCurrentState(SendRequestButton.STATE_DONE); /*if (comment.equals("Calling")) // let's try and open Skype... { callSkype(); } else*/ // TODO remove after fix message tts.speak(comment, TextToSpeech.QUEUE_FLUSH, null, "1"); } }
private String getComment() { String comment = etComment.getText().toString(); if (TextUtils.isEmpty(comment)) { btnSendComment.startAnimation(AnimationUtils.loadAnimation(this, R.anim.shake_error)); return null; } comment = dialogManager.sendRequest(comment); if (TextUtils.isEmpty(comment)) { btnSendComment.startAnimation(AnimationUtils.loadAnimation(this, R.anim.shake_error)); return null; } return comment; }
private String getUserInput() { String userInput = etComment.getText().toString(); if (TextUtils.isEmpty(userInput)) { btnSendComment.startAnimation(AnimationUtils.loadAnimation(this, R.anim.shake_error)); return null; } return userInput; }
private void setupSendCommentButton() { btnSendComment.setOnSendClickListener(this); }