facebookarchive / Keyframes

A library for converting Adobe AE shape based animations to a data format and playing it back on Android and iOS devices.
https://facebookincubator.github.io/Keyframes/
Other
5.33k stars 302 forks source link

[Android] OPACITY is not a constant in com.facebook.keyframes.model.KFAnimation$PropertyType #78

Closed camaron-izeni closed 7 years ago

camaron-izeni commented 7 years ago

One of the animations I'm trying to load has a feature with an OPACITY property.

{
          "property": "OPACITY",
          "key_values": [
            {
              "start_frame": 6,
              "data": [
                0
              ]
            },
            {
              "start_frame": 12,
              "data": [
                100
              ]
            }
          ],...
}

The Keyframes Android framework is not handling this properly.

FATAL EXCEPTION: main
Process: com.owletcare.owletfield, PID: 11924
java.lang.IllegalArgumentException: OPACITY is not a constant in com.facebook.keyframes.model.KFAnimation$PropertyType
at java.lang.Enum.valueOf(Enum.java:200)
at com.facebook.keyframes.model.KFAnimation$PropertyType.valueOf(KFAnimation.java:41)
at com.facebook.keyframes.deserializers.KFAnimationDeserializer.readObject(KFAnimationDeserializer.java:40)
at com.facebook.keyframes.deserializers.KFAnimationDeserializer$1.readObjectImpl(KFAnimationDeserializer.java:29)
at com.facebook.keyframes.deserializers.KFAnimationDeserializer$1.readObjectImpl(KFAnimationDeserializer.java:26)
at com.facebook.keyframes.deserializers.AbstractListDeserializer.readList(AbstractListDeserializer.java:35)
at com.facebook.keyframes.deserializers.KFFeatureDeserializer.readObject(KFFeatureDeserializer.java:71)
at com.facebook.keyframes.deserializers.KFFeatureDeserializer$1.readObjectImpl(KFFeatureDeserializer.java:32)
at com.facebook.keyframes.deserializers.KFFeatureDeserializer$1.readObjectImpl(KFFeatureDeserializer.java:29)
at com.facebook.keyframes.deserializers.AbstractListDeserializer.readList(AbstractListDeserializer.java:35)
at com.facebook.keyframes.deserializers.KFImageDeserializer.readObject(KFImageDeserializer.java:52)
at com.facebook.keyframes.deserializers.KFImageDeserializer.deserialize(KFImageDeserializer.java:35)
at com.owletcare.owlet.controls.KeyframesSequence.load(KeyframesSequence.java:78)
at com.owletcare.owlet.controls.KeyframesSequence.<init>(KeyframesSequence.java:68)
at com.owletcare.owlet.fragments.vitalsHelpPages.VHFeedingFragment.onViewCreated(VHFeedingFragment.java:37)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1132)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1295)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1682)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:541)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5459)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

This error is coming from the current build on Gradle. The animation runs fine when I run it on a clone of the current repository.

I suggest a new build be released to Gradle as soon as possible.

lozzle commented 7 years ago

Hi @camaron-izeni-- you're right. The current release version (1.0.0) is before we added some new features (opacity, anchor point animation). You can get an updated version from the repo and Opacity should be working on Android.

camaron-izeni commented 7 years ago

Any idea when the next release will be pushed out?

lozzle commented 7 years ago

We'd have to sync up and make sure all of the new features are supported across iOS/exporter as well, and we could release a new version. Unsure how long that will take since many of us are on holiday ATM.

camaron-izeni commented 7 years ago

Understood, thanks for the quick reply.

m1ga commented 7 years ago

@camaron-izeni if you want to test it I've compiled a version from the current branch: http://migaweb.de/keyframes-1.0_test.jar Opacity is working fine on android!

lozzle commented 7 years ago

thanks, @m1ga!