Skip to content

chore: migrate ZXing library and update target framework#761

Closed
rgunawans wants to merge 36 commits into
dotnet:mainfrom
rgunawans:main
Closed

chore: migrate ZXing library and update target framework#761
rgunawans wants to merge 36 commits into
dotnet:mainfrom
rgunawans:main

Conversation

@rgunawans
Copy link
Copy Markdown
Contributor

chore: migrate ZXing library and update target framework, compress image, improvement flyout menu

Replace Redth.ZXing.Net.Maui with ZXing.Net.Maui (deprecated)
Enable CAMERA permission in AndroidManifest.xml
Update PointOfSales.API project target framework from .NET 7 to .NET 10
Comparess Images
Improvement flyoutmenu

rgunawans and others added 12 commits April 17, 2026 17:21
…d change target on PointOfsales.API projet from .net 7 to .net 10
…able CAMERA permission in Android Manifest, and change target on PointOfsales.API projet from .net 7 to .net 10
- Removed unused ShowMessage method from MobileLoginViewModel
- Stopped auto-closing modal after scan in ScanPage
- Updated MAUI package versions to use $(MauiVersion) property
- Minor formatting fix in AppShellMobile.xaml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…inViewModel.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* compressed image
* improvement flyout menu in appshell.xaml, sometime it shows text instead of icon
* replace DisplayAlert with DisplayAlertySync
Copilot AI review requested due to automatic review settings April 19, 2026 01:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Migrates the MAUI barcode scanning library to ZXing.Net.Maui, updates dependencies/target frameworks, and tweaks UI/permissions to support scanning and an improved flyout experience.

Changes:

  • Replace Redth.ZXing.Net.Maui with ZXing.Net.Maui + add Android CAMERA permission and runtime permission request flow.
  • Update NuGet packages (MAUI app) and move the API project from .NET 7 to .NET 10 with corresponding package updates.
  • Flyout menu adjustments (width/layout) and some icon/source updates.

Reviewed changes

Copilot reviewed 12 out of 36 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
10.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj Updates package references and switches ZXing packages.
10.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml Adds CAMERA permission and adjusts application manifest attributes.
10.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs Changes alert call to DisplayAlertAsync.
10.0/Apps/PointOfSale/src/PointOfSale/Pages/SettingsViewModel.cs Changes alert call to DisplayAlertAsync.
10.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ScanPage.xaml.cs Adds camera permission checks and more robust scanning/navigation handling.
10.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs Changes confirmation alert call to DisplayAlertAsync.
10.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersPage.xaml Switches toolbar icons from PNG to SVG.
10.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/MobileLoginViewModel.cs Runs alert on UI thread and switches to DisplayAlertAsync.
10.0/Apps/PointOfSale/src/PointOfSale/Pages/DashboardViewModel.cs Changes alert call to DisplayAlertAsync.
10.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs Adds ZXing.Net.Maui.Controls using.
10.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml Flyout layout changes + adds FlyoutIcon on shell content.
10.0/Apps/PointOfSale/src/PointOfSale.API/PointOfSale.API.csproj Updates API target framework to net10.0 and bumps related packages.

