Skip to content

Issues regarding Storyboard and DoubleAnimation #182

Open

Description

@poepoe12002

I'm submitting a...

Bug report (I searched for similar issues and did not find one)
Feature request

Current behavior

The code snippets below don't work as expected on
Android and Wasm

Expected behavior

In Case 02 - The code should animate a rectangle to grow in size and stop then repeat the behavior.
In Case 03 - The code should animate a rectangle to grow in size then shrink in size then repeat the behavior.

Minimal reproduction of the problem with instructions

    Case 01 - Grow then stop
-------------------------------------------------	
Expected result of running the code as presented below - 
with DoubleAnimation.RepeatBehavior and DoubleAnimation.AutoReverse commented out:
	Rectangle grows in size from H(0), W(0) to H(50), W(50).
	This occurs over a period of five seconds.

Actual result on Android: Correct and inline with UWP		
Actual result on Wasm: Correct and inline with UWP		
Actual result on iOS: NA
	
Case 02 - Grow then stop then repeat
-------------------------------------------------
Expected result of running the code after Un-Commenting out -
<DoubleAnimation.RepeatBehavior>Forever</DoubleAnimation.RepeatBehavior>:	
	The rectangle should grow in size from H(0), W(0) to H(50), W(50).
	This should occur over a period of five seconds.
	The rectangle Should disapear and the behavior should repeat.  
	This should continue until the application terminates.

Actual result on Android: PROBLEM	
	The rectangle does grow from H(0), W(0) to H(50), W(50). 
	It then instantly expands to fill the screen and will continue to fill the screen. (PROBLEM)
	Every 5 seconds the screen will flicker.  Storyboard must still be acting.
	This continues until the application terminates.
	
Actual result on Wasm: Correct and inline with UWP		
Actual result on iOS: NA

Case 03 - Grow then shrink then repeat
-------------------------------------------------
Expected result of the code after Un-Commenting out -
<DoubleAnimation.RepeatBehavior>Forever</DoubleAnimation.RepeatBehavior> and -
<DoubleAnimation.AutoReverse>True</DoubleAnimation.AutoReverse>:	
	The rectangle should grow in size from H(0), W(0) to H(50), W(50).
	This should occur over a period of five seconds. 
	The animation will then reverse itself.
	The rectangle should then shrink in size from H(50), W(50) to H(0), W(0).
	The two step behavior should repeat.   
	This should continues until the application terminates.

Actual result on Android: PROBLEM
	The rectangle does grow from H(0), W(0) to H(50), W(50).
	Then it instantly expands to fill the screenand will continue to fill the screen. (PROBLEM)
	Every 5 seconds the screen will flicker.  Storyboard must still be acting.
	This continues until the application terminates.
	
Actual result on Wasm: PROBLEM
	The rectangle does grow in size from 0,0 to 50,50.
	This occurs over a period of five seconds.  
	The rectangle then disapears completly and the behavior repeats. (PROBLEM)  
	This continues until the application terminates.
	
Actual result on iOS: NA


 Xaml -----
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Grid.Resources>
        <Storyboard x:Name="GrowStoryboard">
            <DoubleAnimation
                Storyboard.TargetName="TheRectangle"
                Storyboard.TargetProperty="Width"
                EnableDependentAnimation="True"
                From="0.0"
                To="50.0"
                Duration="0:0:5">
                <!--<DoubleAnimation.RepeatBehavior>Forever</DoubleAnimation.RepeatBehavior>
                <DoubleAnimation.AutoReverse>True</DoubleAnimation.AutoReverse>-->
            </DoubleAnimation>
            <DoubleAnimation
                Storyboard.TargetName="TheRectangle"
                Storyboard.TargetProperty="Height"
                EnableDependentAnimation="True"
                From="0.0"
                To="50.0"
                Duration="0:0:5">
                <!--<DoubleAnimation.RepeatBehavior>Forever</DoubleAnimation.RepeatBehavior>
                <DoubleAnimation.AutoReverse>True</DoubleAnimation.AutoReverse>-->
            </DoubleAnimation>
        </Storyboard>
    </Grid.Resources>
    <Rectangle
        Name="TheRectangle"
        Stretch="Fill"
        Fill="Blue">
    </Rectangle>
</Grid>
	
 Code behind-----
 GrowStoryboard.Begin();

Environment

Nuget Package: 

Package Version(s): 

Affected platform(s):
- [ ] iOS
- [x ] Android
- [x ] WebAssembly
- [ ] Windows
- [ ] Build tasks

Visual Studio
- [x ] 2017 (version: )
- [x ] 2017 Preview (version: )
- [ ] for Mac (version: )

