async void DisplaySearchResults() { try { Task <string> getSearchJson = Utilities.GetSearchJson("downloadable", DownloadsNavSearchBar.Text); var searchItems = JsonConvert.DeserializeObject <List <Game> >(await getSearchJson); parsedDownloadsJson = new Dictionary <string, List <Game> >(); parsedDownloadsJson.Add("Found " + searchItems.Count() + " Result(s)", searchItems); TableView.Source = new DownloadableTableSource(parsedDownloadsJson); TableView.Hidden = false; if (IsViewLoaded && View.Window != null && DownloadsNavSearchBar.Alpha.Equals(1)) { TableView.ReloadData(); UIView.AnimateNotify(0.4, 0, 0.65f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate { DownloadsNavCloseBtn.Transform = Utilities.Show; DownloadsNavSearchLoadingSpinner.Transform = Utilities.Hide; TableView.Alpha = 1; }, delegate { DownloadsNavSearchLoadingSpinner.StopAnimating(); }); } } catch { UIAlertView alert = new UIAlertView("Error", "Problem connecting.\n" + "Please check your connection and try again.", null, "OK", null); alert.Show(); DownloadsNavCloseBtn.Transform = Utilities.Show; DownloadsNavSearchLoadingSpinner.StopAnimating(); } }
public override void ViewDidDisappear(bool animated) { base.ViewDidDisappear(animated); DownloadsNavSearchBtn.Hidden = false; SetDownloadTypeButtonDisplay(); DownloadsNavOutNowBtn.Hidden = false; DownloadsNavUpcomingBtn.Hidden = false; TableView.Alpha = 1; DownloadsNavCloseBtn.Hidden = true; DownloadsNavSearchBar.Hidden = true; DownloadsNavSearchBtn.Transform = Utilities.Show; DownloadsNavSearchLoadingSpinner.StopAnimating(); }
void ReleaseDesignerOutlets() { if (LoadingErrorImg != null) { LoadingErrorImg.Dispose(); LoadingErrorImg = null; } if (DownloadsNavSearchLoadingSpinner != null) { DownloadsNavSearchLoadingSpinner.Dispose(); DownloadsNavSearchLoadingSpinner = null; } if (DownloadsNavSplitterLbl != null) { DownloadsNavSplitterLbl.Dispose(); DownloadsNavSplitterLbl = null; } if (DownloadsNavOutNowBtn != null) { DownloadsNavOutNowBtn.Dispose(); DownloadsNavOutNowBtn = null; } if (DownloadsNavUpcomingBtn != null) { DownloadsNavUpcomingBtn.Dispose(); DownloadsNavUpcomingBtn = null; } if (DownloadsNavSearchBar != null) { DownloadsNavSearchBar.Dispose(); DownloadsNavSearchBar = null; } if (DownloadsNavSearchBtn != null) { DownloadsNavSearchBtn.Dispose(); DownloadsNavSearchBtn = null; } if (DownloadsNavCloseBtn != null) { DownloadsNavCloseBtn.Dispose(); DownloadsNavCloseBtn = null; } if (DownloadablesOutNowBtn != null) { DownloadablesOutNowBtn.Dispose(); DownloadablesOutNowBtn = null; } if (DownloadablesUpcomingBtn != null) { DownloadablesUpcomingBtn.Dispose(); DownloadablesUpcomingBtn = null; } if (LoadingView != null) { LoadingView.Dispose(); LoadingView = null; } if (LoadingText != null) { LoadingText.Dispose(); LoadingText = null; } if (LoadingSpinner != null) { LoadingSpinner.Dispose(); LoadingSpinner = null; } if (DownloadableSgmntdBtn != null) { DownloadableSgmntdBtn.Dispose(); DownloadableSgmntdBtn = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); DownloadsNavSearchBtn.TouchUpInside += delegate { DownloadsNavCloseBtn.Transform = Utilities.Hide; DownloadsNavSearchBar.Transform = Utilities.Hide; DownloadsNavCloseBtn.Hidden = false; DownloadsNavSearchBar.Hidden = false; DownloadsNavSearchBar.BecomeFirstResponder(); UIView.AnimateNotify(0.4, 0, 0.65f, 0.0f, UIViewAnimationOptions.CurveEaseIn, delegate { DownloadsNavSearchBtn.Transform = Utilities.Hide; DownloadsNavOutNowBtn.Transform = Utilities.Hide; DownloadsNavUpcomingBtn.Transform = Utilities.Hide; TableView.Alpha = 0; DownloadsNavCloseBtn.Transform = Utilities.Show; DownloadsNavSearchBar.Transform = Utilities.Show; }, null); }; DownloadsNavSearchBar.SearchButtonClicked += delegate { DownloadsNavSearchBar.ResignFirstResponder(); DownloadsNavSearchLoadingSpinner.Transform = Utilities.Hide; UIView.AnimateNotify(0.4, 0, 0.65f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate { DownloadsNavSearchLoadingSpinner.StartAnimating(); DownloadsNavCloseBtn.Transform = Utilities.Hide; DownloadsNavSearchLoadingSpinner.Transform = Utilities.Show; }, null); DisplaySearchResults(); }; DownloadsNavCloseBtn.TouchUpInside += delegate { UIView.AnimateNotify(0.4, 0, 0.65f, 0.0f, UIViewAnimationOptions.CurveEaseIn, delegate { DownloadsNavSearchBtn.Transform = Utilities.Show; SetDownloadTypeButtonDisplay(); TableView.Alpha = 1; DownloadsNavCloseBtn.Transform = Utilities.Hide; DownloadsNavSearchBar.Transform = Utilities.Hide; DownloadsNavSearchBar.ResignFirstResponder(); }, delegate { DownloadsNavCloseBtn.Hidden = true; DownloadsNavSearchBar.Hidden = true; RefreshTable(); }); }; DownloadsNavOutNowBtn.TouchUpInside += delegate { selectedSegmentBtn = 0; TableView.Source = null; TableView.ReloadData(); GetJson(); UIView.AnimateNotify(0.2, 0, 0.65f, 0.0f, UIViewAnimationOptions.CurveEaseIn, delegate { SetDownloadTypeButtonDisplay(); }, null); }; DownloadsNavUpcomingBtn.TouchUpInside += delegate { selectedSegmentBtn = 1; TableView.Source = null; TableView.ReloadData(); GetJson(); UIView.AnimateNotify(0.2, 0, 0.65f, 0.0f, UIViewAnimationOptions.CurveEaseIn, delegate { SetDownloadTypeButtonDisplay(); }, null); }; RefreshControl = new UIRefreshControl(); RefreshControl.TintColor = UIColor.FromRGB(144, 199, 62); RefreshControl.ValueChanged += delegate { GetJson(true); }; foreach (var subView in DownloadsNavSearchBar.Subviews) { foreach (var subView2nd in subView.Subviews) { if (subView2nd.GetType() == typeof(UITextField)) { UITextField searchField = (UITextField)subView2nd; searchField.Font = UIFont.FromName("GillSans", 13); } } } }