Baseflow / LottieXamarin

Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
https://baseflow.com
Apache License 2.0
1.22k stars 261 forks source link

XF.UWP sample AutoPlay property not working on MainPage #313

Open sjorsmiltenburg opened 3 years ago

sjorsmiltenburg commented 3 years ago

🐛 Bug Report

Expanding on #312

Since I am interested in the first scenario "run from asset or bundle" with Autoplay I went a little further with XF.UWP sample and noticed another thing.

When I added the AutoPlay="True" and RepeatMode="Infinite" properties to the AnimationView on the AssetPage, it started playing without hitting the play button as expected. But when i copied the animation view over to the MainPage, the AutoPlay property was not having any effect. The animation was loaded but did not play automatically. Even weirder, after navigating to the AssetPage and back again, the MainView Animation started to play. Something in the naviation, or the playing of the other animation, must have triggered it. I looked for some kind of initialisation logic, but couldn't find any.

<forms:AnimationView

        Grid.Row="2" 
        BackgroundColor="Red"
        AutoPlay="True"
        RepeatMode="Infinite"
        Animation="LottieLogo1.json"
        AnimationSource="AssetOrBundle"
        VerticalOptions="FillAndExpand" 
        HorizontalOptions="FillAndExpand" />

Expected behavior

animationview AutoPlay property also works on MainPage

Reproduction steps

Configuration

Xamarin.Forms 4.8.0.1821 Visual Studio 16.8.3

Version: 4.0.8

Platform: