01-30-2012 03:08 AM - edited 01-30-2012 05:47 AM
I want to add scroll bar paging with page indicator. The indicator page is like in this picture indicator: I have 5 pages and the blue circle indicate the current page. There is blackberry application uses this indicator. How can I add this indicator????
01-30-2012 04:23 AM
I am not aware of a control that does this natively in BlackBerry. I think you will have to do this yourself. Other people have asked similar questions. Look for various other similar Threads on this forum that have discusses Horizontal Scrolling for ideas on how to do this.
02-01-2012 08:31 AM
Thanks for your reply
When I search about Horizontal Scrolling, I find the problem of scrolling or how to make new page but there is no indication how to make the indicator of pages
02-01-2012 08:56 AM
02-01-2012 09:38 AM - edited 02-01-2012 02:58 PM
Simon is right, you have to code this.
There are actually a variety of ways of doing it. The easiest I think is to override sublayout and make the HFM slightly larger giving you space to add the indicators at the bottom. Then override paintBackground to paint the dots depending on the number of Fields you have in your HFM.
This is non trivial code, if you are struggling to understand what I am talking about then I think this is a step too far. Start with something simpler.
As an example, write your own Manager that extends HFM and remembers the Field that was in focus, when it looses focus (onUnfocus). Then, when the HFM gets focus back (onFocus) through scrolling (trackpad), it makes this Field is in Focus, not the one at the start or end, which is what it will normally do (try it and see). You have to write this anyway for your page indicator, so this will be good practice.
02-01-2012 02:46 PM
If you are looking for ideas on how to implement it, take a look at the following knowledge base article:
It talks about a scrollbar for vertical scrolling but should be easy to customize to do horizontal instead. Then take the code actually painting the scrollbar and modify it to suit your needs.
There are some comments in the article, including one with a slightly different approach (VerticalOverlayScrollManager). Compare the two approaches - this will be a very good exercise, directly relevant to what you are trying to achieve.