public override void ViewDidLoad() { base.ViewDidLoad(); NavBackBtn.TouchUpInside += delegate { this.NavigationController.PopViewControllerAnimated(true); }; WebShowSocialNetworksBtn.TouchUpInside += delegate { WebNavCloseBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebTweetBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebPostBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebNavCloseBtn.Hidden = false; WebTweetBtn.Hidden = false; WebPostBtn.Hidden = false; UIView.AnimateNotify(0.4, 0, 0.65f, 0.0f, UIViewAnimationOptions.CurveEaseIn, delegate { WebTitle.Transform = CGAffineTransform.MakeScale(0f, 0f); WebShowSocialNetworksBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); NavBackBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebNavCloseBtn.Transform = CGAffineTransform.MakeScale(1f, 1f); WebTweetBtn.Transform = CGAffineTransform.MakeScale(1f, 1f); WebPostBtn.Transform = CGAffineTransform.MakeScale(1f, 1f); }, null); }; WebNavCloseBtn.TouchUpInside += delegate { UIView.AnimateNotify(0.4, 0, 0.65f, 0.0f, UIViewAnimationOptions.CurveEaseIn, delegate { WebNavCloseBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebTweetBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebPostBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebTitle.Transform = CGAffineTransform.MakeScale(1f, 1f); WebShowSocialNetworksBtn.Transform = CGAffineTransform.MakeScale(1f, 1f); NavBackBtn.Transform = CGAffineTransform.MakeScale(1f, 1f); }, null); }; WebTweetBtn.TouchUpInside += delegate { slComposer = SLComposeViewController.FromService(SLServiceType.Twitter); slComposer.AddUrl(new NSUrl(_url)); slComposer.CompletionHandler += (result) => { slComposer.DismissViewController(true, null); }; PresentViewController(slComposer, true, null); }; WebPostBtn.TouchUpInside += delegate { slComposer = SLComposeViewController.FromService(SLServiceType.Facebook); slComposer.AddUrl(new NSUrl(_url)); slComposer.CompletionHandler += (result) => { slComposer.DismissViewController(true, null); }; PresentViewController(slComposer, true, null); }; WebBackBtn.TouchUpInside += delegate { WebView.GoBack(); }; WebForwardBtn.TouchUpInside += delegate { WebView.GoForward(); }; WebToolBarRefreshBtn.TouchUpInside += delegate { if (WebTweetBtn.Hidden == false) { UIView.AnimateNotify(0.4, 0, 0.65f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate { WebNavCloseBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebTweetBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebPostBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebTitle.Transform = CGAffineTransform.MakeScale(1f, 1f); NavBackBtn.Transform = CGAffineTransform.MakeScale(1f, 1f); WebLoadingSpinner.Transform = CGAffineTransform.MakeScale(1f, 1f); WebLoadingSpinner.StartAnimating(); }, null); } else { UIView.AnimateNotify(0.4, 0, 0.65f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate { WebShowSocialNetworksBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebLoadingSpinner.Transform = CGAffineTransform.MakeScale(1f, 1f); WebLoadingSpinner.StartAnimating(); }, null); } WebView.Reload(); if (!isLoaded) { LoadWebUrl(_url); } }; WebView.LoadStarted += delegate { if (WebTweetBtn.Hidden == false) { UIView.AnimateNotify(0.4, 0, 0.65f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate { WebNavCloseBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebTweetBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebPostBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebTitle.Transform = CGAffineTransform.MakeScale(1f, 1f); NavBackBtn.Transform = CGAffineTransform.MakeScale(1f, 1f); WebLoadingSpinner.Transform = CGAffineTransform.MakeScale(1f, 1f); WebLoadingSpinner.StartAnimating(); }, null); } else { UIView.AnimateNotify(0.4, 0, 0.65f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate { WebShowSocialNetworksBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); WebLoadingSpinner.Transform = CGAffineTransform.MakeScale(1f, 1f); WebLoadingSpinner.StartAnimating(); }, null); } }; WebView.LoadFinished += delegate { WebShowSocialNetworksBtn.Hidden = false; WebShowSocialNetworksBtn.Transform = CGAffineTransform.MakeScale(0f, 0f); UIView.AnimateNotify(0.4, 0, 0.65f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate { WebShowSocialNetworksBtn.Transform = CGAffineTransform.MakeScale(1f, 1f); WebLoadingSpinner.Transform = CGAffineTransform.MakeScale(0f, 0f); }, delegate { WebLoadingSpinner.StopAnimating(); isLoaded = true; }); }; WebView.LoadError += delegate(object sender, UIWebErrorArgs e) { if (!e.Error.ToString().Contains("NSURLErrorDomain")) { WebLoadingSpinner.StopAnimating(); WebShowSocialNetworksBtn.Alpha = 1; UIAlertView alert = new UIAlertView("Error", "Problem connecting.\n" + "Please check your connection and try again.", null, "OK", null); alert.Show(); } }; }
public override void ViewDidLoad() { base.ViewDidLoad(); TweetButton.TouchUpInside += delegate { slComposer = SLComposeViewController.FromService(SLServiceType.Twitter); if (Screenshot.Image != null) { slComposer.AddImage(Screenshot.Image); } slComposer.CompletionHandler += (result) => { slComposer.DismissViewController(true, null); }; PresentViewController(slComposer, true, null); }; PostButton.TouchUpInside += delegate { slComposer = SLComposeViewController.FromService(SLServiceType.Facebook); if (Screenshot.Image != null) { slComposer.AddImage(Screenshot.Image); } slComposer.CompletionHandler += (result) => { slComposer.DismissViewController(true, null); }; PresentViewController(slComposer, true, null); }; #region Menu Buttons CloseButton.TouchUpInside += delegate { UIApplication.SharedApplication.SetStatusBarHidden(false, UIStatusBarAnimation.Fade); DismissViewController(true, null); }; PrevBtn.TouchUpInside += delegate { SwipeImage("Right"); }; NextBtn.TouchUpInside += delegate { SwipeImage("Left"); }; #endregion #region Gesture Recognizers UITapGestureRecognizer tapGesture = new UITapGestureRecognizer(); tapGesture.NumberOfTapsRequired = 1; tapGesture.AddTarget(this, new Selector("MenuDisplay")); Screenshot.AddGestureRecognizer(tapGesture); UISwipeGestureRecognizer swipeLeftGesture = new UISwipeGestureRecognizer(); swipeLeftGesture.AddTarget(this, new Selector("SwipeLeftGesture")); swipeLeftGesture.Direction = UISwipeGestureRecognizerDirection.Left; View.AddGestureRecognizer(swipeLeftGesture); UISwipeGestureRecognizer swipeRightGesture = new UISwipeGestureRecognizer(); swipeRightGesture.AddTarget(this, new Selector("SwipeRightGesture")); swipeRightGesture.Direction = UISwipeGestureRecognizerDirection.Right; View.AddGestureRecognizer(swipeRightGesture); UISwipeGestureRecognizer swipeDownGesture = new UISwipeGestureRecognizer(); swipeDownGesture.AddTarget(this, new Selector("SwipeDownGesture")); swipeDownGesture.Direction = UISwipeGestureRecognizerDirection.Down; View.AddGestureRecognizer(swipeDownGesture); #endregion }
public override void ViewDidLoad() { base.ViewDidLoad(); BackButton.TouchUpInside += delegate { this.NavigationController.PopViewControllerAnimated(true); }; DetailsShowSocialNetworkViewBtn.TouchUpInside += delegate { DetailsNavReminderBtn.Transform = Utilities.Hide; DetailsSocialNetworkCloseBtn.Transform = Utilities.Hide; TweetBtn.Transform = Utilities.Hide; PostBtn.Transform = Utilities.Hide; DetailsNavReminderBtn.Transform = Utilities.Hide; UIView.AnimateNotify(0.4, 0, 0.65f, 0.0f, UIViewAnimationOptions.CurveEaseIn, delegate { DetailsShowSocialNetworkViewBtn.Transform = Utilities.Hide; DetailsNavTitleLbl.Transform = Utilities.Hide; DetailsShowSocialNetworkViewBtn.Transform = Utilities.Hide; BackButton.Transform = Utilities.Hide; DetailsSocialNetworkCloseBtn.Hidden = false; TweetBtn.Hidden = false; PostBtn.Hidden = false; if (Convert.ToDateTime(_item.release_date) > DateTime.Now) { DetailsNavReminderBtn.Hidden = false; DetailsNavReminderBtn.Transform = Utilities.Show; } DetailsSocialNetworkCloseBtn.Transform = Utilities.Show; TweetBtn.Transform = Utilities.Show; PostBtn.Transform = Utilities.Show; }, null); }; DetailsSocialNetworkCloseBtn.TouchUpInside += delegate { UIView.AnimateNotify(0.4, 0, 0.65f, 0.0f, UIViewAnimationOptions.CurveEaseIn, delegate { DetailsShowSocialNetworkViewBtn.Transform = Utilities.Show; DetailsNavTitleLbl.Transform = Utilities.Show; DetailsShowSocialNetworkViewBtn.Transform = Utilities.Show; BackButton.Transform = Utilities.Show; if (Convert.ToDateTime(_item.release_date) > DateTime.Now) { DetailsNavReminderBtn.Transform = Utilities.Hide; } DetailsSocialNetworkCloseBtn.Transform = Utilities.Hide; TweetBtn.Transform = Utilities.Hide; PostBtn.Transform = Utilities.Hide; }, delegate { DetailsNavReminderBtn.Hidden = true; }); }; TweetBtn.TouchUpInside += delegate { slComposer = SLComposeViewController.FromService(SLServiceType.Twitter); if (!String.IsNullOrEmpty(game.hashtag)) { slComposer.SetInitialText("#" + game.hashtag); } slComposer.CompletionHandler += (result) => { slComposer.DismissViewController(true, null); }; PresentViewController(slComposer, true, null); }; PostBtn.TouchUpInside += delegate { slComposer = SLComposeViewController.FromService(SLServiceType.Facebook); if (!String.IsNullOrEmpty(game.title)) { slComposer.SetInitialText(game.title); } slComposer.CompletionHandler += (result) => { slComposer.DismissViewController(true, null); }; PresentViewController(slComposer, true, null); }; }