xamarin / XamarinCommunityToolkit

The Xamarin Community Toolkit is a collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. It simplifies and demonstrates common developer tasks building iOS, Android, and UWP apps with Xamarin.Forms.
MIT License
1.58k stars 471 forks source link

CameraView fix rotating on Android #1961

Closed MFinkBK closed 7 months ago

MFinkBK commented 1 year ago

Description of Bug

On Android, the camera activity is correctly rotated, but the resulting image isn't rotated according to the current device orientation. Instead the rotation angle is passed to the event RaiseMediaCaptured. The PR takes the changes from @jfversluis from PR #1871, which already does the image rotation, and passes rotation angle 0 to RaiseMediaCaptured in order to be compatible with potentially existing rotation code on user's side.

Note that this change targets the droid-cameraview-rotation branch that @jfversluis already has done the main work, per PR #1871.

Issues Fixed

Behavioral Changes

There should be no changes, since the photo now has been rotated already and the new rotation angle 0 is passed to the user.

PR Checklist

bijington commented 1 year ago

I will defer to @jfversluis on this as I am not sure I fully understand the implications of not providing the rotation in this way

MFinkBK commented 1 year ago

@jfversluis I just fixed a bug where OnPhoto() was never called in cases where the rotation angle was 0. The changes in these PR are already live in a production app that is using our forked repo. I would be glad if this fix could go into the official repository, too. Thanks!

jfversluis commented 7 months ago

Now that we're so close to the sunsetting of Xamarin (and therefore also Xamarin Community Toolkit) unfortunately we won't be able to take this in anymore, we're really sorry about that. Nevertheless, thank you so much for your time and effort that you have put into this PR, we really appreciate it.

Please have a look at the evolution of the Xamarin Community Toolkit, The .NET MAUI Community Toolkit. A lot of development has been going on there. Hopefully this issue was already fixed in that codebase. If not, feel free to port this over to there.

Again, thank you so much for being a contributor and Xamarin user!