Beispiel #1
0
        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);
        }
Beispiel #2
0
            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));
                }
            }
Beispiel #3
0
 public CameraMetaDataDelegate(CameraScanController view, CameraScanLayer layer)
 {
     _view  = view;
     _layer = layer;
     Buffer = new ScanBuffer(view.DuplicateWait);
 }