async Task PlaceOrder()
{
await App.Current.Windows[0].Page.DisplayAlert("Not Implemented", "Wouldn't it be cool tho?", "Okay");
await App.Current.Windows[0].Page.DisplayAlertAsync ("Not Implemented", "Wouldn't it be cool tho?", "Okay");
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

Page.DisplayAlert(...) is already asynchronous in .NET MAUI (returns a Task / Task<bool>), and DisplayAlertAsync is not part of the standard MAUI Page API. Unless the project defines an extension method named DisplayAlertAsync, this will fail to compile. Consider reverting to DisplayAlert(...) (and keep awaiting it) or update the call site to match the actual API you intended to use.

Suggested change
await App.Current.Windows[0].Page.DisplayAlertAsync ("Not Implemented", "Wouldn't it be cool tho?", "Okay");
await App.Current.Windows[0].Page.DisplayAlert("Not Implemented", "Wouldn't it be cool tho?", "Okay");

Copilot uses AI. Check for mistakes.
public async Task LogOut()
{
var result = await App.Current.Windows[0].Page.DisplayAlert("", "Do you want to logout?", "Yes", "Ooops, no");
var result = await App.Current.Windows[0].Page.DisplayAlertAsync ("", "Do you want to logout?", "Yes", "Ooops, no");
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

Same issue as elsewhere: MAUI’s DisplayAlert is the async API; DisplayAlertAsync is not a standard Page member. This is likely a compile break unless an extension method exists. Prefer DisplayAlert("", "...", "Yes", "...") and await it.

Suggested change
var result = await App.Current.Windows[0].Page.DisplayAlertAsync ("", "Do you want to logout?", "Yes", "Ooops, no");
var result = await App.Current.Windows[0].Page.DisplayAlert("", "Do you want to logout?", "Yes", "Ooops, no");

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +48
barcodeView.Options = new BarcodeReaderOptions
{
Formats = BarcodeFormats.All,
AutoRotate = true,
Multiple = true
};
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

With Multiple = true, BarcodesDetected can fire repeatedly and rapidly, and the current handler navigates (GoToAsync("..")) on the first result each time. This can cause duplicate navigations/races (and navigation exceptions) in real use. A concrete mitigation is to disable detection and/or gate navigation after the first successful scan (e.g., set Multiple = false, or set a private _isNavigating flag and return early on subsequent detections, and/or stop the camera/detection before calling GoToAsync).

Copilot uses AI. Check for mistakes.
Comment on lines +151 to +154
<ShellContent ContentTemplate="{DataTemplate pages:DashboardPage}" FlyoutIcon="dashboard.png"/>
</FlyoutItem>
<FlyoutItem Title="Settings" Route="settings">
<ShellContent ContentTemplate="{DataTemplate pages:SettingsPage}"/>
<FlyoutItem Title="Settings" Route="settings" >
<ShellContent ContentTemplate="{DataTemplate pages:SettingsPage}" FlyoutIcon="settings.png"/>
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

These FlyoutIcon file names don’t match the image names used elsewhere in the same file (graph.png, setting.png, etc.). If dashboard.png / settings.png aren’t present in the app resources, the flyout icons will be missing at runtime. Use the actual resource names (or rename the assets consistently) so the flyout icons resolve correctly.

Copilot uses AI. Check for mistakes.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.dot.pointofsale" android:versionCode="1" android:versionName="1.0.0">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:label="Food">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true" android:label="Food">
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

The manifest change removes android:roundIcon. If the project still provides a round icon resource (@mipmap/appicon_round), dropping roundIcon can cause inconsistent launcher icon rendering on some devices/launchers. Consider keeping android:roundIcon="@mipmap/appicon_round" if that resource still exists.

Suggested change
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true" android:label="Food">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:label="Food">

Copilot uses AI. Check for mistakes.
* compressed image
* improvement flyout menu in appshell.xaml, sometime it shows text instead of icon
* replace DisplayAlert with DisplayAlertySync
* Replace TranslateTo with TranslateToAsync
* Replace  FadeTo with FadeToAsync
Updated the GitHub Actions workflow to include a build step for Windows and removed redundant steps for Android and macOS builds.
Added a step to restore dependencies before building the Windows project.
Refactored build-pr.yml for concise steps and added a Windows build job. Added Microsoft.Maui.Controls.Compatibility to PointOfSale.csproj and downgraded Microsoft.Maui.Controls and WebView.Maui to 10.0.41. Updated global.json to use .NET SDK 10.0.202 with latestPatch rollForward.
Updated GitHub Actions workflow to simplify and clarify build steps for macOS and Windows jobs. Now both jobs install the .NET 10 SDK and MAUI workload before building the Android target. Removed redundant steps and consolidated tasks for improved efficiency.
Refactored build-pr.yml to introduce separate jobs for macOS and Windows alongside Android. Each job now sets up .NET 10, installs the MAUI workload, and builds the PointOfSale project for its respective platform. This replaces the previous single Android build with platform-specific, granular steps.
Removed the macOS build job from build-pr.yml and added a Windows build job. The new job sets up .NET 10.0.x, installs the MAUI workload, restores dependencies, and builds the project for the Windows target framework.
Updated .NET version to 10.0 and added MAUI workload installation for Android, Windows, and macOS builds.
@rgunawans rgunawans closed this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants