Esempio n. 1
0
 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();
     }
 }
Esempio n. 2
0
 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();
 }