Skip to content

Commit

Permalink
删除无用代码
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhiqiang1993 committed Oct 20, 2017
1 parent 43367a5 commit a1ec345
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion app/src/main/java/com/yzq/zxing/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.Manifest;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
Expand Down Expand Up @@ -70,13 +71,17 @@ public void onClick(View v) {
public void onSucceed(int requestCode, @NonNull List<String> grantPermissions) {
Intent intent = new Intent(MainActivity.this, CaptureActivity.class);

/*ZxingConfig是配置类 可以设置是否显示底部布局,闪光灯,相册,是否播放提示音 震动等动能
* 也可以不传这个参数
* 不传的话 默认都为默认不震动 其他都为true
* */

ZxingConfig config = new ZxingConfig();
config.setPlayBeep(true);
config.setShake(true);
intent.putExtra(Constant.INTENT_ZXING_CONFIG, config);

startActivityForResult(intent,REQUEST_CODE_SCAN);

}

@Override
Expand All @@ -93,6 +98,7 @@ public void onFailed(int requestCode, @NonNull List<String> deniedPermissions) {
Toast.makeText(this, "contentEtString不能为空", Toast.LENGTH_SHORT).show();
return;
}

Bitmap bitmap = null;
try {
bitmap = CodeCreator.createQRCode(contentEtString, 400, 400, null);
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta7'
classpath 'com.android.tools.build:gradle:3.0.0-rc2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // Add this line

// NOTE: Do not place your application dependencies here; they belong
Expand Down
9 changes: 3 additions & 6 deletions zxinglibrary/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<resources>
<string name="app_name">Zxing Library</string>
<!--zxing-->
<string name="msg_camera_framework_bug">Sorry, the Android camera encountered a problem. You may need to restart the device.</string>
<string name="button_ok">OK</string>
<string name="msg_camera_framework_bug">相机被占用或没有相机权限,请检查</string>
<string name="button_ok">退出</string>
<string name="viewfinderview_status_text1">将二维码/条码放入取景框内</string>
<string name="viewfinderview_status_text2">即可自动扫描</string>
<string name="title_activity_main">MainActivity</string>
<string name="title_home">Home</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_notifications">Notifications</string>



</resources>

0 comments on commit a1ec345

Please sign in to comment.