Exemplo n.º 1
0
  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");
    }
  }
Exemplo n.º 2
0
  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;
  }
Exemplo n.º 3
0
  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;
  }
Exemplo n.º 4
0
 private void setupSendCommentButton() {
   btnSendComment.setOnSendClickListener(this);
 }