Nick
Nick

Reputation: 820

Android: Custom ListView

I want to create list view just like this: http://dl.maximumpc.com/galleries/androidpower/Alarm_full.jpg I need to create view like on second and fourth screens. As for fourth screen, it seems that each row has it's own layout... I've searched Internet and even downloaded alarm source code from git repository, but it doesn't contains what I want. Any help would be useful. Thanks!

Upvotes: 0

Views: 862

Answers (2)

kevin lynx
kevin lynx

Reputation: 895

Yes, as John J Smith said, it's not very complicated. And i'm sure there are many articles on Internet about how to build a custom list view(at least there're many in China).

And here is a general way to do this: To custom a list view, follow these ways in general: 1. create your own list adapter, usually extends BaseAdapter, write getView method etc; 2. bind your adapter to a list view; 3. write a layout file implements your list view item, and bind data in your adapter.

Especially, if your custom list view item has a button/checkbox/etc, you'll need more work.

Upvotes: 0

John J Smith
John J Smith

Reputation: 11923

The second screen is pretty straightforward. It's basically a RelativeLayout with a full-width button at the top and a listview. The listview items will use a custom layout e.g. a RelativeLayout with a Button showing the time, a TextView to show the description, a TextView to show the selected days and a CheckBox to indicate selection. The fourth screen looks like a preference activity which can be built up from an xml file and/or custom preferences.

Upvotes: 1

Related Questions