Pregunta

In my app I have a ScrollView with the usual LinearLayout inside of it. Inside that LinearLayout, I have a bunch of programmatically created views and layouts. I want to make certain items "sticky" (as in the sticky item will stick to the top of the ScrollView until another sticky items comes by and pushes it out of the way).

I found this library ( https://github.com/emilsjolander/StickyScrollViewItems ) but I am having trouble figuring out how to import it into my project using the Eclipse ADT.

Can anyone offer any advice on either how to import that library or how to go about what I am trying to accomplish by using that library?

¿Fue útil?

Solución

I managed to get the library imported by manually copying over the Java src file into my project (and updating the package name) as well as the attrs.xml file. Plus this line to set the stickiness programmatically and everything works!

my_item.setTag("sticky");

Otros consejos

  1. First pull the sources from github (you can easily do this with a git plugin for eclipse, like EGIT),
  2. Then import the library project found here into your workspace,
  3. Finally add that library project to your android project dependencies in Project -> Properties -> Android -> Library (at the bottom of settings page) -> Add button.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top