Skip to content

Commit

Permalink
Reading whether the bill is "Front" or "Back"
Browse files Browse the repository at this point in the history
  • Loading branch information
matthill committed May 14, 2014
1 parent 5517caa commit dbe132b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions res/values/strings.xml
Expand Up @@ -3,6 +3,8 @@

<string name="app_name" translatable="false">Darwin Wallet</string>

<string name="front">front</string>
<string name="back">back</string>
<string name="loading">Loading...</string>
<string name="loading_currency">Loading %s...</string>
<string name="loading_complete">Loading complete.</string>
Expand Down
9 changes: 7 additions & 2 deletions src/com/ndu/mobile/darwinwallet/BillRecognizerActivity.java
Expand Up @@ -54,7 +54,7 @@ public class BillRecognizerActivity extends Activity implements IRecognitionEven
private static final int SOUND_RECOGNITION_EVENT = 2;
private static final int SOUND_CURRENCY_LOADED = 3;

private ProgressDialog dialog = null;
private ProgressDialog dialog = null;
private TextView lblOutput;

private CurrencyInfo loadedCurrency = null;
Expand Down Expand Up @@ -242,7 +242,7 @@ protected void onDestroy()
//Log.d("BillRecognizerActivity", "Destroy!!");
}

private int miss_count = 0;
private int miss_count = 0;
@Override
public void recognitionEvent(RecognitionResult result)
{
Expand All @@ -251,6 +251,11 @@ 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();
if (result.front == true)
output = output + " " + getString(R.string.front);
else
output = output + " " + getString(R.string.back);

lblOutput.setTextColor(Color.GREEN);
lblOutput.setText(output);
voice.speakWithoutCallback(output);
Expand Down

0 comments on commit dbe132b

Please sign in to comment.