Category Archives: Uncategorized

Custom ListViews in Android

Quick post about some code I threw together yesterday for a project. Needed to make some uber custom listviews for a project at work so decided to just create a test package and have at it, there are a ton of resources already online but figured i’d take the best parts of each and make a nice clean project if anyone else wanted to check it out. (ignore package name, not using net.trippedout since i started it at work and been in a habit of naming stuff this way)

Simple answer – extend ArrayAdapter and create a model to hold your data for the list item you’re trying to populate, override getView in your custom ArrayAdapter and create/update the view (referenced by your xml layout id) as needed. Fairly straightforward but could still use some tweaks. If you are going to use this in conjunction with drawables, just pass reference ids to the images you’ll be using and your good to go. My task today is to figure out the best practices of downloading groups of images/data from the network on a phone while still saving battery and caching stuff as I need it. If I come up with anything good I’ll be sure to share it.

Code is here: https://github.com/trippedout/CustomListViews

Comments/Questions hit me up here or @trippedout!

*Edit: adding pic of final product
Screenshot of custom listview

It’s been a long time coming…

But I figure I’m fairly due for a large-scale update to this site.

Over the coming weeks I’m going to post all (most) of the things I’ve been working on for the past 6-12 months, which is going to look a lot different than the things I’ve had up here prior to that. Mobile has kinda consumed my life (while I haven’t been skiing) and hopefully my new love is a step in the right direction.

Let’s see what we can make of this, shall we?

TO INFINITY, AND BEYOND

blog-o-sphere?

I’ve actually heard someone say that before. Needless to say, I’m finally taking the plunge. Figure I do enough Flash-based experimenting and ranting about nonsense that I might as well start my own blog so I can keep a record of it all. And who knows, someone might actually give a shit about the stuff I post here.

So, reader’s beware, this is going to be a totally unfiltered account of the inner workings of my brain, whether it be football related, skiing related, code related, traveling related, oh, you get the idea.

And I promise I will figure out how to skin this shit asap so its not so boring.

Godspeed.