/// <summary> /// Shows the menu from controller. /// </summary> /// <param name="viewController">View controller.</param> public void ShowMenuFromController(UIViewController viewController) { if (this.DoneAnimations) { return; } this.NavController = JVMenuHelper.TopViewController(); this.CurrentController = viewController; var currFrame = MenuView.Frame; var newFrame = this.View.Frame; UIView.AnimateNotify(0.15f, () => { if (this.NavController != this.CurrentController) { this.CurrentController.View.Transform = CGAffineTransform.Scale(CGAffineTransform.MakeIdentity(), 0.6f, 0.6f); } }, (bool finished) => { if (finished) { this.Image = JVMenuHelper.TakeScreenShotOfView(this.NavController.View, false); this.View.BackgroundColor = UIColor.FromPatternImage(this.Image); if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { if (!UIAccessibility.IsReduceTransparencyEnabled) { //VibrancyEffectView.ContentView.Add(MenuView); //VibrancyEffectView.ContentView.Add(CloseBtn); //BlurEffectView.ContentView.Add(VibrancyEffectView); this.View.InsertSubview(BlurEffectView, 0); } } this.DoneAnimations = true; this.CloseBtn.Alpha = 0.0f; this.MenuView.Alpha = 0.0f; this.NavController.PresentViewController(this, false, () => { UIView.Animate(0.15f, 0.0f, UIViewAnimationOptions.CurveEaseInOut, () => { this.CloseBtn.Alpha = 1.0f; this.MenuView.Alpha = 1.0f; this.MenuView.TableView.ReloadData(); }, null); }); } }); UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade); }
private void ControllerSetup() { // get main screen size this.ScreenSize = JVMenuHelper.GetScreenSize(); this.View.Frame = new CGRect(0, 0, this.ScreenSize.Width, this.ScreenSize.Height); this.View.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; this.View.BackgroundColor = UIColor.Clear; this.Add(MenuView); this.Add(CloseBtn); }
/// <summary> /// Setup this instance. /// </summary> private void Setup() { if (this.Frame.Size.Width == 0) { this.ScreenSize = JVMenuHelper.GetScreenSize(); this.Frame = new CGRect(0, 0, ScreenSize.Width, ScreenSize.Height); } this.BackgroundColor = UIColor.Black.ColorWithAlpha(0.5f); this.Add(TableView); }