Layout question - how to replicate what the iPhone does...

by Anna PS » Tue, 28 Apr 2009 05:05:11 GMT

Sponsored Links
 Hi there,

I have an application that consists of a series of tasks, and I'm
struggling to replicate a user experience that is simple to implement
on the iPhone.

In the abstract: on the home screen, I'd like there to be a list of
four tasks, of various kinds.

-- Two will invite the user to click on them, with an arrow. When they
are complete, they show a tick.
-- One task is dependent on the others, so it will be greyed out until
the others are completed. Then it looks like the others.
-- Another task runs in the background, so it has a progress icon
running until it's finished, instead of an arrow.

To show what I mean concretely, this is the application that I'm
trying to replicate - check out the home screen: 

How would I even start to create a home screen that looks like this in
Android? Essentially I need clickable areas with text and icons.
Buttons can't have images attached, nor can they be greyed out. Maybe
a List... but you can't attach checkboxes or progress indicators to
individual items. Is a series of WebViews the best way?

Or should I use something radically different like a TabWidget? I do
like the layout here, though...

Can anyone help? I'm really struggling to know what to do!

Thank you for your help!


Layout question - how to replicate what the iPhone does...

by Streets Of Boston » Tue, 28 Apr 2009 05:27:52 GMT

 Hi Anna,

You can have any view inside your list-items.

Create a ListView with an Adapter (BaseAdapter or any other type of
The Adapter has 4 elements; your four tasks.

Then override the Adapter's getView(...) method.
Based upon the 'position' (from the parameters of getView(....)), you
can return a View that is as complex as you want. You can use
'inflate' this view from XML or create the entire view
programatically. Look at the API Demos for list-view for sample code.

This complex view is selectable, since it is a list-item.


Sponsored Links

Layout question - how to replicate what the iPhone does...

by Jon Colverson » Tue, 28 Apr 2009 12:49:38 GMT


Yes, they can have images: use the drawableLeft etc. attributes, or
setCompoundDrawables() method. They can also be grayed out by using



Layout question - how to replicate what the iPhone does...

by Anna PS » Tue, 28 Apr 2009 20:34:59 GMT

 Thank you Jon, this is exactly what I needed!

best wishes,


Other Threads

1. Continuously scrolling ListActivity


Is it possible to have a list activity that dosen't finish? i.e. if
you scroll to the end of the list then the start of the list begins

It's be best if you could also disable the scroll bar.

Thanks for your help!



2. Configuring automated build scripts

I have an app that needs to be built in 3 versions, where the only
differences between the versions are a few strings that need to be
compiled with the app.
One of those strings is the IP address of a server where the app needs
to send data to, so for security reasons I want this to be compiled
with the app rather than be a config file that's loaded in runtime.

I want to set up a build script that would do the following:
1)  Build my the 3 versions of the apk, based on some param file for
each version, which would state the string values that should be
compiled into it.
I am imagining that this would be implemented by having the Android
source code import a specific strings file, and the build script would
replace that file for each version before compiling it.

2)  Also generate some server-side .php files that depend on
information from the build (e.g. the php file should have the latest
version number of the Android app).

3) In the end will create 3 output directories one for each build,
which have the respective .apk file and relevant .php files

4) Another note is that currently the app supports android 1.5 up to
2.1, and I read that sometimes build commands in Ant might be
different between 1.5 and newer versions.

5) It would also be great if this mechanism could be generalizable to
more than 3 apk versions in the future

I don't know much about build scripting. I've looked around and saw
that the Android full OS uses make/ files, saw some other
project that used "maven" to build android code (e.g. the "i-jetty"
project), and also saw some discussion about doing something similar
using Ant and the "" file. From what I've read, doing
this from within Eclipse is not really possible (or at least not

What would be the recommended (and easiest) approach to set up
something like this?



3. Selesai update f/w dan rooting gak bisa konek 3

4. EVO AVA-FROYO + Sense U

5. How should I do this?

6. NSPredicate-like functionality for Collections?

7. Selesai update f/w dan rooting gak bisa konek 3