Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhiqiang1993 authored May 30, 2018
1 parent 99e9e53 commit dc66b27
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,21 @@ allprojects {
--------------

```
private int REQUEST_CODE_SCAN = 111;
/*ZxingConfig是配置类 可以设置是否显示底部布局,闪光灯,相册,是否播放提示音 震动等动能
Intent intent = new Intent(MainActivity.this, CaptureActivity.class);
/*ZxingConfig是配置类
*可以设置是否显示底部布局,闪光灯,相册,
* 是否播放提示音 震动
* 设置扫描框颜色等
* 也可以不传这个参数
* 不传的话 默认都为默认不震动 其他都为true
* */
//ZxingConfig config = new ZxingConfig();
//config.setShowbottomLayout(true);//底部布局(包括闪光灯和相册)
//config.setPlayBeep(true);//是否播放提示音
//config.setShake(true);//是否震动
//config.setShowAlbum(true);//是否显示相册
//config.setShowFlashLight(true);//是否显示闪光灯
//如果不传 ZxingConfig的话,两行代码就能搞定了
Intent intent = new Intent(MainActivity.this, CaptureActivity.class);
//intent.putExtra(Constant.INTENT_ZXING_CONFIG, config);
ZxingConfig config = new ZxingConfig();
config.setPlayBeep(true);//是否播放扫描声音 默认为true
config.setShake(true);//是否震动 默认为true
config.setDecodeBarCode(false);//是否扫描条形码 默认为true
config.setReactColor(R.color.colorAccent);//设置扫描框四个角的颜色 默认为淡蓝色
config.setFrameLineColor(R.color.colorAccent);//设置扫描框边框颜色 默认无色
config.setFullScreenScan(false);//是否全屏扫描 默认为true 设为false则只会在扫描框中扫描
intent.putExtra(Constant.INTENT_ZXING_CONFIG, config);
startActivityForResult(intent, REQUEST_CODE_SCAN);
```
Expand Down

0 comments on commit dc66b27

Please sign in to comment.