Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Enqueue the voice start call to give time to the cancel to finish (#2212
Browse files Browse the repository at this point in the history
)

* Enqueue the start call to give time to the cancel to finish

* Increased the wait time for cancel to finish
  • Loading branch information
keianhzo authored and bluemarvin committed Nov 8, 2019
1 parent 44f4306 commit 30a1a72
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,20 @@ private void setDecodingState() {
}

private void setResultState() {
mVoiceSearchText1.setText(R.string.voice_search_error);
mVoiceSearchText1.setVisibility(View.VISIBLE);
mVoiceSearchText2.setText(R.string.voice_search_try_again);
mVoiceSearchText2.setVisibility(View.VISIBLE);
mVoiceSearchText3.setVisibility(View.VISIBLE);
mVoiceSearchInput.setVisibility(View.VISIBLE);
mVoiceSearchSearching.clearAnimation();
mVoiceSearchSearching.setVisibility(View.INVISIBLE);

stopVoiceSearch();
startVoiceSearch();

postDelayed(() -> {
mVoiceSearchText1.setText(R.string.voice_search_error);
mVoiceSearchText1.setVisibility(View.VISIBLE);
mVoiceSearchText2.setText(R.string.voice_search_try_again);
mVoiceSearchText2.setVisibility(View.VISIBLE);
mVoiceSearchText3.setVisibility(View.VISIBLE);
mVoiceSearchInput.setVisibility(View.VISIBLE);
mVoiceSearchSearching.clearAnimation();
mVoiceSearchSearching.setVisibility(View.INVISIBLE);

startVoiceSearch();
}, 100);
}

private void setPermissionNotGranted() {
Expand Down

0 comments on commit 30a1a72

Please sign in to comment.