EscCommand esc = new EscCommand();
|
130
|
132
|
/*打印文字*/
|
|
131
|
|
- esc.addSelectPrintModes(EscCommand.FONT.FONTA, EscCommand.ENABLE.OFF, EscCommand.ENABLE.OFF, EscCommand.ENABLE.OFF, EscCommand.ENABLE.OFF);//取消倍高倍宽
|
|
|
133
|
+ esc.addSelectPrintModes(EscCommand.FONT.FONTA, EscCommand.ENABLE.OFF, EscCommand.ENABLE.OFF,
|
|
|
134
|
+ EscCommand.ENABLE.OFF, EscCommand.ENABLE.OFF);//取消倍高倍宽
|
|
132
|
135
|
esc.addSelectJustification(EscCommand.JUSTIFICATION.CENTER);//设置打印左对齐
|
|
133
|
136
|
esc.addText("拍爱\n"); // 打印文字
|
|
134
|
137
|
esc.addPrintAndLineFeed();
|
|
|
|
@@ -203,7 +206,7 @@ public class PrinterSettingPresenter implements PrinterSettingContract.Presenter
|
|
203
|
206
|
if(code==0){
|
|
204
|
207
|
Preferences.getInstance().setPrinterMac(device.getAddress());
|
|
205
|
208
|
}
|
|
206
|
|
- LogHelper.d("czy111","open port return code ="+code);
|
|
|
209
|
+ LogHelper.d(TAG,"open port return code ="+code);
|
|
207
|
210
|
} catch (Exception e) {
|
|
208
|
211
|
view.showToast(context.getString(R.string.printer_port_open_fail));
|
|
209
|
212
|
}
|
|
|
|
@@ -262,7 +265,7 @@ public class PrinterSettingPresenter implements PrinterSettingContract.Presenter
|
|
262
|
265
|
if (GpCom.ACTION_CONNECT_STATUS.equals(intent.getAction())) {
|
|
263
|
266
|
int type = intent.getIntExtra(GpPrintService.CONNECT_STATUS, 0);
|
|
264
|
267
|
int id = intent.getIntExtra(GpPrintService.PRINTER_ID, 0);
|
|
265
|
|
- Log.d("czy111", "connect status " + type);
|
|
|
268
|
+ Log.d(TAG, "connect status " + type);
|
|
266
|
269
|
if (type == GpDevice.STATE_CONNECTING) {
|
|
267
|
270
|
view.onPrinterStatusFetched(context.getString(R.string.connecting));
|
|
268
|
271
|
} else if (type == GpDevice.STATE_NONE) {
|