Activity

  1. jeromelaban commented on Sep 11, 2018

    @jeromelaban
    Member

    Thanks for the detailed report ! We still have work to do to bring animations to the next level, such as supporting AutoReverse.

  2. added
    kind/bug
    on Sep 11, 2018
  3. YGuerin commented on Nov 19, 2019

    @YGuerin
    Contributor

    Encouter a simular issue using a DoubleAnimation to perform a TranslateTransform on a Grid.
    Working well on UWP. Doesn't work on iOS and Android. WASM is not in our scope so I can't confirm that point.

    <DoubleAnimation Storyboard.TargetName="PreviewBanner"
    				 Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
    				 Duration="0:0:0.35"
    				 To="80">
    	<DoubleAnimation.EasingFunction>
    		<QuadraticEase EasingMode="EaseIn" />
    	</DoubleAnimation.EasingFunction>
    </DoubleAnimation>
    
    <DoubleAnimation Storyboard.TargetName="ZoomedOutBanner"
    				 Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
    				 Duration="0:0:0.35"
    				 To="0">
    	<DoubleAnimation.EasingFunction>
    		<QuadraticEase EasingMode="EaseIn" />
    	</DoubleAnimation.EasingFunction>
    </DoubleAnimation>
    
  4. self-assigned this
    on Jun 2, 2020
  5. dr1rrb commented on Jun 3, 2020

    @dr1rrb
    Member

    Quick status of the DoubleAnimation:

    iOS Android Wasm
    Repeat Forever yes no yes
    Duration no no no
    Count no no no
    AutoReverse no no no
    BeginTime yes yes yes
    SpeedRatio no no no

    Notes:

    • This was built using the sample above, which is using dependant animations, the result might be slightly different for GPU animations.
    • Running 2 separated animations on a same element is known to cause some issues. For instance when testing the BeginTime on WASM, the 2 animations was not synchronized and the result was a bit strange.
    • Some easing functions are not supported yet

    There are too much changes to get it fixed in the bug bash, this work has to be planned.

  6. modified the milestone: 3.1 on Aug 29, 2020
  7. added
    project/animations 🎡
    and removed on Sep 21, 2020
  8. added
    difficulty/tbd
    on Feb 15, 2021
  9. added
    difficulty/challenging 🤯
    and removed
    difficulty/tbd
    on May 31, 2021
  10. changed the title [-]Issues regarding Storyboard and or DoubleAnimation on the other platforms[/-] [+]Issues regarding `Storyboard` and `DoubleAnimation`[/+] on Oct 24, 2022
  11. self-assigned this
    on Dec 15, 2022
  12. Xiaoy312 commented on Dec 23, 2022

    @Xiaoy312
    Contributor

    case2: [droid-only] dependent animation stops working after 1loop

    debug note
    AnimationImplementation<T>::OnFrame()
        if (_endValue == null || _startingValue == null)
            ^ on first loop, both values are provided from context (0, 50)
            ^ after that, the _startingValue is null which cause the animation to appear not working
        {
            SetValue(null);
            return;
        }
        SetValue( /* INSERT_MATH */ );
    
    looping call stack
        5 Windows.UI.Xaml.Media.Animation.Timeline.AnimationImplementation<float>.InitializeAnimator at D:\code\uno\framework\uno\src\Uno.UI\UI\Xaml\Media\Animation\Timeline.animation.cs:221,5
        4 Windows.UI.Xaml.Media.Animation.Timeline.AnimationImplementation<float>.Play at D:\code\uno\framework\uno\src\Uno.UI\UI\Xaml\Media\Animation\Timeline.animation.cs:280,5
        3 Windows.UI.Xaml.Media.Animation.Timeline.AnimationImplementation<float>.Replay at D:\code\uno\framework\uno\src\Uno.UI\UI\Xaml\Media\Animation\Timeline.animation.cs:213,5
        2 Windows.UI.Xaml.Media.Animation.Timeline.AnimationImplementation<float>.OnEnd at D:\code\uno\framework\uno\src\Uno.UI\UI\Xaml\Media\Animation\Timeline.animation.cs:340,6
        1 Windows.UI.Xaml.Media.Animation.Timeline.AnimationImplementation<float>.OnAnimatorAnimationEnd at D:\code\uno\framework\uno\src\Uno.UI\UI\Xaml\Media\Animation\Timeline.animation.cs:264,5
        0 Windows.UI.Xaml.Media.Animation.NativeValueAnimatorAdapter. at D:\code\uno\framework\uno\src\Uno.UI\UI\Xaml\Media\Animation\Animators\NativeValueAnimatorAdapter.Android.cs:120,7
    
        at frame[5], the _startingValue is set to a new value
        then at frame[1], we clear it...
    
        private void OnAnimatorAnimationEnd(object sender, EventArgs e) // frame[1]
            OnEnd(); // frame[2..]
            _startingValue = null;
    
        ^ just move the clear into OnEnd, in the else-part of `if (NeedsRepeat(_activeDuration, _replayCount))` fix the bug
        
    additional note: the reason why this only fail for android, is because only android relies on \_endValue & \_startingValue
        as they are used to compute the animated value: f(start,end,time) =...
        while the rest grab it from the animator implementation
    

    case3: [uno-any] AutoReverse is just not implemented...

  13. github-actions commented on Sep 17, 2025

    @github-actions
    Contributor

    Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.

  14. added
    stale
    on Sep 17, 2025
  15. removed
    stale
    on Sep 23, 2025
  16. MartinZikmund commented on Apr 7, 2026

    @MartinZikmund
    Member

    Repro generator

    Runtime test(s) added in branch dev/mazi/repro/182:

    • src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media_Animation/Given_DoubleAnimation.cs → When_DoubleAnimation_AutoReverse_Completes_At_FromValue
    • src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media_Animation/Given_DoubleAnimation.cs → When_DoubleAnimation_RepeatForever_AutoReverse_StaysInBounds

    The first test (When_DoubleAnimation_AutoReverse_Completes_At_FromValue) fails as expected on Skia Desktop: after a DoubleAnimation with AutoReverse=True completes its full forward+reverse cycle, Width remains at the To value (50) instead of returning to the From value (10). This confirms AutoReverse is broken.

    The second test (When_DoubleAnimation_RepeatForever_AutoReverse_StaysInBounds) passes on Skia Desktop — the screen-filling behavior (Android) and element disappearing (WASM) may be platform-specific aspects of the same underlying bug.

  17. self-assigned this
    on Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

difficulty/challenging 🤯has-repro-branchkind/bugproject/animations 🎡

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions