Bug 53280 - Animations don't work correctly on Android 7.0 with Animator duration scale turned off
Summary: Animations don't work correctly on Android 7.0 with Animator duration scale t...
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-03-13 14:30 UTC by Milan Laslop
Modified: 2018-04-19 15:32 UTC (History)
10 users (show)

Tags: android, nougat, animations ac
Is this bug a regression?: ---
Last known good build:


Attachments
repro project (69.79 KB, application/x-zip-compressed)
2017-04-11 21:59 UTC, Jimmy [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 53280 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Milan Laslop 2017-03-13 14:30:44 UTC
Set up this (e.g. on Android 7):
Settings -> Developer options
set Animator duration scale: Animation off

Test A:
Xamarin.Forms.Image image = ...;
image.RotateTo(90, 250, Easing.CubicOut);

Test A result: The image state does not change (it remains in the initial position, or probably only changes very slightly).

Test B:
Xamarin.Forms.Label label = ...;
var anim = new Animation(AnimFunc, 0, 1);
anim.Commit(label, "anim1", 16, 250, Easing.CubicOut);

void AnimFunc(double t)
{
}

Test B result: AnimFunc is called only twice: with t = 0 and t = 0.023808512 (or some other low number).

With another Animator duration scale options it works correctly (but it looks like Animator duration scale does not influence the animation speed - it probably should).
Comment 1 Jimmy [MSFT] 2017-03-13 16:58:13 UTC
Thank you for filing this report! Let me try the code you provided to see if I can reproduce and confirm this issue and I will update the report with my results.
Comment 2 Milan Laslop 2017-03-20 07:39:09 UTC
If someone is interested, here is a workaround:
Retrieve current "animator duration scale" setting (this way: http://stackoverflow.com/a/42670723). If it is 0 (animations are disabled), avoid using animations in your Xamarin Forms code (instead of issuing an animation, change properties of the controls directly to the final values).
Comment 3 Jimmy [MSFT] 2017-04-11 21:59:07 UTC
Created attachment 21445 [details]
repro project

I was able to reproduce the issue described with the project I am attaching. 

The issue happens on Android 7.0+ and when the the Animator duration scale is set to "Off" under Settings > Developer Options. As described, when using RotateTo() the rotation did _not_ fully complete, and when using a custom animation, the function was called only once in my tests.


### Steps to Reproduce
1. On an Android 7.0 device/emulator, go to Setting > Developer Options
2. Set Animator duration scale to "Off"
3. Run the attached project on the device
4. Press "Rotate Label"
5. Press "Animate Label"


### Expected Results
Rotate Label: The Label directly underneath will be rotated 90 degrees.

Animate Label: The Label underneath will be flipped.


### Actual Results
Rotate Label: The Label is not full rotated 90 degrees.

Animate Label: The Label does not animate at all. Looking at the output, the animation function was only called once with a value of '0'.


### Version tests
2.3.5.84    BAD
2.3.4.224   BAD
2.3.3.193   BAD
Comment 4 Hines Vaughan III 2017-05-11 14:04:03 UTC
While disabling animation works fine as a workaround, the activity indicator is also affected by this (just sits on the screen not indicating much of anything), which is going to be super annoying to work around.
Comment 5 Hines Vaughan III 2017-05-11 15:13:58 UTC
Actually, maybe the activity indicator is working for some devices but not others. Need to look into that a bit more.
Comment 6 Hines Vaughan III 2017-05-13 03:47:07 UTC
Sorry to keep commenting here but I just wanted to say that the activity indicator does indeed freeze the Activity Indicator on Android 7.1.
Comment 7 John R 2017-07-02 23:36:17 UTC
I am also experiencing this issue, with a TranslateTo that is supposed to slide in another ContentView from the right. On Android, I have to set the TranslationX value directly and then lose the animations.
Comment 8 Dale Cebula 2017-12-01 12:11:01 UTC
Any movement on fixing this?
Comment 9 Pynne 2017-12-21 07:33:12 UTC
Is there any update regarding this issue?
Comment 10 Hines Vaughan III 2018-01-27 18:56:38 UTC
Still nothing....?
Comment 11 ksemenenko 2018-04-19 15:32:35 UTC
I have the same issue on my release build.