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);
        }
Exemple #2
0
        private void OpenSortingDrawer()
        {
            var items = new List <IDrawerItem>();

            foreach (SortOptions sortOption in Enum.GetValues(typeof(SortOptions)))
            {
                var btn = HamburgerUtilities.GetBaseSecondaryItem();
                if (sortOption == SortOptions.SortWatched)
                {
                    btn.WithName(ViewModel.Sort3Label);
                }
                else
                {
                    btn.WithName(sortOption.GetDescription());
                }
                btn.WithIdentifier((int)sortOption);
                items.Add(btn);
            }

            _rightDrawer.SetItems(items);
            _rightDrawer.SetSelection((int)ViewModel.SortOption);

            _rightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Sorting";
            _rightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_sort);

            _rightDrawer.OpenDrawer();
        }
Exemple #3
0
        private void OpenCompFiltersDrawer()
        {
            var items = new List <IDrawerItem>();

            _rightDrawer.OnDrawerItemClickListener = null;
            foreach (var enumValue in Enum.GetValues(typeof(ComparisonFilter)).Cast <ComparisonFilter>())
            {
                var btn = HamburgerUtilities.GetBaseSecondaryItem();
                btn.WithName(enumValue.GetDescription());
                btn.WithIdentifier((int)enumValue);
                items.Add(btn);
            }

            _rightDrawer.SetItems(items);
            _rightDrawer.SetSelection((int)ViewModel.ComparisonFilter);

            _rightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Comaprison Filters";
            _rightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_linear_blur);
            _rightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                ViewModel.ComparisonFilter = (ComparisonFilter)arg3.Identifier;
                CloseDrawer();
            });

            ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(CloseDrawer));
            _rightDrawer.OpenDrawer();
            _actionMenu.Close(true);
        }
Exemple #4
0
        private void OpenFiltersDrawer()
        {
            var f1 = HamburgerUtilities.GetBaseSecondaryItem();

            f1.WithName(ViewModel.Filter1Label);
            f1.WithIdentifier((int)AnimeStatus.Watching);

            var f2 = HamburgerUtilities.GetBaseSecondaryItem();

            f2.WithName("Completed");
            f2.WithIdentifier((int)AnimeStatus.Completed);

            var f3 = HamburgerUtilities.GetBaseSecondaryItem();

            f3.WithName("On Hold");
            f3.WithIdentifier((int)AnimeStatus.OnHold);

            var f4 = HamburgerUtilities.GetBaseSecondaryItem();

            f4.WithName("Dropped");
            f4.WithIdentifier((int)AnimeStatus.Dropped);

            var f5 = HamburgerUtilities.GetBaseSecondaryItem();

            f5.WithName(ViewModel.Filter5Label);
            f5.WithIdentifier((int)AnimeStatus.PlanToWatch);

            var f6 = HamburgerUtilities.GetBaseSecondaryItem();

            f6.WithName(ViewModel.StatusAllLabel);
            f6.WithIdentifier((int)AnimeStatus.AllOrAiring);


            RightDrawer.SetItems(new List <IDrawerItem> {
                f1, f2, f3, f4, f5, f6
            });
            RightDrawer.SetSelection((int)ViewModel.GetDesiredStatus());

            RightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Filters";
            RightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_filter);
            RightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                ViewModel.CurrentStatus = (int)arg3.Identifier;
                ViewModel.RefreshList();
                RightDrawer.OnDrawerItemClickListener = null;
                RightDrawer.CloseDrawer();
            });


            ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(CloseDrawer));
            RightDrawer.OpenDrawer();
            _actionMenu.Close(true);
        }
