fixed demo compile error

pull/8/head
Mariotaku Lee 9 years ago
parent dfc5591800
commit 8bc3053cb5
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535

@ -16,7 +16,7 @@ public class QrCodeAndroid {
* @return a bitmap representing this QR Code, with padding and scaling * @return a bitmap representing this QR Code, with padding and scaling
* @throws IllegalArgumentException if the scale or border is out of range * @throws IllegalArgumentException if the scale or border is out of range
*/ */
public Bitmap toBitmap(QrCode qrCode, int scale, int border, Bitmap.Config config) { public static Bitmap toBitmap(QrCode qrCode, int scale, int border, Bitmap.Config config) {
if (scale <= 0 || border < 0) if (scale <= 0 || border < 0)
throw new IllegalArgumentException("Value out of range"); throw new IllegalArgumentException("Value out of range");
final int size = qrCode.size; final int size = qrCode.size;

@ -1,4 +1,5 @@
dependencies { dependencies {
compile project(':core') compile project(':core')
compile project(':javase') compile project(':javase')
compile project(':svg')
} }

@ -56,7 +56,7 @@ public final class QrCodeGeneratorDemo {
File imgFile = new File("hello-world-QR.png"); // File path for output File imgFile = new File("hello-world-QR.png"); // File path for output
ImageIO.write(img, "png", imgFile); // Write image to file ImageIO.write(img, "png", imgFile); // Write image to file
String svg = qr.toSvgString(4); // Convert to SVG XML code String svg = QrCodeJavaSVG.toSvgString(qr, 4); // Convert to SVG XML code
try (Writer out = new OutputStreamWriter( try (Writer out = new OutputStreamWriter(
new FileOutputStream("hello-world-QR.svg"), new FileOutputStream("hello-world-QR.svg"),
StandardCharsets.UTF_8)) { StandardCharsets.UTF_8)) {

@ -12,7 +12,7 @@ public class QrCodeJavaSVG {
* @param border the number of border modules to add, which must be non-negative * @param border the number of border modules to add, which must be non-negative
* @return a string representing this QR Code as an SVG document * @return a string representing this QR Code as an SVG document
*/ */
public String toSvgString(QrCode qr, int border) { public static String toSvgString(QrCode qr, int border) {
if (border < 0) if (border < 0)
throw new IllegalArgumentException("Border must be non-negative"); throw new IllegalArgumentException("Border must be non-negative");
final int size = qr.size; final int size = qr.size;

Loading…
Cancel
Save