From 0ac72a16f994bc53bda92181549e293d5159931a Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Wed, 13 Dec 2023 17:03:18 +0200 Subject: [PATCH] Add animated GIF support for Image --- THIRD-PARTY-NOTICES.TXT | 28 +++ .../Pages/Controls/ImageButtonPage.xaml | 9 + .../Pages/Controls/ImageButtonPage.xaml.cs | 6 + .../Pages/Controls/ImagePage.xaml | 13 ++ .../Pages/Controls/ImagePage.xaml.cs | 11 + .../src/Handlers/Image/ImageHandler.iOS.cs | 21 +- .../ImageButton/ImageButtonHandler.iOS.cs | 3 + .../FileImageSourceService.iOS.cs | 7 +- .../StreamImageSourceService.iOS.cs | 18 +- .../UriImageSourceService.iOS.cs | 85 ++++--- .../ImageSources/iOS/ImageAnimationHelper.cs | 214 ++++++++++++++++++ .../ImageSources/iOS/ImageSourceExtensions.cs | 114 +++++++++- .../src/Platform/iOS/ImageViewExtensions.cs | 7 +- .../Handlers/Image/ImageHandlerTests.cs | 4 +- .../Handlers/Image/ImageHandlerTests.iOS.cs | 84 +++++++ .../ImageButtonHandlerTests.iOS.cs | 5 + .../DeviceTests/Resources/Images/numbers.gif | Bin 0 -> 74557 bytes 17 files changed, 569 insertions(+), 60 deletions(-) create mode 100644 src/Core/src/ImageSources/iOS/ImageAnimationHelper.cs create mode 100644 src/Core/tests/DeviceTests/Resources/Images/numbers.gif diff --git a/THIRD-PARTY-NOTICES.TXT b/THIRD-PARTY-NOTICES.TXT index 58bb1b5a09e9..b93840c3b5c2 100644 --- a/THIRD-PARTY-NOTICES.TXT +++ b/THIRD-PARTY-NOTICES.TXT @@ -493,3 +493,31 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========================================= + + +License notice for FFImageLoading +========================================= + +(https://github.com/luberda-molinet/FFImageLoading/blob/master/LICENSE.md) + +The MIT License (MIT) + +Copyright (c) 2015 Daniel Luberda & Fabien Molinet + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/ImageButtonPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Controls/ImageButtonPage.xaml index 025c4bc65450..d373c63cb9f9 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Controls/ImageButtonPage.xaml +++ b/src/Controls/samples/Controls.Sample/Pages/Controls/ImageButtonPage.xaml @@ -155,6 +155,15 @@ Minimum="0" Maximum="60" Value =" 10"/> +