protected override UIVisualEffectView CreateNativeControl()
        {
            var blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light);

            return(new UIVisualEffectView(blurEffect)
            {
                UserInteractionEnabled = false
            });
        }
Exemple #2
0
        private void ConfigureBlurViews(UIView mainView)
        {
            var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular);

            topBlurView = new UIVisualEffectView(blur);
            mainView.AddSubview(topBlurView);
            bottomBlurView = new UIVisualEffectView(blur);
            mainView.AddSubview(bottomBlurView);
        }
        public void Show()
        {
            var            controller = GetUIController();
            UIVisualEffect blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular);

            visualEffectView       = new UIVisualEffectView(blurEffect);
            visualEffectView.Frame = controller.View.Bounds;
            controller.View.AddSubview(visualEffectView);
        }
        UIVisualEffectView GetBlurView()
        {
            UIVisualEffect     blurEffect       = UIBlurEffect.FromStyle(UIBlurEffectStyle.Prominent);
            var                window           = UIApplication.SharedApplication.KeyWindow;
            UIVisualEffectView visualEffectView = new UIVisualEffectView(blurEffect);

            visualEffectView.Frame = window.RootViewController.View.Bounds;
            return(visualEffectView);
        }
        public void UpdateStyle(UIBlurEffectStyle style)
        {
            blurView?.RemoveFromSuperview();
            var blur = UIBlurEffect.FromStyle(style);

            blurView = new UIVisualEffectView(blur);

            Add(blurView);
        }
 public void ApplyTheme(Theme theme)
 {
     if (useBlur && IsViewLoaded)
     {
         blurEffect = UIBlurEffect.FromStyle(theme.IsDark ? UIBlurEffectStyle.Dark : UIBlurEffectStyle.Light);
         TableView.BackgroundView  = new UIVisualEffectView(effect: blurEffect);
         TableView.SeparatorEffect = UIVibrancyEffect.FromBlurEffect(blurEffect);
     }
 }
Exemple #7
0
 public DrawerControlRenderer()
 {
     blur                                 = UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular);
     visualEffectView                     = new UIVisualEffectView(blur);
     visualEffectView.TintColor           = UIColor.White;
     visualEffectView.Layer.MasksToBounds = true;
     visualEffectView.Layer.CornerRadius  = 10;
     InsertSubview(visualEffectView, 0);
 }
        private void UpdateMaterialBlurStyle()
        {
            InternalLogger.Debug(Tag, () => "UpdateMaterialBlurStyle()");

            if (_blurView != null)
            {
                _blurView.Effect = UIBlurEffect.FromStyle(ConvertBlurStyle());
            }
        }
        public void SetAppearance(UINavigationController controller, ShellAppearance appearance)
        {
            var background = appearance.BackgroundColor;
            var foreground = appearance.ForegroundColor;
            var titleColor = appearance.TitleColor;

            var navBar = controller.NavigationBar;

            if (_blurView == null)
            {
                _defaultBackgroundImage = navBar.GetBackgroundImage(UIBarMetrics.Default);
                _defaultTint            = navBar.TintColor;
                _defaultTitleAttributes = navBar.TitleTextAttributes;

                var frame = navBar.Frame;
                frame.Height += frame.Y;
                frame.Y       = -frame.Y;

                var effect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular);
                _blurView = new UIVisualEffectView(effect);
                _blurView.UserInteractionEnabled = false;
                _blurView.Frame = frame;

                _colorView = new UIView(frame);
                _colorView.UserInteractionEnabled = false;

                if (Forms.IsiOS11OrNewer)
                {
                    _blurView.Layer.ShadowColor   = UIColor.Black.CGColor;
                    _blurView.Layer.ShadowOpacity = 1f;
                    _blurView.Layer.ShadowRadius  = 3;
                }
            }

            navBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);

            navBar.InsertSubview(_colorView, 0);
            navBar.InsertSubview(_blurView, 0);

            if (!background.IsDefault)
            {
                _colorView.BackgroundColor = background.ToUIColor();
            }

            if (!foreground.IsDefault)
            {
                navBar.TintColor = foreground.ToUIColor();
            }
            if (!titleColor.IsDefault)
            {
                navBar.TitleTextAttributes = new UIStringAttributes
                {
                    ForegroundColor = titleColor.ToUIColor()
                };
            }
        }