Exemple #5
0
        private void OpenFiltersDrawer()
        {
            var f1 = HamburgerUtilities.GetBaseSecondaryItem();

            f1.WithName(ViewModel.Filter1Label);
            f1.WithIdentifier((int)AnimeStatus.Watching);

            var f2 = HamburgerUtilities.GetBaseSecondaryItem();

            f2.WithName("Completed");
            f2.WithIdentifier((int)AnimeStatus.Completed);

            var f3 = HamburgerUtilities.GetBaseSecondaryItem();

            f3.WithName("On Hold");
            f3.WithIdentifier((int)AnimeStatus.OnHold);

            var f4 = HamburgerUtilities.GetBaseSecondaryItem();

            f4.WithName("Dropped");
            f4.WithIdentifier((int)AnimeStatus.Dropped);

            var f5 = HamburgerUtilities.GetBaseSecondaryItem();

            f5.WithName(ViewModel.Filter5Label);
            f5.WithIdentifier((int)AnimeStatus.PlanToWatch);

            var f6 = HamburgerUtilities.GetBaseSecondaryItem();

            f6.WithName(ViewModel.StatusAllLabel);
            f6.WithIdentifier((int)AnimeStatus.AllOrAiring);


            _rightDrawer.SetItems(new List <IDrawerItem> {
                f1, f2, f3, f4, f5, f6
            });
            _rightDrawer.SetSelection((int)ViewModel.GetDesiredStatus());

            _rightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Filters";
            _rightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_filter);

            _rightDrawer.OpenDrawer();
        }
        private void OpenViewModeDrawer()
        {
            var f1 = HamburgerUtilities.GetBaseSecondaryItem();

            f1.WithName("Grid");
            f1.WithIdentifier((int)AnimeListDisplayModes.IndefiniteGrid);

            var f2 = HamburgerUtilities.GetBaseSecondaryItem();

            f2.WithName("Detailed List");
            f2.WithIdentifier((int)AnimeListDisplayModes.IndefiniteList);

            var f3 = HamburgerUtilities.GetBaseSecondaryItem();

            f3.WithName("Compact List");
            f3.WithIdentifier((int)AnimeListDisplayModes.IndefiniteCompactList);

            RightDrawer.SetItems(new List <IDrawerItem>()
            {
                f1, f2, f3
            });
            RightDrawer.SetSelection((int)ViewModel.DisplayMode);

            RightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Display Modes";
            RightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_eye);
            RightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                if (view == null)
                {
                    return;
                }
                ViewModel.CurrentlySelectedDisplayMode =
                    new Tuple <AnimeListDisplayModes, string>((AnimeListDisplayModes)arg3.Identifier, null);
                RightDrawer.OnDrawerItemClickListener = null;
                RightDrawer.CloseDrawer();
            });

            (ViewModelLocator.NavMgr as NavMgr).EnqueueOneTimeOverride(new RelayCommand(CloseDrawer));
            RightDrawer.OpenDrawer();
            _actionMenu.Close(true);
        }
Exemple #7
0
        private void OpenFiltersDrawer()
        {
            var items = new List <IDrawerItem>();

            _rightDrawer.OnDrawerItemClickListener = null;
            foreach (var enumValue in Enum.GetValues(typeof(AnimeStatus)).Cast <AnimeStatus>())
            {
                var btn = HamburgerUtilities.GetBaseSecondaryItem();
                btn.WithName(Utilities.StatusToString((int)enumValue));
                btn.WithIdentifier((int)enumValue);
                items.Add(btn);
            }

            var spinner = new Spinner(Context);

            spinner.Adapter = Enum.GetValues(typeof(ComparisonStatusFilterTarget)).Cast <ComparisonStatusFilterTarget>()
                              .ToList().GetAdapter(GetTemplateDelegate);
            spinner.SetSelection((int)ViewModel.StatusFilterTarget);
            spinner.ItemSelected += (sender, args) =>
            {
                ViewModel.StatusFilterTarget = (ComparisonStatusFilterTarget)(int)(sender as Spinner).SelectedView.Tag;
                ViewModel.RefreshList();
            };

            items.Add(new ContainerDrawerItem().WithView(spinner));

            _rightDrawer.SetItems(items);
            _rightDrawer.SetSelection((int)ViewModel.StatusFilter);

            _rightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Status Filters";
            _rightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_filter);

            _rightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                ViewModel.StatusFilter = (AnimeStatus)arg3.Identifier;
                CloseDrawer();
            });

            _rightDrawer.OpenDrawer();
            _actionMenu.Close(true);
        }
