user419138
user419138

Reputation: 1

How to implement a horizontal image gallery in blackberry, like a carousel or springboard in iPhone

I would like to create a blackberry component which has the following capabilities:

I'm able to do a simplified version of this where I have three image placeholders across the screen horizontally. When the user swipes, the images will change (i.e shift left or right, with the focused image in the center).

However, I want to know how I can implement smooth scrolling with momentum, showing the image locking in center when the user scrolls/swipes left or right.

Upvotes: 0

Views: 1691

Answers (1)

Maksym Gontar
Maksym Gontar

Reputation: 22775

You can try to use fields layout animation. The thing is to update layout position of several fields at the same time.

Otherwise try horizontal scrolling. Use custom HorizontalFieldManager with images and scroll from code.

No matter how you want to do this, you will have to write a function (x coordinate) = f(time) to get this smooth movement and centralization. Maybe even several functions.

Have a good luck!

Upvotes: 1

Related Questions