diff --git a/libzxing/src/main/java/com/jwsd/libzxing/QRCodeManager.java b/libzxing/src/main/java/com/jwsd/libzxing/QRCodeManager.java index 2619698..72af9ed 100644 --- a/libzxing/src/main/java/com/jwsd/libzxing/QRCodeManager.java +++ b/libzxing/src/main/java/com/jwsd/libzxing/QRCodeManager.java @@ -31,6 +31,9 @@ public class QRCodeManager extends IQRCodeStrategy { */ private int requestType = 0; + private int textType = 0; + + private QRCodeManager() { } @@ -75,6 +78,17 @@ public QRCodeManager setReqeustType(int reqeustType) { return this; } + /** + * 设置文本类型 + * + * @param textType + * @return + */ + public QRCodeManager setTextType(int textType) { + this.textType = textType; + return this; + } + /** *

扫描二维码.

* 带回调的,一般表示结果由本管理器来处理onActivityResult方法,结果通过callback拿到。 @@ -110,6 +124,7 @@ void scanning(int requestCode) { this.curRequestCode = requestCode; Intent intent = new Intent(context, CaptureActivity.class); intent.putExtra("type", requestType); + intent.putExtra("textType", textType); context.startActivityForResult(intent, curRequestCode); } diff --git a/libzxing/src/main/java/com/jwsd/libzxing/activity/CaptureActivity.java b/libzxing/src/main/java/com/jwsd/libzxing/activity/CaptureActivity.java index 5f9280d..49fd97b 100644 --- a/libzxing/src/main/java/com/jwsd/libzxing/activity/CaptureActivity.java +++ b/libzxing/src/main/java/com/jwsd/libzxing/activity/CaptureActivity.java @@ -72,11 +72,13 @@ public class CaptureActivity extends Activity implements private RelativeLayout scanContainer; private RelativeLayout scanCropView; private ImageView scanLine; + private TextView capture_mask_bottom; private Rect mCropRect = null; private boolean isHasSurface = false; private ImageView ivBack, ivMullt; private int captureType = 0; + private int textType = 0; private TextView tvAlbum; private static final int CODE_GALLERY_REQUEST = 101; @@ -98,6 +100,7 @@ public void onCreate(Bundle icicle) { window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContentView(R.layout.activity_capture); captureType = getIntent().getIntExtra("type", 0); + textType = getIntent().getIntExtra("textType", 0); String string = getApplication().getResources().getString(R.string.jwstr_scan_it); // Log.e("hdltag", "onCreate(CaptureActivity.java:102):" +string); scanPreview = (SurfaceView) findViewById(R.id.capture_preview); @@ -107,6 +110,10 @@ public void onCreate(Bundle icicle) { ivBack = (ImageView) findViewById(R.id.iv_back); ivMullt = (ImageView) findViewById(R.id.iv_mudle); tvAlbum = (TextView) findViewById(R.id.tv_capture_select_album_jwsd); + capture_mask_bottom = (TextView) findViewById(R.id.capture_mask_bottom); + if (textType != 0){ + capture_mask_bottom.setText(getString(R.string.jwstr_scan_device)); + } ivBack.setTag(123); ivMullt.setTag(124); tvAlbum.setTag(125); diff --git a/libzxing/src/main/res/values-zh-rCN/strings.xml b/libzxing/src/main/res/values-zh-rCN/strings.xml index 57b0305..62252aa 100644 --- a/libzxing/src/main/res/values-zh-rCN/strings.xml +++ b/libzxing/src/main/res/values-zh-rCN/strings.xml @@ -6,4 +6,5 @@ 图中无二维码或二维码难以识别 提示 确定 + 请扫描机身上的二维码 \ No newline at end of file diff --git a/libzxing/src/main/res/values/strings.xml b/libzxing/src/main/res/values/strings.xml index 106d050..90435aa 100644 --- a/libzxing/src/main/res/values/strings.xml +++ b/libzxing/src/main/res/values/strings.xml @@ -8,4 +8,5 @@ 图中无二维码或二维码难以识别 相机异常 Confirm + Please scan the QR code on the device body. \ No newline at end of file