diff options
| author | dswitkin@google.com <dswitkin@google.com@59b500cc-1b3d-0410-9834-0bbf25fbcc57> | 2011-05-18 00:13:20 +0400 |
|---|---|---|
| committer | dswitkin@google.com <dswitkin@google.com@59b500cc-1b3d-0410-9834-0bbf25fbcc57> | 2011-05-18 00:13:20 +0400 |
| commit | 8f0bb0a0ca586acf4153092fbd854d64b301a2be (patch) | |
| tree | 11a2258626092ad06742e90eb8904a45b7302faf | |
| parent | a2fab36cda7f092d9a0c17fdf3be9ed812c11159 (diff) | |
| download | zxing-android-embedded-8f0bb0a0ca586acf4153092fbd854d64b301a2be.tar.xz | |
Cleaned up a bunch of TODOs and deleted the old ImageConverter app which has been supplanted by CommandLineRunner.
git-svn-id: http://zxing.googlecode.com/svn/trunk/android@1778 59b500cc-1b3d-0410-9834-0bbf25fbcc57
3 files changed, 12 insertions, 6 deletions
diff --git a/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java b/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java index 36b64a52..98a6998a 100644 --- a/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java +++ b/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java @@ -176,7 +176,7 @@ final class CameraConfigurationManager { } private void setFlash(Camera.Parameters parameters) { - // FIXME: This is a hack to turn the flash off on the Samsung Galaxy and the Behold II + // This is a hack to turn the flash off on the Samsung Galaxy and the Behold II // as advised by Samsung, neither of which respected the official parameter. if (Build.MODEL.contains("Behold II") && CameraManager.SDK_INT == 3) { // 3 = Cupcake parameters.set("flash-value", 1); diff --git a/src/com/google/zxing/client/android/encode/QRCodeEncoder.java b/src/com/google/zxing/client/android/encode/QRCodeEncoder.java index e8e52907..7570c5d1 100755 --- a/src/com/google/zxing/client/android/encode/QRCodeEncoder.java +++ b/src/com/google/zxing/client/android/encode/QRCodeEncoder.java @@ -147,8 +147,13 @@ final class QRCodeEncoder { } // We only do QR code. format = BarcodeFormat.QR_CODE; - // TODO: Consider using the Intent.EXTRA_SUBJECT or Intent.EXTRA_TITLE - displayContents = contents; + if (intent.hasExtra(Intent.EXTRA_SUBJECT)) { + displayContents = intent.getStringExtra(Intent.EXTRA_SUBJECT); + } else if (intent.hasExtra(Intent.EXTRA_TITLE)) { + displayContents = intent.getStringExtra(Intent.EXTRA_TITLE); + } else { + displayContents = contents; + } title = activity.getString(R.string.contents_text); return true; } @@ -348,7 +353,7 @@ final class QRCodeEncoder { hints = new Hashtable<EncodeHintType,Object>(2); hints.put(EncodeHintType.CHARACTER_SET, encoding); } - MultiFormatWriter writer = new MultiFormatWriter(); + MultiFormatWriter writer = new MultiFormatWriter(); BitMatrix result = writer.encode(contents, format, dimension, dimension, hints); int width = result.getWidth(); int height = result.getHeight(); diff --git a/src/com/google/zxing/client/android/history/HistoryManager.java b/src/com/google/zxing/client/android/history/HistoryManager.java index 11382bd1..9c791c40 100644 --- a/src/com/google/zxing/client/android/history/HistoryManager.java +++ b/src/com/google/zxing/client/android/history/HistoryManager.java @@ -131,7 +131,6 @@ public final class HistoryManager { } public void addHistoryItem(Result result) { - if (!activity.getIntent().getBooleanExtra(Intents.Scan.SAVE_HISTORY, true)) { return; // Do not save this item to the history. } @@ -154,7 +153,9 @@ public final class HistoryManager { ContentValues values = new ContentValues(); values.put(DBHelper.TEXT_COL, result.getText()); values.put(DBHelper.FORMAT_COL, result.getBarcodeFormat().toString()); - values.put(DBHelper.DISPLAY_COL, result.getText()); // TODO use parsed result display value? + // It would be nice to use ParsedResult.getDisplayResult() instead, but we don't want to + // parse it twice, and it can be multiline which won't fit in the current UI. + values.put(DBHelper.DISPLAY_COL, result.getText()); values.put(DBHelper.TIMESTAMP_COL, System.currentTimeMillis()); db.insert(DBHelper.TABLE_NAME, DBHelper.TIMESTAMP_COL, values); } finally { |
