Skip to content

Commit 2d60f57

Browse files
committed
添加示例
1 parent 45fe9fa commit 2d60f57

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,5 @@ That's it! Add then:
149149
- 其他待补充
150150

151151
- TODO
152-
下版本将默认界面中闪光灯去掉,因为使用者自己去实现更加合理。
152+
153+
下版本将默认界面中闪光灯去掉,因为使用者自己去实现更加合理。

app/src/main/java/com/dkaishu/zxinglibexample/MainActivity.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import android.os.Bundle;
88
import android.support.v7.app.AppCompatActivity;
99
import android.view.View;
10-
import android.widget.Button;
1110
import android.widget.ImageView;
1211
import android.widget.Toast;
1312

@@ -16,7 +15,6 @@
1615
import com.dkaishu.zxinglib.activity.CodeUtils;
1716

1817
public class MainActivity extends AppCompatActivity {
19-
private static final String TAG = "MainActivity";
2018
/**
2119
* 扫描跳转Activity RequestCode
2220
*/
@@ -34,9 +32,6 @@ protected void onCreate(Bundle savedInstanceState) {
3432

3533
@Override
3634
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
37-
/**
38-
* 处理二维码扫描结果
39-
*/
4035
if (requestCode == REQUEST_CODE) {
4136
//处理扫描结果(在界面上显示)
4237
if (null != data) {
@@ -52,10 +47,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
5247
}
5348
}
5449
}
55-
56-
5750
/*选择系统图片并解析*/
58-
5951
else if (requestCode == REQUEST_IMAGE) {
6052
if (data != null) {
6153
Uri uri = data.getData();
@@ -103,7 +95,7 @@ public void startCustomActivity(View view) {
10395
}
10496

10597
public void generateQR(View view) {
106-
Bitmap Bitmap = CodeUtils.createImage("生成二维码", 300, 300
98+
Bitmap Bitmap = CodeUtils.createImage("https://github.com/Dkaishu/ZXingLib", 300, 300
10799
, BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher));
108100
imageView.setImageBitmap(Bitmap);
109101
}

0 commit comments

Comments
 (0)