2019-01-24 08:43:03 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Online.API.Requests;
|
2019-02-21 10:04:31 +00:00
|
|
|
|
using osu.Framework.Bindables;
|
2018-06-08 02:41:54 +00:00
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2019-08-27 12:47:37 +00:00
|
|
|
|
using osu.Game.Online.API;
|
|
|
|
|
using System.Collections.Generic;
|
2020-01-29 18:01:40 +00:00
|
|
|
|
using osuTK;
|
2020-09-07 20:08:50 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2021-07-17 13:50:56 +00:00
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2021-11-04 09:02:44 +00:00
|
|
|
|
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Profile.Sections.Recent
|
|
|
|
|
{
|
2020-11-21 00:18:24 +00:00
|
|
|
|
public class PaginatedRecentActivityContainer : PaginatedProfileSubsection<APIRecentActivity>
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2021-11-04 09:02:44 +00:00
|
|
|
|
public PaginatedRecentActivityContainer(Bindable<APIUser> user)
|
2021-07-17 14:41:42 +00:00
|
|
|
|
: base(user, missingText: EventsStrings.Empty)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2020-01-29 18:01:40 +00:00
|
|
|
|
ItemsPerPage = 10;
|
2020-09-07 20:08:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
2020-01-30 10:55:50 +00:00
|
|
|
|
ItemsContainer.Spacing = new Vector2(0, 8);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-27 12:47:37 +00:00
|
|
|
|
protected override APIRequest<List<APIRecentActivity>> CreateRequest() =>
|
|
|
|
|
new GetUserRecentActivitiesRequest(User.Value.Id, VisiblePages++, ItemsPerPage);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2019-08-28 04:31:12 +00:00
|
|
|
|
protected override Drawable CreateDrawableItem(APIRecentActivity model) => new DrawableRecentActivity(model);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|