public static void Scan(CameraScanLayer scanLayer) { var callback = scanLayer.Callback; var ctrl = new CameraScanController(scanLayer, callback, ScanLayer.BarcodeKey) { ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal }; var navCtrl = new PopoverNavigationController(ctrl); navCtrl.SetCloseButton(ctrl); if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { if (!TouchFactory.TheApp.Style.HeaderColor.IsDefaultColor) { navCtrl.NavigationBar.BarTintColor = scanLayer.LayerStyle.HeaderColor.ToUIColor(); } if (!TouchFactory.TheApp.Style.HeaderTextColor.IsDefaultColor) { navCtrl.NavigationBar.TintColor = scanLayer.LayerStyle.HeaderTextColor.ToUIColor(); navCtrl.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = scanLayer.LayerStyle.HeaderTextColor.ToUIColor() }; } } else { navCtrl.NavigationBar.TintColor = scanLayer.LayerStyle.HeaderColor.ToUIColor(); } ModalManager.EnqueueModalTransition(TouchFactory.Instance.TopViewController, navCtrl, true); }
public CameraScanController(CameraScanLayer layer, Link callback, string parametersKey) { _layer = layer; _callback = callback; _barcodeValueKey = parametersKey; DuplicateWait = layer.DuplicateTimeout; // Autorotate = TouchFactory.Instance.Platform == MobilePlatform.iPad; ModalPresentationStyle = UIModalPresentationStyle.FormSheet; string fontName = null; double fontSize = 12; if (_layer.LayerStyle != null && _layer.LayerStyle.DefaultLabelStyle != null) { fontName = _layer.LayerStyle.DefaultLabelStyle.FontFamily; fontSize = _layer.LayerStyle.DefaultLabelStyle.FontSize; } if (!string.IsNullOrEmpty(fontName)) { _layerFont = TouchStyle.ToFont(UIFont.FromName(fontName, LastValueScanOverlay.LabelFontSize)); } }
public CameraMetaDataDelegate(CameraScanController view, CameraScanLayer layer) { _view = view; _layer = layer; Buffer = new ScanBuffer(view.DuplicateWait); }