public static void Create(BaseAniDroidActivity context, IAniListMediaListEditPresenter presenter, Media media, AniList.Models.MediaModels.MediaList mediaList, UserMediaListOptions mediaListOptions, bool completeMedia = false) { var dialog = new EditMediaListItemDialogFragment(presenter, media, mediaList, mediaListOptions, completeMedia) { Cancelable = true }; var transaction = context.SupportFragmentManager.BeginTransaction(); transaction.SetTransition((int)FragmentTransit.FragmentOpen); transaction.Add(Android.Resource.Id.Content, dialog).AddToBackStack(EditMediaListItemDialogFragment.BackstackTag).Commit(); }
public EditMediaListItemDialogFragment(IAniListMediaListEditPresenter presenter, Media media, AniList.Models.MediaModels.MediaList mediaList, UserMediaListOptions mediaListOptions, bool completeMedia) { _presenter = presenter; _media = media; _mediaList = mediaList; _mediaListOptions = mediaListOptions; _isPrivate = mediaList?.Private ?? false; _priority = mediaList?.Priority ?? 0; _hideFromStatusLists = mediaList?.HiddenFromStatusLists ?? false; _completeMedia = completeMedia; _customLists = (mediaList?.CustomLists?.Where(x => x.Enabled).Select(x => x.Name).ToList() ?? new List <string>()).ToHashSet(); _customScoringEnabled = mediaListOptions.AnimeList?.AdvancedScoringEnabled ?? mediaListOptions.MangaList?.AdvancedScoringEnabled == true; _mediaStatusList = AniListEnum.GetEnumValues <MediaListStatus>().OrderBy(x => x.Index) .Select(x => x.DisplayValue).ToList(); }