Skip to content

Commit

Permalink
When continuously scanning a custom message gets overridden after the…
Browse files Browse the repository at this point in the history
… first scan #13
  • Loading branch information
EddyVerbruggen committed May 23, 2017
1 parent fbc21be commit 361a073
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Surface;
import android.view.SurfaceHolder;
Expand Down Expand Up @@ -814,7 +812,15 @@ public void restartPreviewAfterDelay(long delayMS) {

private void resetStatusView() {
resultView.setVisibility(View.GONE);
statusView.setText(R.string.msg_default_status);

// in case of continuous scan mode we don't want the message to be reset to the default if previously overridden
String customPromptMessage = getIntent().getStringExtra(Intents.Scan.PROMPT_MESSAGE);
if (customPromptMessage != null) {
statusView.setText(customPromptMessage);
} else {
statusView.setText(R.string.msg_default_status);
}

statusView.setVisibility(View.VISIBLE);
viewfinderView.setVisibility(View.VISIBLE);
lastResult = null;
Expand Down

0 comments on commit 361a073

Please sign in to comment.