Skip to content

Fix barcode overlay z-order, support runtime navigation bar color changes, and remove SafeAreaEdges.None from CameraPreview containers#876

Merged
Vetle444 merged 1 commit into
mainfrom
vefi/previewFixes
May 27, 2026
Merged

Fix barcode overlay z-order, support runtime navigation bar color changes, and remove SafeAreaEdges.None from CameraPreview containers#876
Vetle444 merged 1 commit into
mainfrom
vefi/previewFixes

Conversation

@Vetle444
Copy link
Copy Markdown
Contributor

Description of Change

Fix barcode scanner overlay z-order and add runtime navigation bar color updates

This PR addresses multiple camera and navigation bar issues:

1. Barcode scan overlay z-order
The BarcodeScanRectangleOverlay was added to the CameraPreview grid after the toolbar containers, causing the dim overlay to render on top of the toolbars. Fixed by inserting the overlay at index 1 (between PreviewView and the toolbar containers).

2. Runtime NavigationPage bar color propagation
NavigationPage.BarBackgroundColorProperty and BarTextColorProperty changes at runtime (e.g., switching from a black camera navbar to a default color after capture) were not propagated to the NavigationPage. Added OnPropertyChanged override in ContentPage that detects these property changes and calls OnNavigationBarColorPropertyChanged() to update the NavigationPage and refresh the status bar.

3. CameraPreview SafeAreaEdges cleanup
Removed explicit SafeAreaEdges.None from internal CameraPreview containers (top/bottom toolbar, grid) so MAUI handles insets.

Playground repro samples added:

  • BarcodeOverlayToolbarRepro — overlay spanning toolbar
  • BarcodeNoNavBarRepro — toolbar squished into status bar when nav bar hidden
  • BarcodeNoNavBarStatusBarRepro — status bar text color when nav bar hidden
  • CameraNavBarColorRepro — navbar color change after photo capture with retake
  • CameraNavBarColorNoNavBarRepro — same as above with hidden nav bar

Copilot AI review requested due to automatic review settings May 27, 2026 11:22
Copy link
Copy Markdown
Contributor

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

This PR improves camera-related UX in the MAUI library by fixing the barcode overlay z-order, ensuring runtime changes to NavigationPage bar colors propagate correctly, and letting MAUI handle safe-area insets for CameraPreview internal containers. It also adds several Playground repro pages for validating the scenarios.

Changes:

  • Fixes barcode scan rectangle overlay rendering above toolbars by inserting the overlay at the correct z-order.
  • Propagates runtime updates to NavigationPage.BarBackgroundColorProperty / BarTextColorProperty from ContentPage to the parent NavigationPage (and refreshes status bar styling).
  • Removes SafeAreaEdges.None from CameraPreview internal toolbar/grid containers so MAUI handles insets; adds multiple Playground repro pages.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/library/DIPS.Mobile.UI/Components/Pages/ContentPage.navigationbar.cs Adds OnNavigationBarColorPropertyChanged() helper to re-apply nav bar colors and refresh status bar styling.
src/library/DIPS.Mobile.UI/Components/Pages/ContentPage.cs Overrides OnPropertyChanged to detect bar color property changes and trigger nav bar/status bar refresh.
src/library/DIPS.Mobile.UI/API/Camera/Preview/CameraPreview.cs Removes SafeAreaEdges.None from internal grids/containers; minor formatting cleanup.
src/library/DIPS.Mobile.UI/API/Camera/BarcodeScanning/BarcodeScanner.cs Inserts scan-rectangle overlay at index 1 so toolbars render above dim overlay.
src/app/Playground/VetleSamples/VetlePage.xaml.cs Wires up navigation to new repro pages from the Vetle Playground page.
src/app/Playground/VetleSamples/VetlePage.xaml Updates UI to list repro samples as NavigationListItems.
src/app/Playground/VetleSamples/CameraNavBarColorRepro.xaml.cs New repro: demonstrates runtime nav bar color change after capture + retake.
src/app/Playground/VetleSamples/CameraNavBarColorRepro.xaml New repro page markup for nav bar color propagation scenario.
src/app/Playground/VetleSamples/CameraNavBarColorNoNavBarRepro.xaml.cs New repro: same scenario with hidden navigation bar.
src/app/Playground/VetleSamples/CameraNavBarColorNoNavBarRepro.xaml New repro page markup (nav bar hidden).
src/app/Playground/VetleSamples/BarcodeOverlayToolbarRepro.xaml.cs New repro: overlay spanning toolbars scenario.
src/app/Playground/VetleSamples/BarcodeOverlayToolbarRepro.xaml New repro page markup for overlay z-order scenario.
src/app/Playground/VetleSamples/BarcodeNoNavBarStatusBarRepro.xaml.cs New repro: status bar text color not updating when nav bar hidden.
src/app/Playground/VetleSamples/BarcodeNoNavBarStatusBarRepro.xaml New repro page markup (nav bar hidden).
src/app/Playground/VetleSamples/BarcodeNoNavBarRepro.xaml.cs New repro: top toolbar overlaps status bar when nav bar hidden.
src/app/Playground/VetleSamples/BarcodeNoNavBarRepro.xaml New repro page markup (nav bar hidden).
CHANGELOG.md Adds 60.0.2 entry describing the user-facing fixes.

Comment thread src/app/Playground/VetleSamples/VetlePage.xaml.cs
Comment thread src/library/DIPS.Mobile.UI/Components/Pages/ContentPage.cs
@Vetle444 Vetle444 merged commit a32fea1 into main May 27, 2026
2 checks passed
@Vetle444 Vetle444 deleted the vefi/previewFixes branch May 27, 2026 13:03
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.

3 participants