Exemple #10
0
        void AddBlurOverlay()
        {
            using var blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light);
            _blurWindow          = new UIVisualEffectView(blurEffect)
            {
                Frame = UIApplication.SharedApplication.KeyWindow.RootViewController.View.Bounds
            };

            UIApplication.SharedApplication.KeyWindow.RootViewController.View.AddSubview(_blurWindow);
        }
        public override void ViewDidLayoutSubviews()
        {
            base.ViewDidLayoutSubviews();
            var blurView = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular))
            {
                Frame = _blurView.Frame
            };

            _blurView.Add(blurView);
        }
Exemple #12
0
        private UIVisualEffectView CreateBlurEffectView(UIViewController controller)
        {
            var blurEffect     = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light);
            var blurEffectView = new UIVisualEffectView(blurEffect);

            blurEffectView.Frame            = controller.View.Bounds;
            blurEffectView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

            return(blurEffectView);
        }
        partial void InitializeUI()
        {
            AutoCancelButton = false;
            AutoDoneButton   = true;

            if (useBlur)
            {
                blurEffect = UIBlurEffect.FromStyle(Theme.Current.IsDark ? UIBlurEffectStyle.Dark : UIBlurEffectStyle.Light);
            }
        }
        public static UIVisualEffectView Create(CGRect frame, UIBlurEffectStyle style)
        {
            var blurEffect = UIBlurEffect.FromStyle(style);
            var blurView   = new UIVisualEffectView(blurEffect)
            {
                Frame = frame
            };

            return(blurView);
        }
Exemple #15
0
        private UIVisualEffectView SetupLayer()
        {
            UIVisualEffect blurEffect = UIBlurEffect.FromStyle(ChooseBlurAmount(this.Element.BlurAmount));

            _visualEffectView = new UIVisualEffectView(blurEffect)
            {
                Frame = this.Frame
            };
            return(_visualEffectView);
        }
