Beispiel #1
0
        public static void Scan(ScanLayer scanLayer)
        {
            ScanController controller    = new ScanController(scanLayer);
            var            navController = new PopoverNavigationController(controller)
            {
                ModalPresentationStyle = UIModalPresentationStyle.FormSheet
            };

            navController.SetCloseButton(controller);

            if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
            {
                if (!TouchFactory.TheApp.Style.HeaderColor.IsDefaultColor)
                {
                    navController.NavigationBar.BarTintColor = TouchFactory.TheApp.Style.HeaderColor.ToUIColor();
                }

                if (!TouchFactory.TheApp.Style.HeaderTextColor.IsDefaultColor)
                {
                    navController.NavigationBar.TintColor           = TouchFactory.TheApp.Style.HeaderTextColor.ToUIColor();
                    navController.NavigationBar.TitleTextAttributes = new UIStringAttributes()
                    {
                        ForegroundColor = TouchFactory.TheApp.Style.HeaderTextColor.ToUIColor()
                    };
                }
            }
            else
            {
                navController.NavigationBar.TintColor = TouchFactory.TheApp.Style.HeaderColor.ToUIColor();
            }

            ModalManager.EnqueueModalTransition(TouchFactory.Instance.TopViewController, navController, true);
        }
Beispiel #2
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);
        }