Skip to content

Commit

Permalink
No longer speaks 'dollars' after each bill read
Browse files Browse the repository at this point in the history
  • Loading branch information
matthill committed May 18, 2014
1 parent 78a56b4 commit 11b774e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/com/ndu/mobile/darwinwallet/BillRecognizerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,31 @@ public void recognitionEvent(RecognitionResult result)

if (result.match_found)
{
output = getResources().getBoolean(R.bool.sign_before_value) ? loadedCurrency.getSymbol() + result.bill_value : result.bill_value + loadedCurrency.getSymbol();
String speechOutput = String.valueOf(result.bill_value);

if (getResources().getBoolean(R.bool.sign_before_value))
{
output = loadedCurrency.getSymbol() + result.bill_value;
}
else
{
output = result.bill_value + loadedCurrency.getSymbol();
}

if (result.front == true)
{
output = output + " " + getString(R.string.front);
speechOutput = speechOutput + " " + getString(R.string.front);
}
else
{
output = output + " " + getString(R.string.back);
speechOutput = speechOutput + " " + getString(R.string.back);
}

lblOutput.setTextColor(Color.GREEN);
lblOutput.setText(output);
voice.speakWithoutCallback(output);
voice.speakWithoutCallback(speechOutput);
playSound(SOUND_RECOGNITION_EVENT);
}
else
Expand Down

0 comments on commit 11b774e

Please sign in to comment.