karabara
karabara

Reputation: 557

Implementing ListView in home screen widget

How to make widget with something like ListView. I've made it using LinearLayout but I don't know how to discover amount of rows. (I want to know exact amount of rows to make widget able to paging)

I want it to look like this (photoshop and copypast):

enter image description here

Notes:

  1. Android 2.3.4 and below.
  2. widget of size 4x4

UPDATE AND CLARIFICATION:

When I said "scrollable" I mean scroll by click on UP and DOWN buttons (you see it on the screenshot) ie paging

Upvotes: 10

Views: 1389

Answers (2)

Anton
Anton

Reputation: 570

I do not know how to determine real size the widget 4x4 in dp. It seems that it can be determined only by knowing the specific device.

You can scroll by fixed number of rows.

Upvotes: 2

Gunnar Karlsson
Gunnar Karlsson

Reputation: 28470

The only pre 3.0 example with source I know of is the ScrollableContacts project on Google Code. It features a scrollable list in a home screen widget and works from 2.1. However, the widget requires a home replacement - see the project description. The source can be viewed here.

Upvotes: 1

Related Questions