Tue 2009/Dec/22
-
If you've had the chance to play already with a N900, you've probably noticed that you can typeahead your contacts' names in the Phone application, in order to filter them and find the person you're looking for quickly. Similarly, the media player will allow you to filter the list of artists/albums/songs/etc. by simply typing the first letters of the media you're looking for. This is probably one of the most praised features of these two applications, specially in times when contact lists grow up to several hundreds of people and dumping your media collection inside the phone takes no effort.
This feature, known as live search, used to live inside these two applications, each with a different implementation. Third party maemo developers wanting to have a similar feature would have needed to cook it themselves inside their applications. Clearly, a waste of effort.
But luckily, that's not the case anymore. I spent a big part of the last two months (when not in holidays nor flying from and to A Coruña) working in a consolidation of the live search widget originally written by the good old Jörgen and later rewritten by Xavier, part of the osso-abook library. With the blessing of Nokia, I took it and removed all the osso-abook dependant bits and made it as generic as possible, in order to allow its usage in any application using a GtkTreeView and a GtkTreeModelFilter. This widget, now LGPL and named HildonLiveSearch, landed in hildon's master around a month ago. Better yet, I also took HildonLiveSearch and made it a feature of HildonTouchSelector, the hildon widget for pannable lists that you can see in most of the N900 applications. This already landed in the stable branch of hildon and I'm confident that Nokia will release it at some point with an update of the phone's software (don't ask me when, though). Rumor has it, this is already a feature in one of the latest releases of Hildon Application Manager.
For developers interested: if you use a HildonTouchSelector, don't worry, you'll have live search for free in your application. If you just use GtkTreeView, have a look at the HildonLiveSearch widget implementation and its simple example, as well as the HildonTouchSelector implementation for a more complete example. Of course, you can imagine that the changes to make it work inside HildonTouchSelector are quite invasive, so I'd please ask you to grab hildon's code from the repository, build packages, smoke test it in your application, and file bugs if you find any. This way, we minimize the possibility for regressions by the time this hits the public. Shall you have any concern or question, don't hesitate to contact us in the hildon-devel mailing list.
Let this be my christmas present to the world for this year. Special thanks to Xavier, who was of great help during the push of the live search into hildon.
Syndicated 2009-12-22 16:15:00 from Claudio Saavedra's ChangeLog