Closed azimuthdeveloper closed 5 years ago
I'm currently using this to handle my Images in Forms.
https://github.com/stormlion227/PhotoBrowser.Forms
Not sure if this belong in Essentials honestly...
My 2 cents... I think this PR, is better in Xamarin.Forms. And this is a good one
@pictos I reckon that'd be fairly unlikely. Especially if things like FFImage are still third party to the XF codebase.
@lewcianci one question, in iOS, can we do this without the Ricardo nuget? Because the Xamarin.Essentials don't allow external references.
@pictos We could do that. I'd have to carve out an iOS specific implementation. That's probably a better idea anyway (the existing implementation has allowance for multiple images, something that is not taken advantage of in the current setup). I'll have to see if there are any equivalent native Xamarin packages for iOS for pinch/pan zooming.
But first, wait for the staff responsible for the XE to talk about whether the idea is viable ...
Thanks for the write up and suggestion. One of our guiding principles is not to create or maintain custom user interface with Xamarin.Essentials or take dependencies on additional libraries unless 100% necessary. For user interface this would be better suited for Xamarin.Forms as mentioned earlier.
There's no "native image viewer" for Xamarin Forms, so every time someone wants to pinch and zoom an image on their Xamarin Forms app, they have to rely on XF gestures to achieve this. I've personally never found a perfect solution for this, all available code shudders on zoom, or allows the user to zoom off the image.
When I say "native image viewer" I mean:
As I used to be an Ionic developer I know that they had a native image viewer component that would render images for pinching and zooming on a platform specific basis.
In my mind, this kind of functionality fits the bill for Xamarin.Essentials as viewing images, and pinching and zooming them, is something that I think would be used fairly broadly. I have some code in an application that currently does this, and I'm currently trying to put it into a nuget package (using @jamesmontemagno's template package).
Existing Issues
Shared Code
The interface on the shared code would probably just be as simple as this:
Android implementation
Package references
Platform Specific Code _AndroidPhotoView.cs
_layout/activityimerrsive.xaml
iOS Implementation
Package References
Platform Specific Code
_iOSPhotoViewer.cs
This is my first submission like this, and I'd like to bring this functionality into XF Essentials through a pull request long term so everyone can use it. I have no prior experience in doing this so if this is wrong or wonky in any way, or if my code is garbage, then please forgive me in advance :)