Methods Summary |
---|
public void | onAbortVoice(Caller caller, Request request, java.lang.CharSequence message, android.os.Bundle extras)
Log.i(TAG, "onAbortVoice: message=" + message + " extras=" + extras);
mText.setText(message);
mPendingRequest = request;
mState = STATE_ABORT_VOICE;
updateState();
|
public void | onCancel(Request request)
Log.i(TAG, "onCancel");
request.sendCancelResult();
|
public void | onClick(android.view.View v)
if (v == mStartButton) {
mState = STATE_LAUNCHING;
updateState();
startVoiceActivity(mStartIntent);
} else if (v == mConfirmButton) {
if (mState == STATE_CONFIRM) {
mPendingRequest.sendConfirmResult(true, null);
} else {
mPendingRequest.sendCommandResult(true, null);
}
mPendingRequest = null;
mState = STATE_IDLE;
updateState();
} else if (v == mAbortButton) {
mPendingRequest.sendAbortVoiceResult(null);
mPendingRequest = null;
mState = STATE_IDLE;
updateState();
} else if (v== mCompleteButton) {
mPendingRequest.sendCompleteVoiceResult(null);
mPendingRequest = null;
mState = STATE_IDLE;
updateState();
}
|
public void | onCommand(Caller caller, Request request, java.lang.String command, android.os.Bundle extras)
Log.i(TAG, "onCommand: command=" + command + " extras=" + extras);
mText.setText("Command: " + command);
mStartButton.setText("Finish Command");
mPendingRequest = request;
mState = STATE_COMMAND;
updateState();
|
public void | onCompleteVoice(Caller caller, Request request, java.lang.CharSequence message, android.os.Bundle extras)
Log.i(TAG, "onCompleteVoice: message=" + message + " extras=" + extras);
mText.setText(message);
mPendingRequest = request;
mState = STATE_COMPLETE_VOICE;
updateState();
|
public void | onConfirm(Caller caller, Request request, java.lang.CharSequence prompt, android.os.Bundle extras)
Log.i(TAG, "onConfirm: prompt=" + prompt + " extras=" + extras);
mText.setText(prompt);
mStartButton.setText("Confirm");
mPendingRequest = request;
mState = STATE_CONFIRM;
updateState();
|
public void | onCreate(android.os.Bundle args)
super.onCreate(args);
showWindow();
mStartIntent = args.getParcelable("intent");
|
public android.view.View | onCreateContentView()
mContentView = getLayoutInflater().inflate(R.layout.voice_interaction_session, null);
mText = (TextView)mContentView.findViewById(R.id.text);
mStartButton = (Button)mContentView.findViewById(R.id.start);
mStartButton.setOnClickListener(this);
mConfirmButton = (Button)mContentView.findViewById(R.id.confirm);
mConfirmButton.setOnClickListener(this);
mCompleteButton = (Button)mContentView.findViewById(R.id.complete);
mCompleteButton.setOnClickListener(this);
mAbortButton = (Button)mContentView.findViewById(R.id.abort);
mAbortButton.setOnClickListener(this);
updateState();
return mContentView;
|
public boolean[] | onGetSupportedCommands(Caller caller, java.lang.String[] commands)
return new boolean[commands.length];
|
void | updateState()
mStartButton.setEnabled(mState == STATE_IDLE);
mConfirmButton.setEnabled(mState == STATE_CONFIRM || mState == STATE_COMMAND);
mAbortButton.setEnabled(mState == STATE_ABORT_VOICE);
mCompleteButton.setEnabled(mState == STATE_COMPLETE_VOICE);
|