private void OnUpperFlyoutStatusChanged(AnimeStatus animeStatus) { if (_upperFilterMenu == null) { return; } ViewModelLocator.AnimeList.CurrentStatus = (int)animeStatus; ViewModelLocator.AnimeList.RefreshList(); _upperFilterMenu.Dismiss(true); _upperFilterMenu = null; }
private void OnMangaMore(View view) { _moreMenu = FlyoutMenuBuilder.BuildGenericFlyout(this, view, Enum.GetValues(typeof(AnimeStatus)).Cast <AnimeStatus>().Select(type => Utilities.StatusToString((int)type, true)).ToList(), i => { ViewModel.Navigate(PageIndex.PageTopAnime, new AnimeListPageNavigationArgs(i, AnimeListWorkModes.Manga)); _moreMenu.Dismiss(true); _drawer.CloseDrawer(); }); _moreMenu.Show(); }
private void OnSupportMenuSelection(int i) { switch (i) { case 0: ResourceLocator.SystemControlsLauncherService.LaunchUri( new Uri("https://github.com/Drutol/MALClient/issues")); break; case 1: AndroidViewModelLocator.Settings.ReviewCommand.Execute(null); break; case 2: ViewModelLocator.GeneralMain.Navigate(PageIndex.PageSettings, SettingsPageIndex.About); SetActiveButton(HamburgerButtons.Settings); _drawer.CloseDrawer(); break; case 3: ResourceLocator.SystemControlsLauncherService.LaunchUri(new Uri("https://www.paypal.me/drutol")); break; case 4: ViewModelLocator.GeneralMain.Navigate(PageIndex.PageSettings, SettingsPageIndex.Ads); SetActiveButton(HamburgerButtons.Settings); _drawer.CloseDrawer(); break; } _supportMenu.Dismiss(true); }
private void MenuOnMenuItemClick(AnimeGridItemMoreFlyoutButtons btn) { switch (btn) { case AnimeGridItemMoreFlyoutButtons.CopyLink: ViewModel.CopyLinkToClipboardCommand.Execute(null); break; case AnimeGridItemMoreFlyoutButtons.OpenInBrowser: ViewModel.OpenInMALCommand.Execute(null); break; case AnimeGridItemMoreFlyoutButtons.SetStatus: ShowStatusDialog(); break; case AnimeGridItemMoreFlyoutButtons.SetRating: ShowRatingDialog(); break; case AnimeGridItemMoreFlyoutButtons.SetWatched: ShowWatchedDialog(); break; case AnimeGridItemMoreFlyoutButtons.CopyTitle: ViewModel.CopyTitleToClipboardCommand.Execute(null); break; default: throw new ArgumentOutOfRangeException(nameof(btn), btn, null); } _menu.Dismiss(true); }
private void OnFilterMenuSelectionChanged(AnimeStatus status) { ViewModel.CurrentStatus = (int)status; ViewModel.RefreshList(); _filterMenu.Dismiss(true); _filterMenu = null; }
private void OnSortingMenuSelectionChanged(SortOptions option) { ViewModel.SetSortOrder(option); ViewModel.RefreshList(); _sortingMenu.Dismiss(true); _sortingMenu = null; }
private void OnMenuSelected(int i) { if (_menuContext == null) { return; } switch (i) { case 0: _menuContext.SaveCommand.Execute(null); break; case 1: _menuContext.CopyAndWaifuCommand.Execute(null); break; case 2: _menuContext.OpenRedditCommand.Execute(null); break; case 3: _menuContext.CopyLinkCommand.Execute(null); break; } _menu?.Dismiss(true); _menu = null; _menuContext = null; }
private void OnTypeChangeButtonClick() { _menu = RecommendationsFlyoutBuilder.BuildForRecommendationsPage(Activity, RecommendationsPageTypeChangeButton, ViewModel, i => { ViewModel.CurrentWorkMode = RecommendationsPageWorkMode.Anime; _menu.Dismiss(true); }); _menu.Show(); }
private void UnpinButtonOnClick(object sender, EventArgs eventArgs) { var view = sender as View; _viewModel.UnpinTopicCommand.Execute(view.Tag.Unwrap <ForumTopicLightEntry>()); (view.Parent.Parent as View).Visibility = ViewStates.Gone; if (!_viewModel.PinnedTopics.Any()) { _menu.Dismiss(true); } }
protected override void RootContainerInit() { ForumIndexPageBoardItemIcon.Typeface = FontManager.GetTypeface(Context, FontManager.TypefacePath); if (!ViewModel.ArePeekPostsAvailable) { _binding = this.SetBinding(() => _parentViewModel.LoadingSideContentVisibility).WhenSourceChanges(() => { if (_parentViewModel.LoadingSideContentVisibility) { ForumIndexPageBoardItemBoardProgressBar.Visibility = ViewStates.Visible; ForumIndexPageBoardItemPeekPostSection.Visibility = ViewStates.Invisible; } else { ForumIndexPageBoardItemBoardProgressBar.Visibility = ViewStates.Gone; ForumIndexPageBoardItemPeekPostSection.Visibility = ViewStates.Visible; OnFinishedLoading(); BindModelFull(); _binding?.Detach(); _binding = null; } }); } ForumIndexPageBoardItemRootContainer.SetOnLongClickListener(new OnLongClickListener(view => { var pinned = ViewModelLocator.ForumsMain.PinnedBoards.Contains(ViewModel.Board); _menu = FlyoutMenuBuilder.BuildGenericFlyout(Context, ForumIndexPageBoardItemRootContainer, new List <string> { pinned ? "Remove from favourites" : "Add to favourites" }, i => { if (pinned) { ViewModelLocator.ForumsMain.RemovePinnedBoardCommand.Execute(ViewModel.Board); } else { ViewModel.AddToFavouritesCommand.Execute(ViewModel.Board); } _menu.Dismiss(true); }); _menu.Show(); })); ForumIndexPageBoardItemPeekPost1Title.Click += (sender, args) => _parentViewModel.GoToLastPostCommand.Execute(ViewModel.Entry.PeekPosts.First()); ForumIndexPageBoardItemPeekPost2Title.Click += (sender, args) => _parentViewModel.GoToLastPostCommand.Execute(ViewModel.Entry.PeekPosts.Last()); }
private void OnMoreFlyoutSelection(AnimeGridItemMoreFlyoutButtons animeGridItemMoreFlyoutButtons) { switch (animeGridItemMoreFlyoutButtons) { case AnimeGridItemMoreFlyoutButtons.CopyLink: ViewModel.CopyLinkToClipboardCommand.Execute(null); break; case AnimeGridItemMoreFlyoutButtons.OpenInBrowser: ViewModel.OpenInMALCommand.Execute(null); break; } _menu.Dismiss(true); }
private void OnMoreMenuSelected(int i) { switch (i) { case 0: ViewModel.NavigateRecentTopicsCommand.Execute(null); break; case 1: ViewModel.NavigateWatchedTopicsCommand.Execute(null); break; case 2: ViewModel.NavigateMalClientTopicsCommand.Execute(null); break; } _moreMenu.Dismiss(true); }
private void OnMoreFlyoutClick(int i) { switch (i) { case 0: ViewModel.NavigateForumBoardCommand.Execute(null); break; case 1: AnimeDetailsPageDialogBuilder.BuildPromotionalVideoDialog(ViewModel); break; case 2: AnimeUpdateDialogBuilder.BuildTagDialog(ViewModel); break; case 3: ViewModel.CopyToClipboardCommand.Execute(null); break; case 4: ViewModel.OpenInMalCommand.Execute(null); break; case 5: ViewModel.RemoveAnimeCommand.Execute(null); break; case 6: ViewModel.IsRewatching = !ViewModel.IsRewatching; break; case 7: ViewModel.CopyTitleToClipboardCommand.Execute(null); break; case 8: ViewModel.ToggleAirNotificationsCommand.Execute(null); break; } _menu?.Dismiss(true); _menu = null; }
private void OnFabMenuItemClicked(int i) { switch ((_fabMenu.Tag as List <string>)[i]) { case FabMenuLoadDetails: ViewModel.LoadAllItemsDetailsCommand.Execute(null); ResourceLocator.SnackbarProvider.ShowText("Started pulling data in background."); break; case FabMenuSetListSource: SetListSource(); break; case FabMenuDisplayModes: OpenViewModeDrawer(); break; } _fabMenu.Dismiss(true); }
private void OnLongClickAction(View view) { _menu = FlyoutMenuBuilder.BuildGenericFlyout(Context, view, new List <string> { "Pin", "Pin to lastpost" }, i => { var vm = (view.Parent as View).Tag.Unwrap <ForumTopicEntryViewModel>(); if (i == 0) { vm.PinCommand.Execute(null); } else { vm.PinLastpostCommand.Execute(null); } _menu.Dismiss(true); }); _menu.Show(); }
private void OnDisplayModeSelectionChanged(AnimeListDisplayModes animeListDisplayModes) { ViewModel.CurrentlySelectedDisplayMode = new Tuple <AnimeListDisplayModes, string>(animeListDisplayModes, ""); _displayMenu.Dismiss(true); _displayMenu = null; }
private void OnTagsButtonClick(View view) { _tagsMenu = AnimeItemFlyoutBuilder.BuildForAnimeItemTags(Context, view, ViewModel, () => _tagsMenu.Dismiss(true)); _tagsMenu.Show(); }