ScaleTo and TranslateTo not always working?

I've got an app that uses ScaleTo And TranslateTo in a number of places, and I just noticed that's it's not working anymore. I've got it wrapped up in a BeginInvokeOnMainThread like usual. But here's the thing... it works fine on an iPad Pro. And an iPhone xS. As well as an android API 23 phone. But I've also got an android 23 tablet here, and on that device ScaleTo and TranslateTo finish instantly. No smooth transition. Same thing with an android 28 emulator. If I put a Stopwatch on there, I can clearly see that the devices it works on are taking 1000ms like they should. But on the other 2 devices it's finishing in 5ms. Are these routines device specific perhaps? The other thing is I could swear this was working fine last week on all devices. I did update my xamarin forms to the latest version Monday. Maybe something got broke? Or maybe it never worked on these few devices and I just never noticed. Anyone have an idea?

Answers

  • JohnHardmanJohnHardman GBUniversity mod

    @dwrussellii

    Have you checked the accessibility settings and developer options on the devices where ScaleTo and TranslateTo complete immediately?

    In Settings/Accessibility check the Remove Animations option
    For developer options see https://github.com/xamarin/Xamarin.Forms/issues/5421

  • dwrusselliidwrussellii Member ✭✭

    I just checked. Looks like this particular tablet doesn't have that option. But I'll see if that link you sent does me any good.

  • JohnHardmanJohnHardman GBUniversity mod

    @dwrussellii said:
    I just checked. Looks like this particular tablet doesn't have that option. But I'll see if that link you sent does me any good.

    Note that the accessibility option may have a different name, depending on the Android version.

  • dwrusselliidwrussellii Member ✭✭

    Have you checked the accessibility settings and developer options on the devices where ScaleTo and TranslateTo complete immediately?

    Well, there was a nifty bit of code in that link where that allowed me to read what the animation scale is set to. And sure enough on this device, it's 0. There was also a bit of code in there to set it, but that's not working. I think it's because this particular device is a custom deal we get out of China. Double the batteries, custom OS, that kind of stuff. I think to help with battery life the guys in China locked the animation scale to 0 in the OS itself. Best guess anyway. So I think I'm fighting a problem that I'll only see here. Not sure why it doesn't work in the emulator either though. But at least I now have the ability to detect if animations are off, and make the app act differently in that case.

  • dwrusselliidwrussellii Member ✭✭

    I knew I wasn't smoking crack. Yup, it just got broken. I just updated my xamarin forms today and now all is well across all devices.

  • JohnHardmanJohnHardman GBUniversity mod

    @dwrussellii said:

    Have you checked the accessibility settings and developer options on the devices where ScaleTo and TranslateTo complete immediately?

    Well, there was a nifty bit of code in that link where that allowed me to read what the animation scale is set to. And sure enough on this device, it's 0. There was also a bit of code in there to set it, but that's not working. I think it's because this particular device is a custom deal we get out of China. Double the batteries, custom OS, that kind of stuff. I think to help with battery life the guys in China locked the animation scale to 0 in the OS itself. Best guess anyway. So I think I'm fighting a problem that I'll only see here. Not sure why it doesn't work in the emulator either though. But at least I now have the ability to detect if animations are off, and make the app act differently in that case.

    Glad to have pointed you in the right direction :-)

    @dwrussellii said:
    I knew I wasn't smoking crack. Yup, it just got broken. I just updated my xamarin forms today and now all is well across all devices.

    Good news. One less workaround :-)

Sign In or Register to comment.