Complete
over 5 years ago

WatchUi.CancellAllAnimations() is not expected to function on a 3.1.6 device.

Animations don't run correctly on the real watch

Hi,

I started to include animations on some drawables by using the animate() method. This works good. But if I switch too fast between screens especially switch a screen if one animation didn't end on the hiding screen, the animation on the next screen doesn't finish and stops anywhere in the middle ending up with a messed screen. 

This happens only on my F6X pro and not in the sim. 

I tried to include an

Ui.cancelAllAnimations();

in the onHide() method, but this throws an error as if the function wouldn't exist at all:

Error: Symbol Not Found Error
Details: Could not find symbol 'cancelAllAnimations'

Are there any tricks to get a proper animation even if screens are switched fast?

  • The version you see in the about dialog is the SDK version, not the version of the VM that is being simulated on the device. The 3.1.8 SDK shows the fenix6xpro as only supporting 3.1.6.. from devices.xml...

            <device family="round-280x280" grouping="Watches/Wearables" id="fenix6xpro" name="fēnix® 6X Pro / 6X Sapphire / 6X Pro Solar / tactix® Delta Sapphire" part_number="006-B3291-00">
                <part_numbers>
                    <part_number connectIQVersion="3.1.6" firmwareVersion="500" number="006-B3291-00">

    Devices don't typically lag behind the current SDK version.

  • Hi Travis,

    I am simulating currently the F6X Pro. I would expect that this device is running 3.1.7. The sim's About menu shows 3.1.8. Or is there anywhere else a version number for a devive? In the configuration menu I can set it to compile for 3.1.x

    I would like to have an eye to your mentioned timer workaround. Is there a code snippet for that how to handle this? Do you mean to start a timer and fire it every 20 ms or so and firing a request update? This may probably be the best workaround then.

  • The WatchUi.cancelAllAnimations() method was added in ConnectIQ 3.1.7 (according to the documentation that came with the SDK). If you are running/simulating this application on a device with 3.1.7 or later, I'd expect it to work. Otherwise, you should get a Symbol Not Found error. You can use a (WatchUi has :cancelAllAnimations) check to avoid the error, but that won't help to fix your original problem.

    If you need to support devices that don't have WatchUi.cancelAllAnimations(), it seems that you have two choices. You can either prohibit the user doing anything to switch views while an animation is running, or you can manage the animations yourself with a Timer. You should be able to just use one timer to manage many animations.