更改提示文字

master
张萌 3 years ago
parent a1ea5114ac
commit 80ca78fd89

@ -47,13 +47,12 @@ public class DjScanerPlugin implements FlutterPlugin, MethodCallHandler {
} }
}; };
} }
; ;
private BroadcastReceiver scanReceiver; private BroadcastReceiver scanReceiver;
@Override @Override
public void onListen(Object arguments, EventChannel.EventSink events) { public void onListen(Object arguments, EventChannel.EventSink events) {
System.out.println("注册广播"); System.out.println("开始监听扫描");
scanReceiver = createScanReceiver(events); scanReceiver = createScanReceiver(events);
IntentFilter intentFilter = new IntentFilter(); IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(SCANACTION); intentFilter.addAction(SCANACTION);
@ -63,7 +62,7 @@ public class DjScanerPlugin implements FlutterPlugin, MethodCallHandler {
@Override @Override
public void onCancel(Object arguments) { public void onCancel(Object arguments) {
System.out.println("注销广播"); System.out.println("结束监听扫描");
context.unregisterReceiver(scanReceiver); context.unregisterReceiver(scanReceiver);
} }
}); });
@ -109,8 +108,7 @@ public class DjScanerPlugin implements FlutterPlugin, MethodCallHandler {
call.method.equals("scanEnabled") call.method.equals("scanEnabled")
) { ) {
boolean arg=(boolean) call.argument("onOpen"); boolean arg=(boolean) call.argument("onOpen");
System.out.println("扫描开关:"); System.out.println("扫描开关:"+(arg?"开启":"关闭"));
System.out.println(arg);
Intent intent = new Intent("com.android.scanner.ENABLED"); Intent intent = new Intent("com.android.scanner.ENABLED");
intent.putExtra("enabled",arg); intent.putExtra("enabled",arg);
context.sendBroadcast(intent); context.sendBroadcast(intent);

@ -29,7 +29,6 @@ class DjScaner {
} }
static Future init() async { static Future init() async {
print('初始化');
/// ///
await soundPlay(false); await soundPlay(false);
@ -45,7 +44,7 @@ class DjScaner {
/// ///
await scanEnabled(false); await scanEnabled(false);
print('初始化完成'); print('扫描初始化完成');
} }
/// ///

Loading…
Cancel
Save