public override async Task OnCreateExtended(Bundle savedInstanceState) { SetContentView(Resource.Layout.Activity_Browse); var browseModel = new BrowseMediaDto(); try { browseModel = AniListJsonSerializer.Default.Deserialize <BrowseMediaDto>(Intent.GetStringExtra(BrowseDtoIntentKey)) ?? new BrowseMediaDto(); browseModel.Sort ??= new List <MediaSort>(); if (!browseModel.Sort.Any()) { browseModel.Sort.Add(MediaSort.PopularityDesc); } } catch { // ignored } await CreatePresenter(savedInstanceState); _cardType = Presenter.AniDroidSettings.CardType; Presenter.BrowseAniListMedia(browseModel); SetupToolbar(); }
public static void StartActivity(BaseAniDroidActivity context, BrowseMediaDto browseDto, int?requestCode = null) { var intent = new Intent(context, typeof(BrowseActivity)); var dtoString = AniListJsonSerializer.Default.Serialize(browseDto); intent.PutExtra(BrowseDtoIntentKey, dtoString); if (requestCode.HasValue) { context.StartActivityForResult(intent, requestCode.Value); } else { context.StartActivity(intent); } }
public override void OnViewCreated(View view, Bundle savedInstanceState) { var browseModel = new BrowseMediaDto() { Type = MediaType.Anime, Format = MediaFormat.Tv, Status = MediaStatus.Releasing, Season = MediaSeason.GetFromDate(DateTime.UtcNow), Country = MediaCountry.Japan, Year = DateTime.Now.Year, Sort = new List <MediaSort> { MediaSort.PopularityDesc } }; Presenter.BrowseAniListMedia(browseModel); }
public BrowseFilterDialogFragment(BaseAniDroidActivity context, IBrowsePresenter presenter) { _context = context; _presenter = presenter; _browseModel = presenter.GetBrowseDto(); }
public void BrowseAniListMedia(BrowseMediaDto browseDto) { _browseDto = browseDto; View.ShowMediaSearchResults(AniListService.BrowseMedia(browseDto, 20)); }
public IAsyncEnumerable <OneOf <IPagedData <Media>, IAniListError> > BrowseMedia(BrowseMediaDto browseDto, int perPage) { return(new PagedAsyncEnumerable <Media>(perPage, CreateGetPageFunc <Media>(QueryStore.BrowseMedia, browseDto), HasNextPage)); }