From e4ee08c75e3917d70f1d25f58dc8c95333c06360 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 23 Aug 2017 23:30:11 +0800 Subject: [PATCH] update demo method --- app/src/main/java/xyz/mtfos/btdemo/MainActivity.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/xyz/mtfos/btdemo/MainActivity.kt b/app/src/main/java/xyz/mtfos/btdemo/MainActivity.kt index ef3b71b..2cf35f3 100644 --- a/app/src/main/java/xyz/mtfos/btdemo/MainActivity.kt +++ b/app/src/main/java/xyz/mtfos/btdemo/MainActivity.kt @@ -68,7 +68,15 @@ class MainActivity : Activity() { btn.setOnClickListener { val txt: String = intxt.text.toString() - ble?.setAlign(PrinterBle.ALIGN_CENTER)?.addText(txt) + ble?.setSize(2,1) + ble?.setAlign(PrinterBle.ALIGN_CENTER) + ble?.addTextln("MTFoS Shop") + ble?.resetSize() + ble?.setAlign(PrinterBle.ALIGN_RIGHT) + ble?.addTextln("MTFoS Shop") + ble?.addHR() + ble?.setAlign(PrinterBle.ALIGN_LEFT) + ble?.addText(txt) ble?.sendQueue() }