Gif Animation Support (#7330)
authorShane Neuville <shneuvil@microsoft.com>
Thu, 21 Nov 2019 05:52:52 +0000 (22:52 -0700)
committerGitHub <noreply@github.com>
Thu, 21 Nov 2019 05:52:52 +0000 (22:52 -0700)
commitd012853bd28e1cdda1e73e035feb0c5315c58250
tree81bc9f6ff5504d700d9a485c88b2e7ed83c43ba4
parentf9e503ff966dbca4701fbef327d106efb4ad68f1
Gif Animation Support (#7330)

* Add image animation API.

* Add animated image tests.

* Add animated image UWP implementation.

* Add animated image IOS implementation.

* Add animated image Android implementation.

Also include GIF image parser base class + android parser sub class.

* Add animation finished playing event to Android/IOS for image.

* Add fallback when loading none GIF as animation image.

* Adding a couple of additional tests for animated images.

* Adjusting image animation support based on PR feedback.

* Add support to reload as animated image on StartAnimation call.

* Add UITest and activity indicator when loading from source for Issue1704.

* Reduce number of temporary bitmaps when scaling.

* Implemented review feedback.

* Animation problems related to Android API level 19 and earlier
due to a couple of bugs and changed behavior in AnimationDrawable class.
Implemented a couple of fixes and workaround related to these bugs, fixing
the animation issues on devices before Android Lollipop.

* Moved a couple of methods implemented in FormsAnimationDrawable into an
interface that is used to hide implementation details. Enables possibility
to factor different implementations of animation support going forward.

* Fixed review feedback and comments.

* Notify IOS to redraw control when changing animation layer.

* - android rebase fixes

* - first set of iOS changes for gifs

* - uwp Gif changes

* - clean up android gif code and enable gif for ImageButtons

* - cleanup iOS gif implementation

* - fix imagebutton and other sources

* - add imagebutton to tests

* - getting rid of start/stop and just using IsAnimationPlaying

* - image button

* - adding animation handler for android

* - replace gifs

* - fix rebase issues

* Added gif samples in Core Gallery

* Updated gif Core Gallery sample

* Fixed UWP gif samples path

* - remove auto play
- fix uwp so it plays correctly on load

* Added support to Url gifs on Android

* - fix rebase

* - fix NRE and iOS repeat

* - fix android loop counter

* - fix animation stopped on ios

* - fix removed ImageHandler interface Android

* - add top margin so ui tests can click button
45 files changed:
Xamarin.Forms.ControlGallery.Android/Resources/drawable/GifOne.gif [new file with mode: 0644]
Xamarin.Forms.ControlGallery.Android/Resources/drawable/GifTwo.gif [new file with mode: 0644]
Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj
Xamarin.Forms.ControlGallery.WindowsUniversal/GifOne.gif [new file with mode: 0644]
Xamarin.Forms.ControlGallery.WindowsUniversal/GifTwo.gif [new file with mode: 0644]
Xamarin.Forms.ControlGallery.WindowsUniversal/Xamarin.Forms.ControlGallery.WindowsUniversal.csproj
Xamarin.Forms.ControlGallery.iOS/GifOne.gif [new file with mode: 0644]
Xamarin.Forms.ControlGallery.iOS/GifTwo.gif [new file with mode: 0644]
Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1704.cs [new file with mode: 0644]
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
Xamarin.Forms.Controls/CoreGallery.cs
Xamarin.Forms.Controls/CoreGalleryPages/ImageButtonCoreGalleryPage.cs
Xamarin.Forms.Controls/GalleryPages/ButtonGallery.cs
Xamarin.Forms.Controls/GalleryPages/GifGallery.cs [new file with mode: 0644]
Xamarin.Forms.Controls/GalleryPages/ImageGallery.cs
Xamarin.Forms.Core/Button.cs
Xamarin.Forms.Core/IImageController.cs
Xamarin.Forms.Core/IImageElement.cs
Xamarin.Forms.Core/Image.cs
Xamarin.Forms.Core/ImageButton.cs
Xamarin.Forms.Core/ImageElement.cs
Xamarin.Forms.Core/Internals/ImageParser.cs [new file with mode: 0644]
Xamarin.Forms.Platform.Android/AppCompat/ImageButtonRenderer.cs
Xamarin.Forms.Platform.Android/Extensions/ImageViewExtensions.cs
Xamarin.Forms.Platform.Android/FastRenderers/ImageElementManager.cs
Xamarin.Forms.Platform.Android/FastRenderers/ImageRenderer.cs
Xamarin.Forms.Platform.Android/Renderers/AndroidGIFImageParser.cs [new file with mode: 0644]
Xamarin.Forms.Platform.Android/Renderers/FileImageSourceHandler.cs
Xamarin.Forms.Platform.Android/Renderers/FormsImageView.cs
Xamarin.Forms.Platform.Android/Renderers/IAnimationSourceHandler.cs [new file with mode: 0644]
Xamarin.Forms.Platform.Android/Renderers/ImageLoaderSourceHandler.cs
Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs
Xamarin.Forms.Platform.Android/Renderers/StreamImagesourceHandler.cs
Xamarin.Forms.Platform.Android/Xamarin.Forms.Platform.Android.csproj
Xamarin.Forms.Platform.UAP/ImageButtonRenderer.cs
Xamarin.Forms.Platform.UAP/ImageElementManager.cs
Xamarin.Forms.Platform.UAP/ImageRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/FormsCAKeyFrameAnimation.cs [new file with mode: 0644]
Xamarin.Forms.Platform.iOS/Renderers/FormsUIImageView.cs [new file with mode: 0644]
Xamarin.Forms.Platform.iOS/Renderers/ImageAnimationHelper.cs [new file with mode: 0644]
Xamarin.Forms.Platform.iOS/Renderers/ImageButtonRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/ImageElementManager.cs
Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
Xamarin.Forms.Platform.iOS/Xamarin.Forms.Platform.iOS.csproj