Exemple #16
0
        public LyricModal(string lyrics, UIImage img, SongModel song)
        {
            UIImageView BG = new UIImageView(View.Frame);

            BG.Image = img;
            BG.Frame = new CGRect(x: 0, y: 0, width: Variables.ScreenWidth, height: Variables.ScreenHeight);

            // Add the Image View to the parent view
            View.AddSubview(BG);
            var   blur     = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark);
            float x        = 0;
            float y        = 0;
            float width    = (float)Variables.ScreenWidth;
            float height   = (float)Variables.ScreenHeight;
            var   blurView = new UIVisualEffectView(blur);

            blurView.Frame = new CGRect(x, y, width, height);

            View.Add(blurView);
            ModalPresentationStyle = UIModalPresentationStyle.FullScreen;

            UIImageView SongImageView = new UIImageView(View.Frame);

            SongImageView.Image = img;
            SongImageView.Frame = new CGRect(x: Variables.ScreenHeight * .15, y: Variables.ScreenHeight * .15, width: Variables.ScreenHeight * .55, height: Variables.ScreenHeight * .55);
            // Add the Image View to the parent view
            View.AddSubview(SongImageView);

            UILabel SongTitleLabel = new UILabel();

            SongTitleLabel.Text          = song.SongTitle;
            SongTitleLabel.Font          = UIFont.SystemFontOfSize(36, UIFontWeight.Bold);
            SongTitleLabel.TextAlignment = UITextAlignment.Center;
            SongTitleLabel.TextColor     = UIColor.White;
            SongTitleLabel.Frame         = new CGRect(x: Variables.ScreenHeight * .15, y: Variables.ScreenHeight * .75 - 50, width: Variables.ScreenHeight * .55, height: 100);
            View.AddSubview(SongTitleLabel);

            UILabel SongArtistLabel = new UILabel();

            SongArtistLabel.Text          = song.ArtistName;
            SongArtistLabel.Font          = UIFont.SystemFontOfSize(36);
            SongArtistLabel.TextAlignment = UITextAlignment.Center;
            SongArtistLabel.TextColor     = UIColor.White;
            SongArtistLabel.Frame         = new CGRect(x: Variables.ScreenHeight * .15, y: Variables.ScreenHeight * .81 - 50, width: Variables.ScreenHeight * .55, height: 100);
            View.AddSubview(SongArtistLabel);

            UITextView LyricsView = new UITextView(new RectangleF((float)Variables.ScreenWidth * .4625f, (float)Variables.ScreenHeight * .12f, (float)Variables.ScreenWidth * .5f, (float)Variables.ScreenHeight - (float)Variables.ScreenHeight * .15f));

            LyricsView.UserInteractionEnabled = true;
            LyricsView.ScrollEnabled          = true;
            LyricsView.Text      = lyrics;
            LyricsView.TextColor = UIColor.White;
            LyricsView.SetContentOffset(new CGPoint(0, 400), true);
            View.AddSubview(LyricsView);
        }
        public static UIVisualEffectView Vibrant(CGRect frame, UIBlurEffectStyle style)
        {
            var blurEffect     = UIBlurEffect.FromStyle(style);
            var vibrancyEffect = UIVibrancyEffect.FromBlurEffect(blurEffect);
            var vibrancyView   = new UIVisualEffectView(vibrancyEffect)
            {
                Frame = frame
            };

            return(vibrancyView);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            DismissKeyboardOnBackgroundTap();

            var bounds           = this.NavigationController.NavigationBar.Bounds;
            var blur             = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light);
            var visualEffectView = new UIVisualEffectView(blur);

            visualEffectView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
            this.NavigationController.NavigationBar.AddSubview(visualEffectView);
            this.NavigationController.NavigationBar.Translucent = true;


            var refreshControl = new UIRefreshControl();

            refreshControl.ValueChanged += delegate
            {
                viewModel.FetchBeersCommand();
            };
            tableView.AddSubview(refreshControl);

            viewModel.Beers.CollectionChanged += (object sender, NotifyCollectionChangedEventArgs e) =>
            {
                dataSource = new MyBeersDataSource(viewModel.Beers);
                dataSource.DidSelectBeer += (beer) =>
                {
                    var navctlr = Storyboard.InstantiateViewController("beerDescriptionView") as BeerDescriptionTableView;
                    if (navctlr == null)
                    {
                        return;
                    }

                    var rowPath  = tableView.IndexPathForSelectedRow;
                    var beerItem = viewModel.Beers[rowPath.Row].CheckIns.FirstOrDefault().Beer;
                    navctlr.SetBeer(beerItem);

                    var beerInfo = viewModel.Beers[rowPath.Row];
                    navctlr.SetBeerInfo(beerInfo);

                    NavigationController.PushViewController(navctlr, true);
                };
                tableView.Source = dataSource;
                tableView.ReloadData();
                refreshControl.EndRefreshing();

                if (viewModel.Beers.Count > 0)
                {
                    View.BringSubviewToFront(tableView);
                }
            };

            viewModel.FetchBeersCommand();
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Image> e)
        {
            base.OnElementChanged(e);

            if (Control != null)
            {
                var blurOverlay = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.Light));
                blurOverlay.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
                Control.AddSubview(blurOverlay);
            }
        }
Exemple #20
0
        private void SetCustomTranslucentNavigationBarStyle()
        {
            if (NavigationBar != null)
            {
                var blurEffect = UIBlurEffectStyle.Light;
                _blurView = new UIVisualEffectView(UIBlurEffect.FromStyle(blurEffect));

                NavigationBar.AddSubview(_blurView);
                NavigationBar.SendSubviewToBack(_blurView);
                FullyConstraintTopLayouts(_blurView, NavigationBar);
            }
        }
 /// <inheritdoc />
 public override void ViewDidAppear(bool animated)
 {
     if (_childDialog.AnimationConfig.ShowAnimationType == DialogAnimationType.CustomBlurFade &&
         _childDialog.BackgroundConfig.BlurEnabled)
     {
         UIView.Animate(_childDialog.AnimationConfig.ShowCustomAnimationDurationSeconds, () =>
         {
             _childDialog.View.Alpha = 1f;
             EffectView.Effect       = UIBlurEffect.FromStyle(_childDialog.BackgroundConfig.BlurStyle);
         });
     }
 }
 private void Dialog_DialogWillHide(object sender, EventArgs e)
 {
     if (_childDialog.AnimationConfig.HideAnimationType == DialogAnimationType.CustomBlurFade)
     {
         EffectView.Effect = UIBlurEffect.FromStyle(_childDialog.BackgroundConfig.BlurStyle);
         UIView.Animate(_childDialog.AnimationConfig.ShowCustomAnimationDurationSeconds, () =>
         {
             _childDialog.View.Alpha = 0f;
             EffectView.Effect       = null;
         });
     }
 }
        private void SetCustomTranslucentNavigationBarStyle()
        {
            if (NavigationController != null && NavigationController.NavigationBar != null)
            {
                var blurEffect = UIBlurEffectStyle.Light;
                var blurView   = new UIVisualEffectView(UIBlurEffect.FromStyle(blurEffect));

                var navigationBar = NavigationController.NavigationBar;
                navigationBar.AddSubview(blurView);
                navigationBar.SendSubviewToBack(blurView);
                FullyConstraintTopLayouts(blurView, navigationBar);
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (!UIAccessibility.IsReduceTransparencyEnabled)
            {
                TableView.BackgroundColor = UIColor.Clear;

                var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark);

                TableView.BackgroundView = new UIVisualEffectView(blur);
            }
        }
