TiCollectionView icon indicating copy to clipboard operation
TiCollectionView copied to clipboard

example doesn't work

Open AhmedMSayed opened this issue 8 years ago • 23 comments

The example doesn't work and crash with alloy example. The real module name is 'de.marcelpociot.collectionview', so why you write 'ti.collectionview'

AhmedMSayed avatar Sep 26 '17 10:09 AhmedMSayed

@hansemannn can you please explain to him? we have to 1 rename android too or 2 Put Back on iOS

Thanks

nuno avatar Sep 26 '17 10:09 nuno

Mhh, I didn't touch the Android naming, damn. "ti.collectionview" is easier to use (e.g. for Alloy views like <CollectionView module="ti.collectionview" />, so we should just change the Android module ID and bump it as well?

hansemannn avatar Sep 26 '17 11:09 hansemannn

and please check the examples in the example/ and android/example/ folders, they are different and crashes with alloy

Thanks

AhmedMSayed avatar Sep 26 '17 14:09 AhmedMSayed

@m1ga do you want change the mod id to "ti.collectionview" in android and bump to version 2.0 ?

nuno avatar Sep 27 '17 11:09 nuno

sure: https://github.com/nuno/TiCollectionView/pull/76/

m1ga avatar Sep 27 '17 15:09 m1ga

Many thanks to both @hansemannn and @m1ga you guys rock!

nuno avatar Sep 27 '17 15:09 nuno

I'm trying android 2.0 version with your last example but it seems doesn't works. Who can help me?

` [ERROR] : TiApplication: (main) [1,3112] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.collection/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void de.marcelpociot.collectionview.CollectionViewTemplate$DataItem.setDefaultProperties(org.appcelerator.kroll.KrollDict)' on a null object reference; Titanium 6.2.2,2017/09/19 16:01,undefined

[ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.collection/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void de.marcelpociot.collectionview.CollectionViewTemplate$DataItem.setDefaultProperties(org.appcelerator.kroll.KrollDict)' on a null object reference [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) [ERROR] : TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) [ERROR] : TiApplication: at android.app.ActivityThread.-wrap11(ActivityThread.java) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] : TiApplication: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void de.marcelpociot.collectionview.CollectionViewTemplate$DataItem.setDefaultProperties(org.appcelerator.kroll.KrollDict)' on a null object reference [ERROR] : TiApplication: at de.marcelpociot.collectionview.CollectionViewTemplate.bindProxiesAndProperties(CollectionViewTemplate.java:152) [ERROR] : TiApplication: at de.marcelpociot.collectionview.CollectionViewTemplate.processChildProperties(CollectionViewTemplate.java:172) [ERROR] : TiApplication: at de.marcelpociot.collectionview.CollectionViewTemplate.processProperties(CollectionViewTemplate.java:161) [ERROR] : TiApplication: at de.marcelpociot.collectionview.CollectionViewTemplate.(CollectionViewTemplate.java:110) [ERROR] : TiApplication: at de.marcelpociot.collectionview.CollectionView.processTemplates(CollectionView.java:682) [ERROR] : TiApplication: at de.marcelpociot.collectionview.CollectionView.processProperties(CollectionView.java:435) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1222) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:516) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:507) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:485) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:523) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:507) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:485) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:695) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:588) [ERROR] : TiApplication: at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:261) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:33) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:564) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:684) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:21) [ERROR] : TiApplication: at android.app.Activity.performCreate(Activity.java:6237) [ERROR] : TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) [ERROR] : TiApplication: ... 9 more`

ottopic avatar Oct 08 '17 22:10 ottopic

@ottopic Thanks, seems the example was not updated to reflect the new mod. id name. Check my last commit. Remember the name of the module changed, to "ti.collectionview", so if you see any error with name "de.marcelpociot.collectionview.CollectionView" try find and replace.

Some widgets like: nl.fokkezb.pullToRefresh and nl.fokkezb.infiniteScroll may need add this "ti.collectionview" the array, like I did in the example -> https://github.com/nuno/TiCollectionView/commit/40623191431ed4d13c6b76aa0eff049e5e0bb114#diff-48e9c12d1852e32be67c8c6b697b42b3R18

nuno avatar Oct 09 '17 13:10 nuno

@nuno that's the problem. I have used your example https://github.com/nuno/TiCollectionView/blob/master/example/app.js that report correct name and android dist 2.0.0 (https://github.com/nuno/TiCollectionView/blob/master/dist/ti.collectionview-android-2.0.0.zip) .

So, how I can solve it?

ottopic avatar Oct 09 '17 13:10 ottopic

@ottopic please make sure the name is correct on tiapp.xml or you have to give me more info.

with the example fixed and with correct name on tiapp.xml should work. Please clear the project first before the next build ;)

nuno avatar Oct 09 '17 13:10 nuno

@nuno I can confirm the problem because I have created new project to test it. I add the module width Titanium interface than I use:

var TiCollectionView = require('ti.collectionview'); and var collectionView = TiCollectionView.createCollectionView(

I can attach the project if necessary.

Probably the problem is the scroll to refresh

ottopic avatar Oct 09 '17 13:10 ottopic

@ottopic I think I found the cause, on android the new module name is not 100& migrated yet.

Look at https://github.com/nuno/TiCollectionView/issues/79

Sorry about that.

nuno avatar Oct 09 '17 13:10 nuno

@nuno thank you. No problem for the bug, the goal is fix it. :) I think this module is very important!

ottopic avatar Oct 09 '17 14:10 ottopic

attach the project please

nuno avatar Oct 09 '17 14:10 nuno

I was running the example without any errors so I'm not sure if changing the getApiName() method will change anything. I'll do the changes in #79 but I think the problem is somewhere else.

m1ga avatar Oct 09 '17 15:10 m1ga

@ottopic try it without nl.fokkezb.pullToRefresh

AhmedMSayed avatar Oct 09 '17 15:10 AhmedMSayed

right, I removed that widget, since it isn't part of the module (and if you use 6.2.2 you can use the build in Refresh SDK!)

m1ga avatar Oct 09 '17 15:10 m1ga

@AhmedMohamed2014 @nuno I confirm my problem. Project in attachment

collectionview.zip

ottopic avatar Oct 09 '17 16:10 ottopic

The Alloy version works fine. Looks like the vanilla versions makes problems

m1ga avatar Oct 09 '17 17:10 m1ga

Thanks @m1ga I submitted the PR on both https://github.com/Topener/nl.fokkezb.infiniteScroll/pull/64 https://github.com/Topener/nl.fokkezb.pullToRefresh/pull/74

also with my last commit I changed all the names to ti.collectionview

nuno avatar Oct 09 '17 17:10 nuno

@ottopic for now you must use Alloy see https://github.com/nuno/TiCollectionView/issues/79

nuno avatar Oct 09 '17 20:10 nuno

@nuno thank you but my app is already build in Vanilla mod and I can't change to Alloy. I'll wait the fix.

ottopic avatar Oct 10 '17 06:10 ottopic

Are there news about this fix? Does someone try to solve it?

ottopic avatar Oct 20 '17 11:10 ottopic