private void OpenTopTypeDrawer()
        {
            var items = new List <IDrawerItem>();

            foreach (TopAnimeType sortOption in Enum.GetValues(typeof(TopAnimeType)))
            {
                var btn = HamburgerUtilities.GetBaseSecondaryItem();
                btn.WithName(sortOption.ToString());
                btn.WithIdentifier((int)sortOption);
                items.Add(btn);
            }

            RightDrawer.SetItems(items);
            RightDrawer.SetSelection((int)ViewModel.TopAnimeWorkMode);

            RightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Top Types";
            RightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_fav_outline);
            RightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                if (view == null)
                {
                    return;
                }
                ViewModelLocator.GeneralMain.Navigate(PageIndex.PageAnimeList, AnimeListPageNavigationArgs.TopAnime((TopAnimeType)i));
                RightDrawer.OnDrawerItemClickListener = null;
                RightDrawer.CloseDrawer();
            });

            ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(CloseDrawer));
            RightDrawer.OpenDrawer();
            _actionMenu.Close(true);
        }
 private void ButtonClickTopCategory(object o)
 {
     if (o == null)
         return;
     TopAnimeType type = (TopAnimeType)int.Parse(o as string);
     ViewModelLocator.Main.Navigate(PageIndex.PageTopAnime, AnimeListPageNavigationArgs.TopAnime(type));
     SetActiveButton(HamburgerButtons.TopAnime);
 }
Example #3
0
 private void OnTopAnimeMore(View view)
 {
     _moreMenu = FlyoutMenuBuilder.BuildGenericFlyout(this, view,
                                                      Enum.GetValues(typeof(TopAnimeType)).Cast <TopAnimeType>().Select(type => type.ToString()).ToList(),
                                                      i =>
     {
         ViewModel.Navigate(PageIndex.PageTopAnime, AnimeListPageNavigationArgs.TopAnime((TopAnimeType)i));
         _moreMenu.Dismiss(true);
         _drawer.CloseDrawer();
     });
     _moreMenu.Show();
 }
Example #4
0
        private object GetAppropriateArgsForPage(PageIndex page)
        {
            switch (page)
            {
            case PageIndex.PageSeasonal:
                return(AnimeListPageNavigationArgs.Seasonal);

            case PageIndex.PageMangaList:
                return(AnimeListPageNavigationArgs.Manga);

            case PageIndex.PageMangaSearch:
                return(new SearchPageNavigationArgs {
                    Anime = false
                });

            case PageIndex.PageSearch:
                return(new SearchPageNavigationArgs());

            case PageIndex.PageTopAnime:
                return(AnimeListPageNavigationArgs.TopAnime(TopAnimeType.General));

            case PageIndex.PageTopManga:
                return(AnimeListPageNavigationArgs.TopManga);

            case PageIndex.PageArticles:
                return(MalArticlesPageNavigationArgs.Articles);

            case PageIndex.PageNews:
                return(MalArticlesPageNavigationArgs.News);

            case PageIndex.PageProfile:
                return(new ProfilePageNavigationArgs {
                    TargetUser = Credentials.UserName
                });

            case PageIndex.PageWallpapers:
                return(new WallpaperPageNavigationArgs());

            default:
                return(null);
            }
        }
 private object GetAppropriateArgsForPage(PageIndex page)
 {
     switch (page)
     {
         case PageIndex.PageSeasonal:
             return AnimeListPageNavigationArgs.Seasonal;
         case PageIndex.PageMangaList:
             return AnimeListPageNavigationArgs.Manga;
         case PageIndex.PageMangaSearch:
             return new SearchPageNavigationArgs {Anime = false};
         case PageIndex.PageSearch:
             return new SearchPageNavigationArgs();
         case PageIndex.PageTopAnime:
             return AnimeListPageNavigationArgs.TopAnime(TopAnimeType.General);
         case PageIndex.PageTopManga:
             return AnimeListPageNavigationArgs.TopManga;
         case PageIndex.PageArticles:
             return MalArticlesPageNavigationArgs.Articles;
         case PageIndex.PageNews:
             return MalArticlesPageNavigationArgs.News;
         default:
             return null;
     }
 }