m1ga / ti.animation

Airbnb Lottie + Rive animation module for Titanium SDK
Other
106 stars 20 forks source link

Receipt for usage in list view #50

Closed AppWerft closed 5 years ago

AppWerft commented 5 years ago

Following this JIRA ticket https://jira.appcelerator.org/browse/TIMOB-24776

const TiAnimation = require('ti.animation');
exports.pool_progress ={
    properties : {
        height : 32,
    },
    childTemplates : [ {
        type: 'AnimationView',
        module: 'TiAnimation',
        properties: {
            file :'/images/cup.json',
            width : 32,
            height : 32
        }
    }
[ERROR] :  TiExceptionHandler: (main) [185,389] ti:/listview.js:102
[ERROR] :  TiExceptionHandler:          throw new Error('Could not lookup constructor for namespace: "' + namespace + '"');
[ERROR] :  TiExceptionHandler:    ^
[ERROR] :  TiExceptionHandler: Error: Could not lookup constructor for namespace: "AnimationView"

@m1ga do you know the trick?

m1ga commented 5 years ago

not a module issue, so I close this

and have a look at https://github.com/m1ga/ti.animation/wiki/ListView-Example

AppWerft commented 5 years ago

Thanks for quick answer, I have looked and modified for classic project:

const TiAnimation = require('ti.animation');
exports.pool_progress = {
    properties : {
        height : 32
    },
    childTemplates : [{
        type: 'TiAnimation.AnimationView',
        bindId: 'ani',
        properties: {
            contentMode: 0,
            touchEnabled : false,
            width : 32,
            height : 32
        }
    }

and in controler

ani: {
    left:0,
    file:'/images/cup.json'
},

Same issue ... (reference in tiapp.xml)

m1ga commented 5 years ago

the example works fine Screenshot_20190428-181158 just tested it with 7.5.0.GA and 8.0.0.GA.

AppWerft commented 5 years ago

I'm using 8.0.1.v20190426162041 and I think this is not the reason. I guess the scope of require is the issue. EDIT. the same with 8.0.0.GA

AppWerft commented 5 years ago

It don't crash if I out the require('ti.animation') into app.js. But this is deprecated since 8.0.0