d7eacbc8d39cR173">173
+ view.showToast(context.getString(R.string.printer_port_open_fail));
|
174
|
174
|
}
|
175
|
175
|
}
|
176
|
176
|
|
|
|
@@ -226,15 +226,15 @@ public class PrinterSettingPresenter implements PrinterSettingContract.Presenter
|
226
|
226
|
if (GpCom.ACTION_CONNECT_STATUS.equals(intent.getAction())) {
|
227
|
227
|
int type = intent.getIntExtra(GpPrintService.CONNECT_STATUS, 0);
|
228
|
228
|
int id = intent.getIntExtra(GpPrintService.PRINTER_ID, 0);
|
229
|
|
- Log.d("czy", "connect status " + type);
|
|
229
|
+ Log.d("czy111", "connect status " + type);
|
230
|
230
|
if (type == GpDevice.STATE_CONNECTING) {
|
231
|
|
-
|
|
231
|
+ view.onPrinterStatusFetched(context.getString(R.string.connecting));
|
232
|
232
|
} else if (type == GpDevice.STATE_NONE) {
|
233
|
233
|
|
234
|
234
|
} else if (type == GpDevice.STATE_VALID_PRINTER) {
|
235
|
|
-
|
|
235
|
+ view.onPrinterStatusFetched(context.getString(R.string.printer_is_connected));
|
236
|
236
|
} else if (type == GpDevice.STATE_INVALID_PRINTER) {
|
237
|
|
-
|
|
237
|
+ view.onPrinterStatusFetched(context.getString(R.string.printer_is_disconnected));
|
238
|
238
|
}
|
239
|
239
|
}
|
240
|
240
|
}
|
|
|
@@ -20,6 +20,7 @@ import java.util.ArrayList;
|
20
|
20
|
import java.util.Vector;
|
21
|
21
|
|
22
|
22
|
import ai.pai.lensman.App;
|
|
23
|
+import ai.pai.lensman.R;
|
23
|
24
|
import ai.pai.lensman.bean.PhotoBean;
|
24
|
25
|
import ai.pai.lensman.bean.SessionBean;
|
25
|
26
|
import ai.pai.lensman.db.DBService;
|
|
|
@@ -141,8 +142,8 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
|
141
|
142
|
if (r != GpCom.ERROR_CODE.SUCCESS) {
|
142
|
143
|
sessionView.showToast( GpCom.getErrorText(r));
|
143
|
144
|
}
|
144
|
|
- } catch (RemoteException e) {
|
145
|
|
- e.printStackTrace();
|
|
145
|
+ } catch (Exception e) {
|
|
146
|
+ sessionView.showToast(App.getAppContext().getString(R.string.go_check_printer));
|
146
|
147
|
}
|
147
|
148
|
}
|
148
|
149
|
|
|
|
@@ -93,7 +93,7 @@
|
93
|
93
|
android:id="@+id/tv_printer_status"
|
94
|
94
|
android:layout_width="wrap_content"
|
95
|
95
|
android:layout_height="wrap_content"
|
96
|
|
- android:text="@string/query_processing"
|
|
96
|
+ android:text="@string/click_to_query"
|
97
|
97
|
android:textColor="@color/dark_grey"
|
98
|
98
|
android:textSize="16sp" />
|
99
|
99
|
</LinearLayout>
|
|
|
@@ -100,4 +100,14 @@
|
100
|
100
|
<string name="click_to_connect">点击连接</string>
|
101
|
101
|
|
102
|
102
|
<string name="connecting">尝试连接中</string>
|
|
103
|
+
|
|
104
|
+ <string name="click_to_query">点击查询打印机状态</string>
|
|
105
|
+
|
|
106
|
+ <string name="go_check_printer">请检查打印机</string>
|
|
107
|
+
|
|
108
|
+ <string name="printer_port_open_fail">打印机端口打开失败</string>
|
|
109
|
+
|
|
110
|
+ <string name="printer_status_query_fail">打印机状态查询失败</string>
|
|
111
|
+
|
|
112
|
+ <string name="printer_service_boot_fail">打印机服务连接失败,请退出应用重试</string>
|
103
|
113
|
</resources>
|