osu/osu.Game/Overlays/Profile/Sections/Recent/PaginatedRecentActivityContainer.cs

30 lines
1.0 KiB
C#
Raw Normal View History

// 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;
using osu.Game.Users;
2019-02-21 10:04:31 +00:00
using osu.Framework.Bindables;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.API;
using System.Collections.Generic;
using osuTK;
2018-04-13 09:19:50 +00:00
namespace osu.Game.Overlays.Profile.Sections.Recent
{
public class PaginatedRecentActivityContainer : PaginatedContainer<APIRecentActivity>
2018-04-13 09:19:50 +00:00
{
2020-09-07 19:30:43 +00:00
public PaginatedRecentActivityContainer(Bindable<User> user)
: base(user)
2018-04-13 09:19:50 +00:00
{
ItemsPerPage = 10;
2020-01-30 10:55:50 +00:00
ItemsContainer.Spacing = new Vector2(0, 8);
2018-04-13 09:19:50 +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
}
}