views:

442

answers:

4

I want to create a better NumberPicker then the one used in DatePicker, I looked at the HTC Sense Alarm clock Roller (Looks like the iPhone Spinner/Roller). I want to create something like that.

I've created a listView that looks right, but I need a way to get the current id of the middle row. ListView.getFirstVisiblePosition() kind of do what I want but it will give me +-1 errors. Another problem is that the scrolling should lock into a certain row when "dying" out. These are of couse related and I hope I can solve this by using a custom ListView, but it's hid in the API

Any thoughts on how to solve this?

A: 

Why don't you try to replace those three ListView cells with ViewFlipper objects. As with their help you might be able to flip in the middle.

Pentium10
A: 

Trying to force ListView to behave as a kind of widget it is not seems like a bad approach. How about writing the widget yourself? If I was going to sit down and write such a thing in the platform, I definitely wouldn't try to build it on list view, nor probably any other widget. It makes sense as its own kind of thing.

hackbod
A: 

Pentium10: That's not the functionality I want. I want a scrolling view that changes speed with the fling. Maybe you could elaborate?

hackbod: I would see this as writing a new widget, but reusing the ListView functionality. 90% of the operation of the ListView is what I need. I just need a good way for the ListView to stop so that the middle row is exactly in the middle. If I can solve that it's done.

Anders W
You should post these comments in reply to each of the individual answers, not as a separate answer.
Christopher
A: 

Did you find a solution for this??

Tim