SkiaSharp.Extended icon indicating copy to clipboard operation
SkiaSharp.Extended copied to clipboard

[BUG] Animation not playing when inherit from SKLottieView

Open naaeef opened this issue 1 year ago • 2 comments

Description

If I inherit from SKLottieView and use this class for showing an animation, the animation is not running / visible. We want to use inheritance to make some customization.

Code

I'm using inheritance like this. If I use CustomSKLottieView, it does not show the animation (see reproduction sample).


public class CustomSKLottieView : SKLottieView
    {
        
    }

Expected Behavior Animations also work when using inheritance.

Actual Behavior

Animation are not working when using inheritance.

Basic Information

  • Version with issue: 2.0.0-preview.61
  • IDE: Rider
  • Platform: Android and iOS
  • Target Devices: iOS simulator / Android emulator

Screenshots

image (App should show the animation twice, at the top SKLottieView is used, at the bottom a inherited class is used)

Reproduction Link LottieReproduction.zip

naaeef avatar Aug 15 '23 09:08 naaeef

@mattleibow we have the same problem, would be nice to take a look

PavloLukianets avatar Nov 07 '23 20:11 PavloLukianets

Workaround: add ApplyToDerivedTypes="True" here: https://github.com/mono/SkiaSharp.Extended/blob/main/source/SkiaSharp.Extended.UI.Maui/Controls/Lottie/SKLottieViewResources.shared.xaml

PavloLukianets avatar Nov 07 '23 20:11 PavloLukianets