From dfd3bdc07c49fab66b38382e0bbe7c91bdf4f15b Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 28 四月 2020 15:03:43 +0800
Subject: [PATCH] 合并新代码,提供逻辑需要的门锁接口
---
ZigbeeApp/Home.Ios/AppDelegate.cs | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/ZigbeeApp/Home.Ios/AppDelegate.cs b/ZigbeeApp/Home.Ios/AppDelegate.cs
old mode 100755
new mode 100644
index d9396e2..fc43236
--- a/ZigbeeApp/Home.Ios/AppDelegate.cs
+++ b/ZigbeeApp/Home.Ios/AppDelegate.cs
@@ -27,6 +27,7 @@
{
//base.FinishedLaunching(application, launchOptions);
Shared.Application.FontSize = 12;
+ Shared.Application.IsUsePingFang = true;
Window = new UIWindow(UIScreen.MainScreen.Bounds);
rootViewController = new UINavigationController(new GateWay.Ios.MainViewController()) { NavigationBarHidden = true };
Window.RootViewController = rootViewController;
@@ -273,11 +274,27 @@
public static class QRCode
{
static ZXing.Mobile.MobileBarcodeScanner scanner;
- public static async System.Threading.Tasks.Task ScanQRcode(Action<string> action, string topText = "", string bottomText = "", string cancel = "Cancel")
+ public static async System.Threading.Tasks.Task ScanQRcode(Action<string> action, string cancel = "鍙栨秷", string flashText = "闂厜鐏�", string titleText = "浜岀淮鐮佹壂鎻�")
{
if (scanner == null)
{
- scanner = new ZXing.Mobile.MobileBarcodeScanner(Home.IOS.AppDelegate.rootViewController) { FlashButtonText = "", TopText = topText, BottomText = bottomText, CancelButtonText = cancel };
+ var mZXingOverlayView = new Home.IOS.ZXingOverlayView(cancel, flashText, titleText);
+ scanner = new ZXing.Mobile.MobileBarcodeScanner(Home.IOS.AppDelegate.rootViewController) { FlashButtonText = flashText, TopText = titleText, BottomText = "", CancelButtonText = cancel };
+ scanner.UseCustomOverlay = true;
+
+ scanner.CustomOverlay = mZXingOverlayView;
+ var bOn = false;
+ mZXingOverlayView.OnCancel += () => {
+
+ scanner?.Cancel();
+ };
+
+ mZXingOverlayView.OnTorch += () =>
+ {
+ bOn = !bOn;
+ scanner?.Torch(bOn);
+ };
+
}
var result = await scanner.Scan();
--
Gitblit v1.8.0