Exemple #8
0
        private void OpenSortingDrawer()
        {
            var items = new List <IDrawerItem>();

            _rightDrawer.OnDrawerItemClickListener = null;
            foreach (var enumValue in Enum.GetValues(typeof(ComparisonSorting)).Cast <ComparisonSorting>())
            {
                var btn = HamburgerUtilities.GetBaseSecondaryItem();
                btn.WithName(enumValue.GetDescription());
                btn.WithIdentifier((int)enumValue);
                items.Add(btn);
            }

            var descendingToggle = new SwitchDrawerItem();

            descendingToggle.WithName("Descending Order");
            descendingToggle.WithChecked(!ViewModel.SortAscending);
            descendingToggle.WithOnCheckedChangeListener(
                new DrawerCheckedChangeListener(DescendingToggleOnCheckedChange));
            descendingToggle.WithIdentifier(998877);
            descendingToggle.WithTextColorRes(ResourceExtension.BrushTextRes);
            items.Add(descendingToggle);

            _rightDrawer.SetItems(items);
            _rightDrawer.SetSelection((int)ViewModel.ComparisonSorting);

            _rightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Sorting";
            _rightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_sort);
            _rightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                ViewModel.ComparisonSorting = (ComparisonSorting)arg3.Identifier;
                CloseDrawer();
            });

            ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(CloseDrawer));
            _rightDrawer.OpenDrawer();
            _actionMenu.Close(true);
        }
        private void OpenFiltersDrawer()
        {
            if (ViewModel.Loading || _rightDrawer == null)
            {
                return;
            }

            var items = new List <IDrawerItem>();

            foreach (MalClubQueries.SearchCategory group in Enum.GetValues(typeof(MalClubQueries.SearchCategory)))
            {
                var item = HamburgerUtilities.GetBaseSecondaryItem();
                item.WithName(group.GetDescription());
                item.WithIdentifier((int)group);

                items.Add(item);
            }

            _rightDrawer.SetItems(items);
            _rightDrawer.SetSelection((int)ViewModel.SearchCategory);


            _rightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Filters";
            _rightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_filter);
            _rightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                ViewModel.SearchCategory = (MalClubQueries.SearchCategory)arg3.Identifier;
                ViewModel.SearchCommand.Execute(null);

                _rightDrawer.OnDrawerItemClickListener = null;
                _rightDrawer.CloseDrawer();
            });


            ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(CloseDrawer));
            _rightDrawer.OpenDrawer();
        }
        private void OpenSeasonalSelectionDrawer()
        {
            var items = new List <IDrawerItem>();
            int index = 0;

            foreach (var season in ViewModel.SeasonSelection)
            {
                var item = HamburgerUtilities.GetBaseSecondaryItem();
                item.WithName(season.Name);
                item.WithIdentifier(index++);

                items.Add(item);
            }
            var seasonView = Activity.LayoutInflater.Inflate(Resource.Layout.SeasonSelectionPopup, null);

            var spinnerYear   = seasonView.FindViewById <Spinner>(Resource.Id.SeasonSelectionPopupYearComboBox);
            var spinnerSeason = seasonView.FindViewById <Spinner>(Resource.Id.SeasonSelectionPopupSeasonComboBox);

            spinnerYear.Adapter = ViewModel.SeasonYears.GetAdapter((i, s, arg3) =>
            {
                var view = arg3 ?? AnimeListPageFlyoutBuilder.BuildBaseItem(MainActivity.CurrentContext, s, ResourceExtension.BrushAnimeItemInnerBackground, null, false);
                view.FindViewById <TextView>(AnimeListPageFlyoutBuilder.TextViewTag).Text = s;
                view.Tag = s.Wrap();

                return(view);
            });
            spinnerYear.ItemSelected += (sender, args) =>
            {
                ViewModel.CurrentlySelectedCustomSeasonYear = (sender as Spinner).SelectedView.Tag.Unwrap <string>();
            };
            spinnerSeason.Adapter = ViewModel.SeasonSeasons.GetAdapter((i, s, arg3) =>
            {
                var view = arg3 ?? AnimeListPageFlyoutBuilder.BuildBaseItem(MainActivity.CurrentContext, s, ResourceExtension.BrushAnimeItemInnerBackground, null, false);
                view.Tag = s.Wrap();

                return(view);
            });
            spinnerSeason.ItemSelected += (sender, args) =>
            {
                ViewModel.CurrentlySelectedCustomSeasonSeason = (sender as Spinner).SelectedView.Tag.Unwrap <string>();
            };
            seasonView.FindViewById(Resource.Id.SeasonSelectionPopupAcceptButton).SetOnClickListener(new OnClickListener(
                                                                                                         view =>
            {
                ViewModel.GoToCustomSeasonCommand.Execute(null);
                RightDrawer.OnDrawerItemClickListener = null;
                RightDrawer.CloseDrawer();
            }));

            items.Add(new ContainerDrawerItem().WithView(seasonView));
            RightDrawer.SetItems(items);
            RightDrawer.SetSelection(
                ViewModel.SeasonSelection.FindIndex(season => season.Name == ViewModel.CurrentSeason.Name));

            RightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                if (view == null)
                {
                    return;
                }
                ViewModel.SeasonalUrlsSelectedIndex   = i;
                RightDrawer.OnDrawerItemClickListener = null;
                RightDrawer.CloseDrawer();
            });



            RightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Seasonal Selection";
            RightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_calendar);

            ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(CloseDrawer));
            RightDrawer.OpenDrawer();
            _actionMenu.Close(true);
        }
        private void OpenSortingDrawer()
        {
            var items   = new List <IDrawerItem>();
            var options = Enum.GetValues(typeof(SortOptions)).Cast <SortOptions>();

            if (ViewModel.IsMangaWorkMode)
            {
                options = options.Except(new[] { SortOptions.SortAirDay, SortOptions.SortSeason });
            }
            foreach (SortOptions sortOption in options)
            {
                var btn = HamburgerUtilities.GetBaseSecondaryItem();
                if (sortOption == SortOptions.SortWatched)
                {
                    btn.WithName(ViewModel.Sort3Label);
                }
                else
                {
                    btn.WithName(sortOption.GetDescription());
                }
                btn.WithIdentifier((int)sortOption);
                items.Add(btn);
            }

            var descendingToggle = new SwitchDrawerItem();

            descendingToggle.WithName("Descending Order");
            descendingToggle.WithChecked(ViewModel.SortDescending);
            descendingToggle.WithOnCheckedChangeListener(
                new DrawerCheckedChangeListener(DescendingToggleOnCheckedChange));
            descendingToggle.WithIdentifier(998877);
            descendingToggle.WithTextColorRes(ResourceExtension.BrushTextRes);
            items.Add(descendingToggle);

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

            RightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Sorting";
            RightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_sort);
            RightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                if (view == null)
                {
                    return;
                }
                if (arg3.Identifier == 998877)
                {
                    ViewModel.SortDescending = !ViewModel.SortDescending;
                    ViewModel.RefreshList();
                }
                else
                {
                    ViewModel.SetSortOrder((SortOptions)arg3.Identifier);
                    ViewModel.RefreshList();
                }

                RightDrawer.OnDrawerItemClickListener = null;
                RightDrawer.CloseDrawer();
            });

            ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(CloseDrawer));
            RightDrawer.OpenDrawer();
            _actionMenu.Close(true);
        }
