diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/ImageUITests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/ImageUITests.cs index 940c821c5b9d..b650389f6f22 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/ImageUITests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/ImageUITests.cs @@ -36,4 +36,15 @@ public void Source_FontImageSource() remote.TapStateButton(); VerifyScreenshot("ImageUITests_Source_FontImageSource_FontAwesome"); } + + [Test] + public async void IsAnimationPlaying() + { + var remote = GoToStateRemote(); + await Task.Delay(500); // make sure the gif is NOT playing + VerifyScreenshot("ImageUITests_IsAnimationPlaying_No"); + + remote.TapStateButton(); + VerifyScreenshot("ImageUITests_IsAnimationPlaying_Yes"); + } } diff --git a/src/Core/src/Platform/Android/ImageViewExtensions.cs b/src/Core/src/Platform/Android/ImageViewExtensions.cs index 80c69d6c5c54..024697b32854 100644 --- a/src/Core/src/Platform/Android/ImageViewExtensions.cs +++ b/src/Core/src/Platform/Android/ImageViewExtensions.cs @@ -30,7 +30,11 @@ public static void UpdateIsAnimationPlaying(this ImageView imageView, IImageSour public static void UpdateIsAnimationPlaying(this Drawable? drawable, IImageSourcePart image) { - var animatable = drawable.TryJavaCast(); + // Testing the tests... + var animatable = drawable as IAnimatable; + + // But this is what I will do: + // var animatable = drawable.TryJavaCast(); if (animatable is not null) { if (image.IsAnimationPlaying)