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 back icon being stuck #974

Merged
merged 3 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/MobileUI/Features/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Title="SSW.Rewards"
FlyoutBackgroundColor="{StaticResource FlyoutBackgroundColour}"
Shell.NavBarIsVisible="False"
Navigating="OnNavigating"
MenuItemTemplate="{StaticResource SSWMenuTemplate}"
x:Name="RewardsShell">

Expand Down
7 changes: 7 additions & 0 deletions src/MobileUI/Features/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Diagnostics;
using CommunityToolkit.Mvvm.Messaging;
using SSW.Rewards.Mobile.Messages;

namespace SSW.Rewards.Mobile;

Expand Down Expand Up @@ -35,4 +37,9 @@ protected override bool OnBackButtonPressed()
Process.GetCurrentProcess().CloseMainWindow();
return true;
}

private void OnNavigating(object sender, ShellNavigatingEventArgs e)
{
WeakReferenceMessenger.Default.Send(new TopBarAvatarMessage(AvatarOptions.Original));
}
}
8 changes: 7 additions & 1 deletion src/MobileUI/Features/Scanner/ScanPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void ToggleScanner(bool toggleOn)
}
}

private async void SetCameraZoom()
private static async void SetCameraZoom()
{
#if IOS15_0_OR_GREATER
// Delay is required to ensure the camera is ready
Expand All @@ -93,6 +93,12 @@ private async void SetCameraZoom()
// iPhone 13 Pro (~15cm focus distance): ~1.5
// iPhone 12 and below: 1.0 - ~1.2
var captureDevice = AVFoundation.AVCaptureDevice.GetDefaultDevice(AVFoundation.AVMediaTypes.Video);

if (captureDevice == null)
{
return;
}

var focusDistance = captureDevice.MinimumFocusDistance.ToInt32();
var deviceFieldOfView = captureDevice.ActiveFormat.VideoFieldOfView;
const float previewFillPercentage = 0.6f; // fill 60% of preview window
Expand Down
Loading