Exemple #25
0
 public override void OnResignActivation(UIApplication uiApplication)
 {
     base.OnResignActivation(uiApplication);
     if (isCreditCardInputShowing)
     {
         using var blurEffect = UIBlurEffect.FromStyle(ThemeEngine.IsEffectivelyLight ? UIBlurEffectStyle.ExtraLight : UIBlurEffectStyle.Dark);
         blurWindow           = new UIVisualEffectView(blurEffect)
         {
             Frame = UIApplication.SharedApplication.KeyWindow.RootViewController.View.Bounds
         };
         UIApplication.SharedApplication.KeyWindow.RootViewController.View.AddSubview(blurWindow);
     }
 }
Exemple #26
0
        public override void OnResignActivation(UIApplication application)
        {
            var blurEffect     = UIBlurEffect.FromStyle(UIBlurEffectStyle.ExtraDark);
            var blurEffectView = new UIVisualEffectView(blurEffect)
            {
                Frame            = application.KeyWindow.Subviews.First().Bounds,
                AutoresizingMask = UIViewAutoresizing.FlexibleDimensions,
                Tag = 12
            };

            application.KeyWindow.Subviews.Last().AddSubview(blurEffectView);
            base.OnResignActivation(application);
        }
        private void SetupBackground()
        {
            RootView.BackgroundColor = _childDialog.BackgroundConfig.Color;

            if (_childDialog.BackgroundConfig.BlurEnabled)
            {
                EffectView.Effect = UIBlurEffect.FromStyle(_childDialog.BackgroundConfig.BlurStyle);
            }
            else
            {
                EffectView.Effect = null;
            }
        }
Exemple #28
0
        private void PrepareBackgroundView()
        {
            var blurEffect   = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark);
            var visualEffect = new UIVisualEffectView(blurEffect);
            var bluredView   = new UIVisualEffectView(blurEffect);

            bluredView.ContentView.AddSubview(visualEffect);

            visualEffect.Frame = UIScreen.MainScreen.Bounds;
            bluredView.Frame   = UIScreen.MainScreen.Bounds;

            View.InsertSubview(bluredView, 0);
        }
Exemple #29
0
 public void BlurBackground()
 {
     InvokeOnMainThread(() =>
     {
         var blurEffect     = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light);
         var blurEffectView = new UIVisualEffectView(blurEffect)
         {
             Frame            = Controller.View.Bounds,
             AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight,
             Tag = BlurEffectViewTag
         };
         Controller.View.AddSubview(blurEffectView);
     });
 }
 public void WillDisplayHeaderView(UITableView tableView, UIView headerView, nint section)
 {
     if (!(headerView.Subviews[0] is UIVisualEffectView))
     {
         headerView.TintColor = new UIColor(0.95f, 0.95f, 0.95f, 0.9f);
         var blurEffect     = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light);
         var blurEffectView = new UIVisualEffectView(blurEffect);
         //always fill the view
         blurEffectView.Frame            = headerView.Bounds;
         blurEffectView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
         headerView.AddSubview(blurEffectView);
         headerView.InsertSubview(blurEffectView, 0);
     }
 }