clojure-android / neko

The Clojure/Android Toolkit
Other
297 stars 36 forks source link

ListView Example is broken #11

Closed ghost closed 11 years ago

ghost commented 11 years ago

The ref-adapter example use case, with (make-ui [:text-view {}]) as the view-creation function breaks with

android.view.ViewGroup$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams

It seems that make-ui defaults to setting ViewGroup$LayoutParams on views created without container or with an unknown container, which makes them unattachable to Listviews subsequently?

alexander-yakushev commented 11 years ago

Hello Volker!

Sorry for being silent for some time, the exams took over me. I will try to get up to speed and deal with all the requests you kindly provided (they've stacked up already!).

As for this one, you were right, it doesn't work this way. I guess ICS+ got this broken, because I last tried it with 2.3 and it certainly worked back then. Anyway, I've pushed some changes, currently in 3.0.0-SNAPSHOT version and updated the wiki page, you can see it here https://github.com/alexander-yakushev/neko/wiki/Namespaces#nekouiadapters. I did some magic to create-fn in ref-adapter to resolve the issue non-intrusively, but there is still some stuff to be aware of.

ghost commented 11 years ago

I don't think it's ICS+ that broke this, but the initial handling of the LayoutParams. Anyhow - works like a charm in -SNAPSHOT now ;)