Exemple #1
0
 private void load()
 {
     RelativeSizeAxes = Axes.X;
     AutoSizeAxes     = Axes.Y;
     InternalChild    = new ReverseChildIDFillFlowContainer <Drawable>
     {
         RelativeSizeAxes = Axes.X,
         AutoSizeAxes     = Axes.Y,
         Direction        = FillDirection.Vertical,
         Children         = new Drawable[]
         {
             selector = new SpotlightSelector
             {
                 Current = selectedSpotlight,
             },
             new Container
             {
                 RelativeSizeAxes = Axes.X,
                 AutoSizeAxes     = Axes.Y,
                 Children         = new Drawable[]
                 {
                     content = new Container
                     {
                         RelativeSizeAxes = Axes.X,
                         AutoSizeAxes     = Axes.Y,
                         Margin           = new MarginPadding {
                             Vertical = 10
                         }
                     },
                     loading = new DimmedLoadingLayer()
                 }
             }
         }
     };
 }
Exemple #2
0
        private void onSearchFinished(BeatmapListingFilterControl.SearchResult searchResult)
        {
            if (searchResult.Type == BeatmapListingFilterControl.SearchResultType.SupporterOnlyFilters)
            {
                supporterRequiredContent.UpdateText(searchResult.SupporterOnlyFiltersUsed);
                addContentToPlaceholder(supporterRequiredContent);
                return;
            }

            var newPanels = searchResult.Results.Select(b => new BeatmapCard(b)
            {
                Anchor = Anchor.TopCentre,
                Origin = Anchor.TopCentre,
            });

            if (filterControl.CurrentPage == 0)
            {
                //No matches case
                if (!newPanels.Any())
                {
                    addContentToPlaceholder(notFoundContent);
                    return;
                }

                // spawn new children with the contained so we only clear old content at the last moment.
                // reverse ID flow is required for correct Z-ordering of the cards' expandable content (last card should be front-most).
                var content = new ReverseChildIDFillFlowContainer <BeatmapCard>
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Spacing          = new Vector2(10),
                    Alpha            = 0,
                    Margin           = new MarginPadding {
                        Vertical = 15
                    },
                    ChildrenEnumerable = newPanels
                };

                panelLoadDelegate = LoadComponentAsync(foundContent = content, addContentToPlaceholder, (cancellationToken = new CancellationTokenSource()).Token);
            }
            else
            {
                panelLoadDelegate = LoadComponentsAsync(newPanels, loaded =>
                {
                    lastFetchDisplayedTime = Time.Current;
                    foundContent.AddRange(loaded);
                    loaded.ForEach(p => p.FadeIn(200, Easing.OutQuint));
                });
            }
        }
 public TestSceneBeatmapSearchFilter()
 {
     Add(resizableContainer = new ReverseChildIDFillFlowContainer <Drawable>
     {
         Anchor           = Anchor.Centre,
         Origin           = Anchor.Centre,
         AutoSizeAxes     = Axes.Y,
         RelativeSizeAxes = Axes.X,
         Direction        = FillDirection.Vertical,
         Spacing          = new Vector2(0, 10),
         Children         = new Drawable[]
         {
             new BeatmapSearchRulesetFilterRow(),
             new BeatmapSearchFilterRow <SearchCategory>("Categories"),
             new BeatmapSearchFilterRow <SearchCategory>("Header Name")
         }
     });
 }
        private static ReverseChildIDFillFlowContainer <BeatmapCard> createCardContainerFor(IEnumerable <BeatmapCard> newCards)
        {
            // spawn new children with the contained so we only clear old content at the last moment.
            // reverse ID flow is required for correct Z-ordering of the cards' expandable content (last card should be front-most).
            var content = new ReverseChildIDFillFlowContainer <BeatmapCard>
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Spacing          = new Vector2(10),
                Alpha            = 0,
                Margin           = new MarginPadding {
                    Vertical = 15
                },
                ChildrenEnumerable = newCards
            };

            return(content);
        }
Exemple #5
0
        private static ReverseChildIDFillFlowContainer <BeatmapCard> createCardContainerFor(IEnumerable <BeatmapCard> newCards)
        {
            // spawn new children with the contained so we only clear old content at the last moment.
            // reverse ID flow is required for correct Z-ordering of the cards' expandable content (last card should be front-most).
            var content = new ReverseChildIDFillFlowContainer <BeatmapCard>
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Spacing          = new Vector2(10),
                Alpha            = 0,
                Margin           = new MarginPadding
                {
                    Top = 15,
                    // the + 20 adjustment is roughly eyeballed in order to fit all of the expanded content height after it's scaled
                    // as well as provide visual balance to the top margin.
                    Bottom = ExpandedContentScrollContainer.HEIGHT + 20
                },
                ChildrenEnumerable = newCards
            };

            return(content);
        }