@@ -4,6 +4,7 @@ import android.os.Bundle; |
||
| 4 | 4 |
import android.support.annotation.Nullable; |
| 5 | 5 |
import android.widget.ListView; |
| 6 | 6 |
import android.widget.TextView; |
| 7 |
+import android.widget.Toast; |
|
| 7 | 8 |
import android.widget.ToggleButton; |
| 8 | 9 |
|
| 9 | 10 |
import com.android.views.mergeAdapter.MergeAdapter; |
@@ -12,6 +13,7 @@ import ai.pai.lensman.R; |
||
| 12 | 13 |
import ai.pai.lensman.base.BaseActivity; |
| 13 | 14 |
import butterknife.BindView; |
| 14 | 15 |
import butterknife.ButterKnife; |
| 16 |
+import butterknife.OnClick; |
|
| 15 | 17 |
|
| 16 | 18 |
/** |
| 17 | 19 |
* Created by chengzhenyu on 2016/8/31. |
@@ -20,7 +22,6 @@ import butterknife.ButterKnife; |
||
| 20 | 22 |
public class PrinterSettingActivity extends BaseActivity implements PrinterSettingContract.View {
|
| 21 | 23 |
|
| 22 | 24 |
@BindView(R.id.tv_printer_status) TextView printerStatusText; |
| 23 |
- @BindView(R.id.tv_print_test) TextView printTestText; |
|
| 24 | 25 |
@BindView(R.id.tv_bluetooth_status) TextView bluetoothStatusText; |
| 25 | 26 |
@BindView(R.id.tb_bluetooth_switch) ToggleButton btSwitchToggle; |
| 26 | 27 |
@BindView(R.id.list_bt_devices) ListView btDevicesList; |
@@ -55,32 +56,32 @@ public class PrinterSettingActivity extends BaseActivity implements PrinterSetti |
||
| 55 | 56 |
|
| 56 | 57 |
@Override |
| 57 | 58 |
public void onBluetoothEnabled() {
|
| 58 |
- |
|
| 59 |
+ bluetoothStatusText.setText(R.string.bt_is_enabled); |
|
| 59 | 60 |
} |
| 60 | 61 |
|
| 61 | 62 |
@Override |
| 62 | 63 |
public void onBluetoothDisabled() {
|
| 63 |
- |
|
| 64 |
+ bluetoothStatusText.setText(R.string.bt_is_disabled); |
|
| 64 | 65 |
} |
| 65 | 66 |
|
| 66 | 67 |
@Override |
| 67 | 68 |
public void onPrinterOk() {
|
| 68 |
- |
|
| 69 |
+ printerStatusText.setText(R.string.printer_is_ok); |
|
| 69 | 70 |
} |
| 70 | 71 |
|
| 71 | 72 |
@Override |
| 72 | 73 |
public void onPrinterError(String error) {
|
| 73 |
- |
|
| 74 |
+ printerStatusText.setText(error); |
|
| 74 | 75 |
} |
| 75 | 76 |
|
| 76 | 77 |
@Override |
| 77 | 78 |
public void onPrinterConnected() {
|
| 78 |
- |
|
| 79 |
+ Toast.makeText(this,R.string.printer_is_connected,Toast.LENGTH_SHORT).show(); |
|
| 79 | 80 |
} |
| 80 | 81 |
|
| 81 | 82 |
@Override |
| 82 | 83 |
public void onPrinterDisconnected() {
|
| 83 |
- |
|
| 84 |
+ Toast.makeText(this,R.string.printer_is_disconnected,Toast.LENGTH_SHORT).show(); |
|
| 84 | 85 |
} |
| 85 | 86 |
|
| 86 | 87 |
@Override |
@@ -97,4 +98,9 @@ public class PrinterSettingActivity extends BaseActivity implements PrinterSetti |
||
| 97 | 98 |
public void onPairedDeviceDiscovered() {
|
| 98 | 99 |
|
| 99 | 100 |
} |
| 101 |
+ |
|
| 102 |
+ @OnClick(R.id.tv_print_test) |
|
| 103 |
+ void testPrint(){
|
|
| 104 |
+ presenter.printTestPage(); |
|
| 105 |
+ } |
|
| 100 | 106 |
} |
@@ -86,4 +86,12 @@ |
||
| 86 | 86 |
<string name="paired_devices">已配对设备</string> |
| 87 | 87 |
|
| 88 | 88 |
<string name="new_usable_devices">新可用设备</string> |
| 89 |
+ |
|
| 90 |
+ <string name="printer_is_ok">打印机工作正常</string> |
|
| 91 |
+ |
|
| 92 |
+ <string name="printer_offline">已脱机,请检查</string> |
|
| 93 |
+ |
|
| 94 |
+ <string name="printer_is_connected">已连接打印机</string> |
|
| 95 |
+ |
|
| 96 |
+ <string name="printer_is_disconnected">已断开打印机</string> |
|
| 89 | 97 |
</resources> |