Wednesday, December 8, 2010

Android: put ListView in a ScrollView

When I need to use ListView with other controls on the same screen, and it doesn't fit the screen vertically, I wish to get ScrollView over all controls, to scroll entire screen. But, that's the point when "shit happens".

Android core developers say you "must not put ListView inside ScrollView", because of many reasons, one of them - ListView has it's own scroll.

When you try just do it, ListView collapses, and you wish it not to be collapsed at all.

To accomplish that, I use a "hack", measuring and setting the height directly:

Sunday, May 30, 2010

Link in module title: Jumi + Articles Anywhere

How to set link in Joomla module title?
For example, let's show an article in module, with link to this article in module title.

1. Install Jumi, if you haven't done that already - it's incredibly useful component.

2. Install Articles Anywhere, plugin that displays article in any content.

3. Create Jumi module, publish it to position you choose, set any title, select option "Show title: Yes".

4. In "Code" field (on the right of module properties), write this code, with article_id changed to id of your article:

<?php $module->title="{article article_id}<a href=\"{url}\">{title}</a>{/article}"; ?>
{article article_id}{text}{/article}


First row will set module title to {article article_id}<a href="{url}">{title}</a>{/article}, and second will set module body.

Articles Anywhere plugin will parse tags in braces before display, changing it to corresponding html-code.

Why I Blog

For a number of times, I've encountered problems, with solutions not available anywhere on the net, and saw more inquiries about the same problem, unanswered. So I started my blog, to publish solutions I've found. This blog is also available on Russian, specially for my countrymates.

If you have something to say, please, leave a comment, I'll really appreciate it.