Exemple #12
0
        private void OpenFiltersDrawer()
        {
            if (ViewModel.Loading)
            {
                return;
            }

            var         items      = new List <IDrawerItem>();
            IDrawerItem activeItem = null;

            foreach (var viewModelNotificationGroup in ViewModel.NotificationGroups)
            {
                var item = HamburgerUtilities.GetBaseSecondaryItem();
                item.WithName(viewModelNotificationGroup.NotificationType.GetDescription());
                item.WithBadge(viewModelNotificationGroup.NotificationsCount.ToString());
                item.WithIdentifier((int)viewModelNotificationGroup.NotificationType);

                if (ViewModel.CurrentNotificationType == viewModelNotificationGroup.NotificationType)
                {
                    activeItem = item;
                }



                items.Add(item);
            }

            var showAllItem = HamburgerUtilities.GetBaseSecondaryItem();

            showAllItem.WithName("All");
            showAllItem.WithIdentifier(3);

            items.Insert(0, showAllItem);

            if (activeItem == null)
            {
                activeItem = showAllItem;
            }



            _rightDrawer.SetItems(items);
            _rightDrawer.SetSelection(activeItem);


            _rightDrawer.StickyHeader.FindViewById <TextView>(Resource.Id.AnimeListPageDrawerHeaderText).Text = "Filters";
            _rightDrawer.StickyHeader.FindViewById <ImageView>(Resource.Id.AnimeListPageDrawerHeaderIcon).SetImageResource(
                Resource.Drawable.icon_filter);
            _rightDrawer.OnDrawerItemClickListener = new HamburgerItemClickListener((view, i, arg3) =>
            {
                if (arg3.Identifier != 3)
                {
                    ViewModel.CurrentNotificationType = (MalNotificationsTypes)arg3.Identifier;
                }
                else
                {
                    ViewModel.CurrentNotificationType = MalNotificationsTypes.Generic;
                }

                _rightDrawer.OnDrawerItemClickListener = null;
                _rightDrawer.CloseDrawer();
            });


            ViewModelLocator.NavMgr.RegisterOneTimeMainOverride(new RelayCommand(CloseDrawer));
            _rightDrawer.OpenDrawer();
        }