diff --git a/.idea/misc.xml b/.idea/misc.xml index 7158618..cc72de3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - + diff --git a/.idea/modules.xml b/.idea/modules.xml index 199f6ef..8d269fd 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,8 +3,11 @@ + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 9db0f3e..b205a61 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,12 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion 26 defaultConfig { applicationId "com.yunzhou.qrcodeutils" minSdkVersion 19 - targetSdkVersion 25 + targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -24,7 +23,7 @@ dependencies { androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - compile 'com.android.support:appcompat-v7:25.3.1' + compile 'com.android.support:appcompat-v7:26.0.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile project(':qrcodelib') diff --git a/build.gradle b/build.gradle index c2eea8e..f3ead4d 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' + classpath 'com.android.tools.build:gradle:3.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -14,6 +14,7 @@ buildscript { allprojects { repositories { + google() jcenter() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a825b3c..d687bed 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Oct 12 13:00:20 CST 2017 +#Thu Jan 11 19:11:32 CST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/qrcodelib/build.gradle b/qrcodelib/build.gradle index 0a9ce12..aafd2c1 100644 --- a/qrcodelib/build.gradle +++ b/qrcodelib/build.gradle @@ -1,12 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion 26 defaultConfig { minSdkVersion 19 - targetSdkVersion 25 + targetSdkVersion 26 versionCode 1 versionName "1.0" @@ -21,6 +20,6 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:25.3.1' + compile 'com.android.support:appcompat-v7:26.0.1' compile 'com.google.zxing:core:3.3.0' } diff --git a/qrcodelib/src/main/java/com/yunzhou/qrcodelib/zxing/encoding/EncodingUtils.java b/qrcodelib/src/main/java/com/yunzhou/qrcodelib/zxing/encoding/EncodingUtils.java index f95ee25..06a349d 100644 --- a/qrcodelib/src/main/java/com/yunzhou/qrcodelib/zxing/encoding/EncodingUtils.java +++ b/qrcodelib/src/main/java/com/yunzhou/qrcodelib/zxing/encoding/EncodingUtils.java @@ -42,6 +42,8 @@ public static Bitmap createQRCode(String content, int widthPix, int heightPix, B hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); // 容错级别 hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); + // 设置二维码边距 + hints.put(EncodeHintType.MARGIN, 0); // 图像数据转换,使用了矩阵转换 BitMatrix bitMatrix = new QRCodeWriter().encode(content, BarcodeFormat.QR_CODE, widthPix, heightPix, hints);