-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 Mobile UI - V3 Profile - Partial Implementation (#661)
* New v3 Intial Layout * Binding to IsStaff and Ranking * Design cleanup * Tweak profile stats control --------- Co-authored-by: Zachary Keeping <[email protected]>
- Loading branch information
1 parent
4ded1de
commit 26000e0
Showing
8 changed files
with
274 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,216 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Grid | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<Border | ||
HeightRequest="270" | ||
Margin="0,10" | ||
BackgroundColor="{StaticResource Background}" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="SSW.Rewards.Mobile.Controls.ProfileStats" | ||
xmlns:controls="clr-namespace:SSW.Rewards.Mobile.Controls"> | ||
|
||
<controls:RewardsProgress | ||
Progress="{Binding Progress}"/> | ||
|
||
<!-- | ||
RewardsPregress is not taken into account when the size of ProfileStats is calculates. | ||
So we need this placeholder. The bottom padding is 80px where 60px is the width of the progress bar | ||
and 20 is the actual padding--> | ||
<Label Margin="0,0,0,280"/> | ||
|
||
<HorizontalStackLayout | ||
Spacing="6" | ||
Padding="0,0,0,0" | ||
Margin="0,0,0,200" | ||
IsVisible="{Binding ShowBalance}" | ||
VerticalOptions="Center" | ||
HorizontalOptions="Center"> | ||
<Label | ||
HorizontalOptions="End" | ||
Text="⭐" | ||
FontSize="Small" | ||
TextColor="{StaticResource primary}" /> | ||
<Label | ||
Text="{Binding Balance, StringFormat='{0:n0}'}" | ||
FontSize="Small" | ||
TextColor="{StaticResource primary}" /> | ||
<Label | ||
HorizontalOptions="End" | ||
Text="⭐" | ||
FontSize="Small" | ||
TextColor="{StaticResource primary}" /> | ||
</HorizontalStackLayout> | ||
|
||
<Label | ||
Margin="0,0,0,140" | ||
TextColor="{StaticResource HeadingColor}" | ||
FontSize="Large" | ||
Text="{Binding Points, StringFormat='{0:n0}'}" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" | ||
HorizontalTextAlignment="Center"/> | ||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" | ||
xmlns:converters="clr-namespace:SSW.Rewards.Mobile.Converters" | ||
x:Class="SSW.Rewards.Mobile.Controls.ProfileStats"> | ||
<Border.Resources> | ||
<toolkit:InvertedBoolConverter x:Key="InvertedBoolConverter" /> | ||
<converters:StaffToTextConverter x:Key="StaffToText" /> | ||
</Border.Resources> | ||
<Border.StrokeShape> | ||
<RoundRectangle CornerRadius="8" /> | ||
</Border.StrokeShape> | ||
<Grid | ||
RowDefinitions="120, 50, *" | ||
RowSpacing="10" | ||
Padding="0,10"> | ||
<VerticalStackLayout Grid.Row="0"> | ||
<toolkit:AvatarView ImageSource="{Binding ProfilePic}" | ||
WidthRequest="120" | ||
HeightRequest="120" | ||
CornerRadius="60" | ||
BorderWidth="2" /> | ||
|
||
<Label | ||
Margin="0,150,0,0" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" | ||
HorizontalTextAlignment="Center" | ||
Text="{Binding Name}" | ||
TextColor="White"/> | ||
<Border | ||
BackgroundColor="{StaticResource primary}" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" | ||
TranslationX="40" | ||
TranslationY="-35" | ||
StrokeShape="Ellipse" | ||
StrokeThickness="0" | ||
IsVisible="{Binding IsMe}"> | ||
<Border.GestureRecognizers> | ||
<TapGestureRecognizer Command="{Binding CameraCommand}" /> | ||
</Border.GestureRecognizers> | ||
<Label | ||
FontFamily="FluentIcons" | ||
FontSize="25" | ||
Text="" | ||
Margin="3" | ||
TextColor="White" /> | ||
</Border> | ||
</VerticalStackLayout> | ||
|
||
<Image | ||
Source="{Binding ProfilePic}" | ||
WidthRequest="100" | ||
HeightRequest="100" | ||
VerticalOptions="Center" | ||
HorizontalOptions="Center" | ||
Aspect="AspectFill"> | ||
<Image.Clip> | ||
<EllipseGeometry | ||
Center="50,50" | ||
RadiusX="50" | ||
RadiusY="50"/> | ||
</Image.Clip> | ||
</Image> | ||
<VerticalStackLayout Grid.Row="1" VerticalOptions="Center"> | ||
<Label | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" | ||
HorizontalTextAlignment="Center" | ||
Text="{Binding Name}" | ||
Style="{StaticResource LabelBold}" | ||
FontSize="Large" | ||
TextColor="White" /> | ||
<Label | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" | ||
HorizontalTextAlignment="Center" | ||
Text="{Binding Path=IsStaff, Converter={StaticResource StaffToText}}" | ||
Style="{StaticResource LabelBold}" | ||
FontSize="Small" | ||
TextColor="White" /> | ||
</VerticalStackLayout> | ||
|
||
<Border | ||
BackgroundColor="{StaticResource primary}" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" | ||
TranslationX="40" | ||
TranslationY="-35" | ||
StrokeShape="Ellipse" | ||
StrokeThickness="0" | ||
IsVisible="{Binding IsMe}"> | ||
<Border.GestureRecognizers> | ||
<TapGestureRecognizer Command="{Binding CameraCommand}"/> | ||
</Border.GestureRecognizers> | ||
<Label | ||
FontFamily="FluentIcons" | ||
FontSize="25" | ||
Text="" | ||
Margin="3" | ||
TextColor="White"/> | ||
</Border> | ||
</Grid> | ||
<!-- User's own stats --> | ||
<Border Grid.Row="2" | ||
IsVisible="{Binding Path=ShowBalance}" | ||
Stroke="{StaticResource ProfileGridBorder}" | ||
StrokeThickness="2" | ||
Margin="20, 0"> | ||
<Border.StrokeShape> | ||
<RoundRectangle CornerRadius="8" /> | ||
</Border.StrokeShape> | ||
<Grid | ||
HorizontalOptions="Center" | ||
BackgroundColor="{StaticResource ProfileGridBorder}" | ||
ColumnSpacing="2"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="100" /> | ||
<ColumnDefinition Width="110" /> | ||
<ColumnDefinition Width="100" /> | ||
</Grid.ColumnDefinitions> | ||
<VerticalStackLayout | ||
Spacing="2" | ||
HorizontalOptions="Fill" | ||
VerticalOptions="Center" | ||
Padding="0, 10" | ||
HeightRequest="70" | ||
BackgroundColor="{StaticResource Background}"> | ||
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center"> | ||
<Label VerticalOptions="Center" | ||
FontFamily="FA6Solid" | ||
TextColor="{StaticResource Coin}" | ||
Text="" /> | ||
<Label FontSize="Large" Style="{StaticResource LabelBold}" Text="{Binding Rank}" /> | ||
</HorizontalStackLayout> | ||
<Label | ||
HorizontalOptions="Center" | ||
Text="Ranking" | ||
FontSize="Small" | ||
TextColor="{StaticResource White}" /> | ||
</VerticalStackLayout> | ||
<VerticalStackLayout Grid.Column="1" | ||
Spacing="2" | ||
HorizontalOptions="Fill" | ||
VerticalOptions="Center" | ||
Padding="0, 10" | ||
HeightRequest="70" | ||
BackgroundColor="{StaticResource Background}"> | ||
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center"> | ||
<Label VerticalOptions="Center" | ||
FontFamily="FA6Solid" | ||
TextColor="{StaticResource Coin}" | ||
Text="⭐" /> | ||
<Label FontSize="Large" Style="{StaticResource LabelBold}" | ||
Text="{Binding Points, StringFormat='{0:n0}'}" /> | ||
</HorizontalStackLayout> | ||
<Label | ||
HorizontalOptions="Center" | ||
Text="Points" | ||
FontSize="Small" | ||
TextColor="{StaticResource White}" /> | ||
</VerticalStackLayout> | ||
<VerticalStackLayout Grid.Column="2" | ||
Spacing="2" | ||
HorizontalOptions="Fill" | ||
VerticalOptions="Center" | ||
Padding="0, 10" | ||
HeightRequest="70" | ||
BackgroundColor="{StaticResource Background}"> | ||
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center"> | ||
<Label VerticalOptions="Center" | ||
VerticalTextAlignment="Center" | ||
FontFamily="FA6Solid" | ||
TextColor="{StaticResource Coin}" | ||
Text="" /> | ||
<Label FontSize="Large" Style="{StaticResource LabelBold}" | ||
Text="{Binding Balance, StringFormat='{0:n0}'}" /> | ||
</HorizontalStackLayout> | ||
<Label | ||
HorizontalTextAlignment="Center" | ||
HorizontalOptions="Center" | ||
Text="Credits" | ||
FontSize="Small" | ||
TextColor="{StaticResource White}" /> | ||
</VerticalStackLayout> | ||
</Grid> | ||
</Border> | ||
|
||
<!-- Viewing other User's stats --> | ||
<Border Grid.Row="2" | ||
IsVisible="{Binding Path=ShowBalance, Converter={StaticResource InvertedBoolConverter}}" | ||
Stroke="{StaticResource ProfileGridBorder}" | ||
StrokeThickness="2" | ||
Margin="20, 0"> | ||
<Border.StrokeShape> | ||
<RoundRectangle CornerRadius="8" /> | ||
</Border.StrokeShape> | ||
<Grid | ||
HorizontalOptions="Center" | ||
BackgroundColor="{StaticResource ProfileGridBorder}" | ||
ColumnSpacing="2"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="150" /> | ||
<ColumnDefinition Width="150" /> | ||
</Grid.ColumnDefinitions> | ||
<VerticalStackLayout Grid.Column="0" | ||
Spacing="2" | ||
HorizontalOptions="Fill" | ||
VerticalOptions="Center" | ||
Padding="0, 10" | ||
HeightRequest="70" | ||
BackgroundColor="{StaticResource Background}"> | ||
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center"> | ||
<Label VerticalOptions="Center" | ||
FontFamily="FA6Solid" | ||
TextColor="{StaticResource Coin}" | ||
Text="" /> | ||
<Label FontSize="Large" Style="{StaticResource LabelBold}" Text="{Binding Path=Rank}" /> | ||
</HorizontalStackLayout> | ||
<Label | ||
HorizontalOptions="Center" | ||
Text="Ranking" | ||
FontSize="Small" | ||
TextColor="{StaticResource White}" /> | ||
</VerticalStackLayout> | ||
<VerticalStackLayout Grid.Column="1" | ||
Spacing="2" | ||
HorizontalOptions="Fill" | ||
VerticalOptions="Center" | ||
Padding="0, 10" | ||
HeightRequest="70" | ||
BackgroundColor="{StaticResource Background}"> | ||
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center"> | ||
<Label VerticalOptions="Center" | ||
FontFamily="FA6Solid" | ||
TextColor="{StaticResource Coin}" | ||
Text="⭐" /> | ||
<Label FontSize="Large" Style="{StaticResource LabelBold}" | ||
Text="{Binding Points, StringFormat='{0:n0}'}" /> | ||
</HorizontalStackLayout> | ||
<Label | ||
HorizontalOptions="Center" | ||
Text="Points" | ||
FontSize="Small" | ||
TextColor="{StaticResource White}" /> | ||
</VerticalStackLayout> | ||
</Grid> | ||
</Border> | ||
</Grid> | ||
</Border> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.