Skip to content

Commit

Permalink
Add anime tabs to home view
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry08 committed Jan 19, 2024
1 parent 4f8565e commit 6d77015
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 38 deletions.
35 changes: 35 additions & 0 deletions Anikin/Models/AnimeHomeRange.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Collections.Generic;
using Anikin.Utils;
using Anikin.Utils.Extensions;
using CommunityToolkit.Mvvm.ComponentModel;
using Jita.AniList.Models;

namespace Anikin.Models;

public partial class AnimeHomeRange : ObservableObject
{
public string Name { get; set; }

[ObservableProperty]
bool _isLoading;

public AnimeHomeTypes Type { get; set; }

public ObservableRangeCollection<Media> Medias { get; set; } = new();

[ObservableProperty]
private bool _isSelected;

public AnimeHomeRange(AnimeHomeTypes type)
{
Type = type;
Name = Type.GetBestDisplayName();
}

public AnimeHomeRange(AnimeHomeTypes type, IEnumerable<Media> medias) : this(type)
{
Medias.AddRange(medias);
}

public override string ToString() => Name;
}
30 changes: 30 additions & 0 deletions Anikin/Models/AnimeHomeTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.ComponentModel;

namespace Anikin.Models;

public enum AnimeHomeTypes
{
[Description("Popular")]
Popular,

[Description("Recently Updated")]
LastUpdated,

[Description("Current Season")]
CurrentSeason,

[Description("Trending")]
Trending,

[Description("New Season")]
NewSeason,

[Description("Feminine Audience")]
FeminineMedia,

[Description("Male Audience")]
MaleMedia,

[Description("Trash Anime")]
TrashMedia
}
Loading

0 comments on commit 6d77015

Please sign in to comment.