コード例 #1
0
ファイル: BotActivity.java プロジェクト: royamir2012/IrPOC
  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");
    }
  }
コード例 #2
0
ファイル: BotActivity.java プロジェクト: royamir2012/IrPOC
  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;
  }
コード例 #3
0
ファイル: BotActivity.java プロジェクト: royamir2012/IrPOC
  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;
  }
コード例 #4
0
ファイル: BotActivity.java プロジェクト: royamir2012/IrPOC
 private void setupSendCommentButton() {
   btnSendComment.setOnSendClickListener(this);
 }