Added new multicapture camera UI#893
Open
VegardHV wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the ImageCapture multi-capture experience by adding an in-camera “latest capture” thumbnail (tap-to-open gallery) with support for reviewing/removing captured images during the session, and introduces guardrails to bound in-memory image accumulation. It also fixes Gallery behavior where the visible image could jump back to the first item when the underlying collection changes.
Changes:
- Add multi-capture in-camera thumbnail + overlay gallery (review/remove), plus
MaxImageCount(default 15) andOnImageRemovedcallback support. - Refactor streaming-state bottom toolbar to support configurable leading/trailing controls (flash/finish) and shared “rotate with device orientation” behavior; add native thumbnail blurring while a capture is in flight.
- Update
Gallerycarousel behavior to keep scroll offset when items change and reduce initial “index 0” flash.
Reviewed changes
Copilot reviewed 29 out of 32 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| CHANGELOG.md | Adds a 60.3.0 entry describing the new multi-capture UI, MaxImageCount, and the gallery fix. |
| src/app/Components/ComponentsSamples/ImageCapturing/MultiImageCaptureModalPage.xaml.cs | Updates sample to use MaxImageCount/OnImageRemoved and avoids starting capture multiple times. |
| src/library/DIPS.Mobile.UI/API/Camera/Gallery/BottomSheet/BottomToolbar/GalleryBottomSheetBottomToolbar.cs | Whitespace cleanup. |
| src/library/DIPS.Mobile.UI/API/Camera/Gallery/BottomSheet/GalleryBottomSheet.cs | Minor whitespace cleanup in handler change logic. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Android/ImageCapture.cs | Uses “ignore remaining callbacks” pattern and routes failures through shared failure handling. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Android/ImageCaptureCallback.cs | Adds JNI constructor and “ignore remaining callbacks” to avoid disposal-related crashes. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/ImageCapture.CapturedImagesGallery.cs | Implements multi-capture captured-images gallery lifecycle, remove handling, and max-limit messaging. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/ImageCapture.ConfirmState.cs | Ensures accepted images are added to multi-capture list before returning to streaming. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/ImageCapture.StreamingState.cs | Enforces image limit before capturing; wires new streaming toolbar controls. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/ImageCapture.cs | Adds session reentrancy guard (m_isCapturing), optimistic gallery updates, unified stop logic, and failure rollback. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/OnCapturedImageRemoved.cs | Adds new public delegate for “image removed” callback. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Settings/CameraOptions.cs | Adds MaxImageCount (default 15) and OnImageRemoved to MultiImageCaptureOptions. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/ImageCaptureBottomToolbarView.cs | Extends streaming-state API to accept leading/trailing controls. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/StreamingState/Android/CapturedImagesGalleryButton.cs | Android native thumbnail blur animation support. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/StreamingState/CapturedImagesGalleryButton.cs | New multi-capture thumbnail control (tap-to-open gallery) with count badge and blur hooks. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/StreamingState/FlashButton.cs | Extracts flash toggle into a reusable button control. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/StreamingState/StreamingStateView.cs | Refactors streaming view to render configurable leading/trailing controls (flash/finish). |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/StreamingState/StreamingTrailingControl.cs | Introduces trailing-control model (flash vs finish capture). |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/StreamingState/dotnet/CapturedImagesGalleryButton.cs | Adds net10.0 stub for partial thumbnail blur behavior. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/StreamingState/iOS/CapturedImagesGalleryButton.cs | iOS native thumbnail blur overlay implementation. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/BottomToolbar/StreamingState/iOS/CoreImageFilterExtensions.cs | Adds CoreImage filter helpers for edge clamp + gaussian blur. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/CameraZoom/ZoomButtons.cs | Switches zoom button rotation handling to shared rotate-on-orientation extension. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/CameraZoom/ZoomSlider.cs | Switches zoom label rotation handling to shared rotate-on-orientation extension. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/CapturedImagesGalleryOverlay.cs | New full-screen overlay hosting Gallery + remove/done controls + empty state. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/RotateWithDeviceOrientation.cs | Adds shared extension to rotate views with DUI.OrientationChanged and auto-unsubscribe. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/Views/TopToolbar/ImageCaptureTopToolbarView.cs | Removes top-toolbar finish button and adjusts streaming-state controls for multi-capture. |
| src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/iOS/ImageCapture.cs | Avoids disposing delegates mid-callback; adds safer settings creation and consistent failure routing. |
| src/library/DIPS.Mobile.UI/API/Camera/Preview/CameraPreview.cs | Adds ShowPreview() counterpart to HidePreview(). |
| src/library/DIPS.Mobile.UI/Components/Gallery/Gallery.cs | Prevents carousel from resetting to first item on collection updates; adds initial-load hide/fade behavior. |
| src/library/DIPS.Mobile.UI/Resources/LocalizedStrings/LocalizedStrings/DUILocalizedStrings.Designer.cs | Regenerates strongly-typed accessors for new localized strings. |
| src/library/DIPS.Mobile.UI/Resources/LocalizedStrings/LocalizedStrings/DUILocalizedStrings.en.resx | Adds English strings for OK/max-images/empty-state/accessibility label. |
| src/library/DIPS.Mobile.UI/Resources/LocalizedStrings/LocalizedStrings/DUILocalizedStrings.resx | Adds Norwegian strings for OK/max-images/empty-state/accessibility label. |
Files not reviewed (1)
- src/library/DIPS.Mobile.UI/Resources/LocalizedStrings/LocalizedStrings/DUILocalizedStrings.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)
src/library/DIPS.Mobile.UI/API/Camera/ImageCapturing/ImageCapture.cs:90
m_isCapturingis set totruebefore several awaited calls (HasLoaded,PlatformStart,GoToStreamingState). If any of these throw,m_isCapturingis never reset, and future starts will always throwInvalidOperationExceptioneven though no session is running.
if (await CameraPermissions.CanUseCamera())
{
m_isCapturing = true;
Log("Permitted to use camera");
await m_cameraPreview.HasLoaded();
ConstructCrossPlatformViews();
await PlatformStart(m_cameraSession.CameraOptions, m_cameraFailedDelegate);
GoToStreamingState();
}
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Todos