diff --git a/.idea/modules.xml b/.idea/modules.xml index 3f14239..0ddf669 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,9 +3,10 @@ - + + \ No newline at end of file diff --git a/app/src/main/java/xyz/mtfos/btdemo/PrinterBle.java b/app/src/main/java/xyz/mtfos/btdemo/PrinterBle.java index b3bae0e..b74826c 100644 --- a/app/src/main/java/xyz/mtfos/btdemo/PrinterBle.java +++ b/app/src/main/java/xyz/mtfos/btdemo/PrinterBle.java @@ -59,6 +59,8 @@ public class PrinterBle { final public static int ALIGN_RIGHT = 0x02; private int lastAlign = 0x00; + private int lastWidth = 1; + private int lastHeigh = 1; // 藍芽狀態 public int mState = 0x00; @@ -412,20 +414,29 @@ public class PrinterBle { public PrinterBle setSize(int w, int h) { if (w < 1 || h < 1 || w > 3 || h > 3) return this; + lastWidth = w; + lastHeigh = h; return addText(String.format("__&s%d,%d__", w, h)); } public PrinterBle addHR() { int align = this.lastAlign; + int w = lastWidth; + int h = lastHeigh; setAlign(ALIGN_CENTER); + resetSize(); textNewLine(); addTextln(StringUtils.repeat('-', 20)); setAlign(align); + setSize(w, h); return this; } - public void resetSize() { + public PrinterBle resetSize() { + lastHeigh = 1; + lastWidth = 1; setSize(1, 1); + return this; } public ArrayList getDataQueue() { diff --git a/build.gradle b/build.gradle index 487c656..d4f002d 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0-beta2' + classpath 'com.android.tools.build:gradle:3.0.0-beta4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3da01cd..1b7e0ca 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Aug 07 11:04:39 CST 2017 +#Sun Sep 03 09:43:10 CST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip