Reorder file and change naming slightly

This commit is contained in:
Dean Herbert 2020-05-14 14:24:43 +09:00
parent 5e09a1b334
commit fa3373e5f3
2 changed files with 16 additions and 16 deletions

View File

@ -36,6 +36,9 @@ public class BeatmapListingFilterControl : CompositeDrawable
private BeatmapListingPager beatmapListingPager;
private ScheduledDelegate queryChangedDebounce;
private ScheduledDelegate queryPagingDebounce;
public BeatmapListingFilterControl()
{
RelativeSizeAxes = Axes.X;
@ -113,8 +116,17 @@ protected override void LoadComplete()
sortDirection.BindValueChanged(_ => queueUpdateSearch());
}
private ScheduledDelegate queryChangedDebounce;
private ScheduledDelegate queryPagingDebounce;
public void TakeFocus() => searchControl.TakeFocus();
public void ShowMore()
{
if (beatmapListingPager == null || !beatmapListingPager.CanFetchNextPage)
return;
if (queryPagingDebounce != null)
return;
beatmapListingPager.FetchNextPage();
}
private void queueUpdateSearch(bool queryTextChanged = false)
{
@ -142,7 +154,7 @@ private void updateSearch()
queryPagingDebounce = null;
beatmapListingPager.PageFetched += onSearchFinished;
AddPageToResult();
ShowMore();
}
private void onSearchFinished(List<BeatmapSetInfo> beatmaps)
@ -165,17 +177,5 @@ protected override void Dispose(bool isDisposing)
base.Dispose(isDisposing);
}
public void TakeFocus() => searchControl.TakeFocus();
public void AddPageToResult()
{
if (beatmapListingPager == null || !beatmapListingPager.CanFetchNextPage)
return;
if (queryPagingDebounce != null)
return;
beatmapListingPager.FetchNextPage();
}
}
}

View File

@ -247,7 +247,7 @@ protected override void Update()
base.Update();
if (shouldAddNextPage)
filterControl.AddPageToResult();
filterControl.ShowMore();
}
}
}