Skip to content

Commit

Permalink
First stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Perez committed Jul 6, 2022
0 parents commit a124aca
Show file tree
Hide file tree
Showing 137 changed files with 5,217 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vs/**
51 changes: 51 additions & 0 deletions SonicLairXbox.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32228.430
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SonicLairXbox", "SonicLairXbox\SonicLairXbox.csproj", "{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|ARM.ActiveCfg = Debug|ARM
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|ARM.Build.0 = Debug|ARM
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|ARM.Deploy.0 = Debug|ARM
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|ARM64.Build.0 = Debug|ARM64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|ARM64.Deploy.0 = Debug|ARM64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|x64.ActiveCfg = Debug|x64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|x64.Build.0 = Debug|x64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|x64.Deploy.0 = Debug|x64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|x86.ActiveCfg = Debug|x86
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|x86.Build.0 = Debug|x86
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Debug|x86.Deploy.0 = Debug|x86
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|ARM.ActiveCfg = Release|ARM
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|ARM.Build.0 = Release|ARM
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|ARM.Deploy.0 = Release|ARM
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|ARM64.ActiveCfg = Release|ARM64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|ARM64.Build.0 = Release|ARM64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|ARM64.Deploy.0 = Release|ARM64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|x64.ActiveCfg = Release|x64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|x64.Build.0 = Release|x64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|x64.Deploy.0 = Release|x64
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|x86.ActiveCfg = Release|x86
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|x86.Build.0 = Release|x86
{DEF72F8D-A863-471C-B0B8-4EBA27DE141C}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E43AD2D1-5321-406B-BF34-B0A7A7E6CDA9}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions SonicLairXbox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Binary artifacts
AppPackages
bin
obj
BundleArtifacts
Package.StoreAssociation.xml
88 changes: 88 additions & 0 deletions SonicLairXbox/AccountPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<Page
x:Class="SonicLairXbox.AccountPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="{StaticResource BackgroundColor}"
mc:Ignorable="d">

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<Rectangle
Name="rg_image"
Grid.Row="0"
Width="280"
Height="280"
Margin="10"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Canvas.ZIndex="100"
RadiusX="8"
RadiusY="8">
<Rectangle.Fill>
<ImageBrush ImageSource="/Assets/Icons/user.svg" Stretch="UniformToFill" />
</Rectangle.Fill>
</Rectangle>
<Rectangle
Grid.Row="0"
Width="300"
Height="300"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
RadiusX="8"
RadiusY="8">
<Rectangle.Fill>
<SolidColorBrush Color="#626c80" />
</Rectangle.Fill>
</Rectangle>

<StackPanel Grid.Row="1" Margin="0,10,0,0">
<TextBlock
Name="tb_username"
HorizontalAlignment="Center"
FontFamily="{StaticResource Montserrat}"
FontSize="45"
FontWeight="Thin" />
<TextBlock
Name="tb_server"
HorizontalAlignment="Center"
FontFamily="{StaticResource Montserrat}"
FontSize="35"
FontWeight="Thin" />
<TextBlock
Name="tb_type"
HorizontalAlignment="Center"
FontFamily="{StaticResource Montserrat}"
FontSize="35"
FontWeight="Thin" />
<TextBlock
Name="tb_plaintext_warning"
HorizontalAlignment="Center"
FontFamily="{StaticResource Montserrat}"
FontSize="35"
FontWeight="Thin"
Foreground="Red" />
<Button
Name="btn_logout"
Width="100"
Height="45"
Padding="10"
HorizontalAlignment="Center"
CornerRadius="8"
FontWeight="Thin"
UseSystemFocusVisuals="false">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="30">
Logout
</TextBlock>
</Button>
</StackPanel>
</Grid>
</Page>
69 changes: 69 additions & 0 deletions SonicLairXbox/AccountPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using SonicLair.Services;

using SonicLairXbox.Services;

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;

using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// La plantilla de elemento Página en blanco está documentada en https://go.microsoft.com/fwlink/?LinkId=234238

namespace SonicLairXbox
{
/// <summary>
/// Una página vacía que se puede usar de forma independiente o a la que se puede navegar dentro de un objeto Frame.
/// </summary>
public sealed partial class AccountPage : Page,INotificationObserver
{
private readonly ISubsonicService _client;
private readonly Account _account;
public AccountPage()
{
this.InitializeComponent();
((App)App.Current).RegisterObserver(this);
btn_logout.KeyDown += Btn_logout_KeyDown;
btn_logout.Click += Btn_logout_Click;
_client = (ISubsonicService)((App)App.Current).Container.GetService(typeof(ISubsonicService));
_account = _client.GetActiveAccount();
tb_username.Text = _account.Username;
tb_server.Text = $"on {_account.Url}";
// For now
tb_type.Text = string.IsNullOrWhiteSpace(_account.Type) ? "" : $"running {_account.Type}";
tb_plaintext_warning.Text = _account.UsePlaintext ? "using plaintext password" : "";
}

private void Btn_logout_Click(object sender, RoutedEventArgs e)
{
_client.Logout();
((App)App.Current).NotifyObservers("LOGOUT");
}

private void Btn_logout_KeyDown(object sender, KeyRoutedEventArgs e)
{
if(e.Key == Windows.System.VirtualKey.Left)
{
((App)App.Current).NotifyObservers("focusSidebar");
}
}

public void Update(string action, string value = "")
{
if(action == "focusContent")
{
btn_logout.Focus(FocusState.Keyboard);
}
}
}
}
58 changes: 58 additions & 0 deletions SonicLairXbox/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<Application
x:Class="SonicLairXbox.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SonicLairXbox">

<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<FontFamily x:Key="ContentControlThemeFontFamily">Assets/Fonts/Montserrat.ttf#Montserrat Thin</FontFamily>

</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver">#626c80</SolidColorBrush>
<SolidColorBrush x:Key="ButtonBackgroundFocus">#626c80</SolidColorBrush>
<CornerRadius x:Key="GridViewItemCornerRadius">5</CornerRadius>
<FontFamily x:Key="Montserrat">Assets/Fonts/Montserrat.ttf#Montserrat Thin</FontFamily>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" x:Key="control" />
<SolidColorBrush x:Key="BackgroundColor">#282c34</SolidColorBrush>
<SolidColorBrush x:Key="HighlightColor">#626c80</SolidColorBrush>
<SolidColorBrush x:Key="HighlightColorDark">#1d2027</SolidColorBrush>
<Style x:Key="MontserratFont" TargetType="TextBox">
<Setter Property="FontFamily" Value="{StaticResource Montserrat}" />
</Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter x:Name="ContentPresenter">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<VisualState.Setters>
<Setter Target="ContentPresenter.Background" Value="#626c80" />
<Setter Target="ContentPresenter.CornerRadius" Value="8" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</ContentPresenter>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
<ResourceDictionary Source="Resources/Components/DataTemplates.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>


</Application>
Loading

0 comments on commit a124aca

Please sign in to comment.