Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lottie animation don't show on first load #1

Closed
georgeemr opened this issue Apr 4, 2024 · 8 comments
Closed

Lottie animation don't show on first load #1

georgeemr opened this issue Apr 4, 2024 · 8 comments

Comments

@georgeemr
Copy link

georgeemr commented Apr 4, 2024

I'm using the SkiaSharp.Extended.UI.Controls to show a Lottie animation. On the first load, the Lottie doesn't show. But if you close and reopen, the animation shows successfully.

https://www.nuget.org/packages/SkiaSharp.Extended.UI.Maui

Note: The maui community toolkit popup works on the first call.

<?xml version="1.0" encoding="utf-8" ?>
<popup:PopupPage x:Class="DemoApp.Views.PopUps.LoadingMopup"
                 xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:popup="clr-namespace:MPowerKit.Popups;assembly=MPowerKit.Popups"
                 xmlns:skia="clr-namespace:SkiaSharp.Extended.UI.Controls;assembly=SkiaSharp.Extended.UI"
                 Title="PopupTestPage"
                 BackgroundInputTransparent="False"
                 BackgroundColor="#80000000"
                 CloseOnBackgroundClick="True">
    <Frame BackgroundColor="WhiteSmoke"
           VerticalOptions="CenterAndExpand"
           WidthRequest="200">
        <VerticalStackLayout HorizontalOptions="Center"
                             VerticalOptions="Center">           
            <skia:SKLottieView RepeatCount="-1"
                               RepeatMode="Reverse"
                               Source="AnimationBunny.json"
                               WidthRequest="150"
                               HeightRequest="150" />
            <Label HorizontalOptions="Center"
                   x:Name="lblMessage"
                   VerticalOptions="Center"
                   HorizontalTextAlignment="Center"></Label>
        </VerticalStackLayout>
    </Frame>
</popup:PopupPage>
@georgeemr georgeemr changed the title Lottie animation dont show on first load Lottie animation don't show on first load Apr 4, 2024
@Alex-Dobrynin
Copy link
Contributor

Sorry for so late response. Lost notification about this issue.

May I ask you to provide repro project and indicate the OS in which you experiencing this issue

@georgeemr
Copy link
Author

Sure, this is the repo:

https://1drv.ms/u/s!AlTIxW_ExT1enfJaJq2TRvReR-oLrw?e=Zkb9hq

I'm running on Android 14

@Alex-Dobrynin
Copy link
Contributor

Alex-Dobrynin commented Apr 19, 2024

I've found that you opened similar issue on SkiaSharp extended github
mono/SkiaSharp.Extended#264
and there you are using community toolkit popup, and you wrote there that it does not work. so i have question, does animation work in community toolkit popup or no?

Seems, that this is SkiaSharp.Extended.Maui bug. I will open an issue on their github

@georgeemr
Copy link
Author

georgeemr commented Apr 21, 2024

[Edit]

Hi Alex, that issue is different because the on that issue the problem is that the Lottie doesn't render as expected, but it opens on the first show on the community toolkit.
The issue with ---[Mopup] (Not Mopup, was a confusion)--- MPowerKit is that the Lottie doesn't show at all on the first show.
I also realized that if you change a label text on the first show (on the constructor), neither change either.

@Alex-Dobrynin
Copy link
Contributor

Alex-Dobrynin commented Apr 21, 2024

This is not Mopups library. Btw, did you try with mopups library, is there the same behavior?

@georgeemr
Copy link
Author

Sorry for the confusion Alex! You are right; indeed I'm using your library, not mopups. After all the research my decision was to use this lib.
I will try with mopups and let you know.

@Alex-Dobrynin
Copy link
Contributor

fixed in 1.1.5 nuget version

@Alex-Dobrynin
Copy link
Contributor

@georgeemr by the way, recently created new library for lottie animations using native libraries
MPowerKit.Lottie, you may try to use it, it has more options than skiasharp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants