Add CameraView#1758
Conversation
|
@dotnet-policy-service agree |
bijington
left a comment
There was a problem hiding this comment.
@zhitaop thank you so much for this PR! I have added my initial comments and most I don't think require much effort if they do need to be changed.
I plan to try and test some bits later this week. I would also love to look at possible macOS support which I am happy to contribute, I wouldn't let this hold up the PR completing though, worst case I can always open a follow up PR to add that in.
|
I added the Analyzers for the initialization code for you! |
* Add exception handling when AvailableCameras is empty * Use expression body * Remove nullable in CameraInfo
|
@zhitaop Thanks for the responses. Sorry things have been chaotic here so I haven't responded or reviewed yet. I'll try and take a look this week |
|
Thanks @pictos - great review! I've incorporated your comments here: 0f85de2
This should ensure devs are able to catch the |
TheCodeTraveler
left a comment
There was a problem hiding this comment.
Ok gang! I think this is ready to merge. 🚀
That being said, Pedro brought up some good comments in his review that we should discuss first! Let's chat about it in tomorrow's standup to get a group consensus before we click merge 🙌
|
@brminnick @bijington Thanks for all the great work! There has been definitely great progress and the code looks much more organized and consistent to the rest of the toolkit now.
I haven't got the chance to look into these issues myself, so just leave them here as discussion points before the merge! |
…to Sample App `ICameraProvder` is public and can be accessed via Dependency Injection (or IPlatformApplication.Current.Services.GetRequiredService<ICameraProvider>()
TheCodeTraveler
left a comment
There was a problem hiding this comment.
I think we're good to go! Thanks @zhitaop!!!
FYI - We discussed your latest review in our standup on Thursday. Here's a quick rundown:
- Due to the access level of CameraProvider , there is no way to access the AvaiableCameras other than CameraView.GetAvailableCameras.
The interface ICameraProvider is public and we add it to the IServiceCollection; it can be accessed by developers using Dependency Injection or IPlatformApplication.Current.Services.GetRequiredService<ICameraProvider>(). I've added an example of this to the Sample App in CameraViewViewModel.
The camera switcher and some of the original debug text (camera name, zoom level, etc) are missing on the sample camera view page
Yea, that was me being a bit lazy. I removed it because the AvailableCameras requires async code and after refactoring its async implementation, the value was null when the page first displayed. You're totally welcome to re-add it in a future PR, though! I was just being a bit lazy removing it and not re-implementing the UI with the async implementation, wanting to not delay this PR any further.
UpdateCameraInfo in CameraManage.Windows.cs is not needed anymore, since now CameraInfo is fully initialized in CameraProvider.Windows.cs and does not need to be updated.
Removed ✅
Description of Change
As described in #259 (comment), this PR adds the initial implementation of the CameraView proposal on MacCatalyst, Windows, Android and iOS, and a corresponding demo page in the sample app . It's based on the fantastic work from the following PR/ branch #1080 and #1387.
Below is the summary of the proposed API design, it has been updated with feedback from #259 (comment)
Linked Issues