Skip to content

Commit

Permalink
Make IME Go-btn visible/pressable during dictation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaljurand committed Sep 30, 2015
1 parent 635283e commit 03ee180
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Expand Up @@ -151,8 +151,9 @@ public void onSwitchIme(boolean isAskUser) {

@Override
public void onGo() {
closeSession();
performGo();
handleClose();
requestHideSelf(0);
}

@Override
Expand Down Expand Up @@ -219,11 +220,6 @@ private void closeSession() {
}
}

private void handleClose() {
requestHideSelf(0);
closeSession();
}

private IBinder getToken() {
final Dialog dialog = getWindow();
if (dialog == null) {
Expand Down
9 changes: 4 additions & 5 deletions app/src/ee/ioc/phon/android/speak/view/SpeechInputView.java
Expand Up @@ -168,6 +168,7 @@ public boolean onLongClick(View v) {
mBImeGo.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cancelOrDestroy();
mListener.onGo();
}
});
Expand Down Expand Up @@ -243,9 +244,8 @@ private void setGuiInitState(int message) {
setText(mTvMessage, m);
}
setEnabled(mBComboSelector, true);
if (mBImeKeyboard != null && mBImeGo != null) {
if (mBImeKeyboard != null) {
setVisibility(mBImeKeyboard, View.VISIBLE);
setVisibility(mBImeGo, View.VISIBLE);
}
setText(mTvInstruction, R.string.buttonImeSpeak);
}
Expand Down Expand Up @@ -338,7 +338,7 @@ public void run() {

private void updateServiceLanguage(ServiceLanguageChooser slc) {
// Cancel a possibly running service
closeSession();
cancelOrDestroy();
Pair<String, String> pair = Utils.getLabel(getContext(), slc.getCombo());
mBComboSelector.setText(pair.second + " · " + pair.first);
mRecognizer = slc.getSpeechRecognizer();
Expand Down Expand Up @@ -382,9 +382,8 @@ public void onReadyForSpeech(Bundle params) {
setText(mTvInstruction, R.string.buttonImeStop);
setText(mTvMessage, "");
setEnabled(mBComboSelector, false);
if (mBImeKeyboard != null && mBImeGo != null) {
if (mBImeKeyboard != null) {
setVisibility(mBImeKeyboard, View.INVISIBLE);
setVisibility(mBImeGo, View.INVISIBLE);
}
}

Expand Down

0 comments on commit 03ee180

Please sign in to comment.