Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Mobile | Fix top bar alignment on newer iPhones #1080

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions src/MobileUI/Resources/Styles/Templates.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,28 @@
xmlns:resolver="clr-namespace:Maui.Plugins.PageResolver;assembly=Maui.Plugins.PageResolver"
xmlns:vm="clr-namespace:SSW.Rewards.Mobile.ViewModels">
<ControlTemplate x:Key="PageTemplate">
<Grid RowDefinitions="55,*"
<Grid RowDefinitions="60,*"
Margin="0"
Padding="0"
TranslationY="{OnPlatform iOS=-5, Default=0}">
TranslationY="{OnPlatform iOS=-10, Default=0}">
<Grid.BindingContext>
<resolver:ResolveViewModel x:TypeArguments="vm:TopBarViewModel" />
</Grid.BindingContext>
<Grid ColumnDefinitions="60,*,60"
Margin="0"
<Grid Grid.Row="0"
ColumnDefinitions="60,*,60"
HeightRequest="60"
Padding="10,5"
BackgroundColor="{StaticResource Background}"
VerticalOptions="Start"
x:DataType="vm:TopBarViewModel">
<!-- Wrapping AvatarView in a Grid where IsVisible can be toggled to work around
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this comment be deleted? The linked issue is closed and marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the issue still persists - I think that comment just describes the workaround that was implemented from that PBI.

an odd animation that happens on iOS
See bug: https://github.com/SSWConsulting/SSW.Rewards.Mobile/issues/918 -->
<Grid Grid.Column="0"
IsVisible="{Binding ShowAvatar}"
Margin="10,7,10,5"
HeightRequest="40"
WidthRequest="40">
WidthRequest="40"
VerticalOptions="End">
<mct:AvatarView ImageSource="{Binding ProfilePic}"
HeightRequest="40"
WidthRequest="40"
Expand All @@ -44,12 +47,13 @@
CornerRadius="20"
MinimumHeightRequest="40"
MinimumWidthRequest="40"
BorderWidth="2"
BorderColor="White"
BackgroundColor="{StaticResource SSWRed}"
Margin="10,7,10,5"
Padding="0"
IsVisible="{Binding ShowBack}"
Command="{Binding GoBackCommand}">
Command="{Binding GoBackCommand}"
VerticalOptions="End">
<Button.ImageSource>
<FontImageSource FontFamily="FluentIcons"
Glyph="&#xf189;"
Expand All @@ -68,8 +72,8 @@

<ImageButton Grid.Column="2"
Command="{Binding OpenScannerCommand}"
Margin="10,5"
IsVisible="{Binding ShowScanner}">
IsVisible="{Binding ShowScanner}"
VerticalOptions="End">
<ImageButton.Source>
<FontImageSource FontFamily="FluentIcons"
Glyph="&#xf636;"/>
Expand Down
Loading