School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:custom="clr-namespace:TechTitans.Views.Components"
x:Class="TechTitans.Views.Components.Artist.ArtistSongDashboard"
Title="Song Dashboard">
<VerticalStackLayout>
<VerticalStackLayout Padding="20" Spacing="10">
<Image
x:Name="SongImage"
HorizontalOptions="Start"
HeightRequest="256"
WidthRequest="256"
/>
<Label
x:Name="SongTitle"
Text=""
FontSize="32"
FontAttributes="Bold"
WidthRequest="256"
HorizontalOptions="Start"
/>
<Label
x:Name="SongArtist"
Text=""
FontSize="20"
TextColor="#6E6E6E"
Margin="0,-10,0,0"
HorizontalOptions="Start"
/>
<Label
x:Name="SongAlbum"
Text=""
FontSize="24"
HorizontalOptions="Start"
/>
</VerticalStackLayout>
<!--linie f ghetto-->
<BoxView Color="Gray" HeightRequest="2" HorizontalOptions="FillAndExpand" Margin="10, 5" />
<HorizontalStackLayout HorizontalOptions="CenterAndExpand" Spacing="10">
<VerticalStackLayout>
<Button
Text="Info"
TextColor="#6E6E6E"
FontAttributes="Bold"
Style="{StaticResource TabNavButton}"
Clicked="OnInfoClick"
/>
<BoxView x:Name="InfoBoxView" Color="#6E6E6E" HeightRequest="2" HorizontalOptions="FillAndExpand"/>
</VerticalStackLayout>
<VerticalStackLayout>
<Button
Text="Performance"
TextColor="#6E6E6E"
FontAttributes="Bold"
Style="{StaticResource TabNavButton}"
Clicked="OnPerformanceCLick"
/>
<BoxView x:Name="PerformanceBoxView" Color="#1E1E1E" HeightRequest="2" HorizontalOptions="FillAndExpand"/>
</VerticalStackLayout>
</HorizontalStackLayout>
<Frame
CornerRadius="10"
Margin="20,20,20,0"
Padding="10"
BackgroundColor="#6E6E6E"
>
<HorizontalStackLayout Spacing="40" HorizontalOptions="Center">
<VerticalStackLayout Spacing="20" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Label
x:Name="label1"
Text=""
FontSize="16"
/>
<Label
x:Name="label2"
Text=""
FontSize="16"
/>
<Label
x:Name="label3"
Text=""
FontSize="16"
/>
<Label
x:Name="label4"
Text=""
FontSize="16"
/>
</VerticalStackLayout>
<VerticalStackLayout Spacing="20" VerticalOptions="FillAndExpand" HorizontalOptions="EndAndExpand">
<Label
x:Name="content1"
Text=""
FontSize="16"
/>
<Label
x:Name="content2"
Text=""
FontSize="16"
/>
<Label
x:Name="content3"
Text=""
FontSize="16"
/>
<Label
x:Name="content4"
Text=""
FontSize="16"
/>
</VerticalStackLayout>
</HorizontalStackLayout>
</Frame>
</VerticalStackLayout>
</ContentPage>
@@ -0,0 +1,85 @@
using TechTitans.Models;
using TechTitans.ViewModels;
using TechTitans.Services;
namespace TechTitans.Views.Components.Artist;
public partial class ArtistSongDashboard : ContentPage
{
public ArtistSongDashboardController service = new ();
// alt domain song type cu mai multe detalii
int songId;
ArtistSongDashboardViewModel viewModel;
public ArtistSongDashboard(SongBasicInfo song)
{
songId = song.SongId;
InitializeComponent();
populateViewModel(songId);
LoadPage();
}
private void populateViewModel(int songID)
{
viewModel = new ArtistSongDashboardViewModel() {
SongInfo = service.getSongInfo(songID),
SongDetails = service.getSongDetails(songID),
ArtistInfo = service.getArtistInfo(songID)
};
}
private void LoadPage()
{
SongImage.Source = viewModel.SongInfo.Image;
SongTitle.Text = viewModel.SongInfo.Name;
SongArtist.Text = "by " + viewModel.ArtistInfo.Name;
SongAlbum.Text = "from " + viewModel.SongInfo.Album;
// set song info panel
label1.Text = "Genre:";
content1.Text = viewModel.SongInfo.Genre;
label2.Text = "Subgenre:";
content2.Text = viewModel.SongInfo.Subgenre;
label3.Text = "Country:";
content3.Text = viewModel.SongInfo.Country;
label4.Text = "Language:";
content4.Text = viewModel.SongInfo.Language;
}
// private ArtistSongDashboardViewModel getMockedViewModel()
//{
// var mockedModel = new ArtistSongDashboardViewModel()
// {
// SongInfo = new SongBasicInfo(),
// SongDetails = new SongRecommendationDetails(),
// ArtistInfo = new AuthorDetails(),
// };
// return mockedModel;
//}
private void OnInfoClick(object sender, EventArgs e)
{
InfoBoxView.Color = Color.FromArgb("#6E6E6E");
PerformanceBoxView.Color = Color.FromArgb("#1E1E1E");
label1.Text = "Genre:";
content1.Text = viewModel.SongInfo.Genre;
label2.Text = "Subgenre:";
content2.Text = viewModel.SongInfo.Subgenre;
label3.Text = "Country:";
content3.Text = viewModel.SongInfo.Country;
label4.Text = "Language:";
content4.Text = viewModel.SongInfo.Language;
}
private void OnPerformanceCLick(object sender, EventArgs e)
{
PerformanceBoxView.Color = Color.FromArgb("#6E6E6E");
InfoBoxView.Color = Color.FromArgb("#1E1E1E");
label1.Text = "Minutes Listened:";
content1.Text = viewModel.SongDetails.Minutes_Listened.ToString();
label2.Text = "Total Plays:";
content2.Text = viewModel.SongDetails.Number_Of_Plays.ToString();
label3.Text = "Likes:";
content3.Text = viewModel.SongDetails.Likes.ToString();
label4.Text = "Dislikes:";
content4.Text = viewModel.SongDetails.Dislikes.ToString();
}
}