| | |
| | | using System; |
| | | using System.IO; |
| | | using Android.Content; |
| | | using Shared; |
| | | using ZXing.Mobile; |
| | | |
| | |
| | | public Scan() |
| | | { |
| | | } |
| | | |
| | | public static string TipMsg = string.Empty; |
| | | |
| | | static MobileBarcodeScanner scanner; |
| | | public static void OpenScan(Action<string> action) |
| | | { |
| | |
| | | else |
| | | { |
| | | action?.Invoke(null); |
| | | Action action1 = () => { |
| | | Intent intent = new Intent(Android.Provider.Settings.ActionApplicationDetailsSettings); |
| | | intent.AddFlags(ActivityFlags.NewTask); |
| | | Android.Net.Uri uri = Android.Net.Uri.FromParts("package", Application.Activity.PackageName, null); |
| | | intent.SetData(uri); |
| | | Application.Activity.StartActivity(intent); |
| | | }; |
| | | if (string.IsNullOrEmpty(TipMsg)) |
| | | { |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | new HDL_ON.UI.PublicAssmebly().TipOptionMsg(StringId.Tip, "相机访问权限已被拒绝,请前往系统设置打开相关权限。", action1); |
| | | } |
| | | else |
| | | { |
| | | new HDL_ON.UI.PublicAssmebly().TipOptionMsg(StringId.Tip, "Camera access has been denied. Please go to system settings to open relevant permissions.", action1); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | new HDL_ON.UI.PublicAssmebly().TipOptionMsg(StringId.Tip, TipMsg,action1,45); |
| | | TipMsg = string.Empty; |
| | | } |
| | | } |
| | | }); |
| | | } |