public void LoadMoreImages(bool setHeight = true) { if (!Settings.Top100Enabled) { return; } Device.BeginInvokeOnMainThread(() => { int count = 10;//PosterAtScreenHight * PosterAtScreenWith * 3 for (int i = 0; i < count; i++) { if (currentImageCount >= iMDbTopList.Count) { if (!Fething && !IsRecommended) { GetFetch(currentImageCount + 1); } return; //Feth more data } else { try { IMDbTopList x = iMDbTopList[currentImageCount]; bool add = true; int selGen = MovieTypePicker.SelectedIndex - 1; if (selGen != -1 && IsRecommended) { if (!iMDbTopList[currentImageCount].contansGenres.Contains(selGen)) { add = false; } } if (add) { string img = ConvertIMDbImagesToHD(iMDbTopList[currentImageCount].img, IsRecommended ? 76 : 180, IsRecommended ? 113 : 268); AddEpisode(new EpisodeResult() { ForceDescript = true, Description = x.descript, Title = (x.place > 0 ? (x.place + ". ") : "") + x.name + " | ★ " + x.rating.Replace(",", "."), Id = x.place, PosterUrl = img, extraInfo = "Id=" + x.id + "|||Name=" + x.name + "|||" }, false); } } catch (Exception) { } // ItemGrid.Children.Add(cachedImages[currentImageCount]); //SetChashedImagePos(ItemGrid.Children.Count - 1); } currentImageCount++; } if (setHeight) { SetHeight(); } }); }
//static readonly ImageSource empty = App.GetImageSource("emtyPoster.png"); public void LoadMoreImages(bool setHeight = true) { if (!Settings.Top100Enabled) { return; } Device.BeginInvokeOnMainThread(() => { if (currentImageCount == 0) { episodeView.Opacity = 0; } int count = 10; //PosterAtScreenHight * PosterAtScreenWith * 3 for (int i = 0; i < count; i++) { if (currentImageCount >= iMDbTopList.Count) { if (!Fething && !IsRecommended) { GetFetch(currentImageCount + 1); } return; //Feth more data } else { try { IMDbTopList x = iMDbTopList[currentImageCount]; bool add = true; int selGen = MovieTypePicker.SelectedIndex - 1; if (selGen != -1 && IsRecommended) { if (!iMDbTopList[currentImageCount].contansGenres.Contains(selGen)) { add = false; } } if (add) { string img = ConvertIMDbImagesToHD(iMDbTopList[currentImageCount].img, IsRecommended ? 76 : 180, IsRecommended ? 113 : 268); AddEpisode(new EpisodeResult() { TapComThree = new Command(() => { PushPageFromUrlAndName(x.id, x.name); }), ForceDescript = true, Description = x.descript, Title = (x.place > 0 ? (x.place + ". ") : "") + x.name + (x.year.IsClean() ? $" ({x.year})" : "") + " ★ " + x.rating.Replace(",", "."), Id = x.place, PosterUrl = img, ExtraInfo = "Id=" + x.id + "|||Name=" + x.name + "|||" }, false); } } catch (Exception) { } } currentImageCount++; } if (setHeight) { SetHeight(); } episodeView.FadeTo(1); }); }