BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-04-2009, 09:25 AM   #1 (permalink)
New Member
 
Join Date: Aug 2009
Model: 8800
PIN: N/A
Carrier: none
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Cancel scrolling in Layout Manager

Please Login to Remove!

Hi, I can't find solution for the following problem. I have custom list field, which overlaps the boundaries of its layout manager. List field consumes navigation events from manager to highlight currently selected row with special color. Layout manager is configured to support scrolling. When I scroll trackwheel down, layout manager invokes scrolling and then passes navigation event to its child, the list field. It results in inproper scrolling, because manager scrolls the whole list down to its bottom hiding list rows on the top including the selected row.

What I want is to ignore scrolling while currently selected list row is still visible and employ it otherwise.:bb:
Offline  
Old 09-15-2009, 04:38 AM   #2 (permalink)
New Member
 
Join Date: Aug 2009
Model: 8800
PIN: N/A
Carrier: none
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Solution

Crossposted solution from stackoverflow (Cancel scrolling in Layout Manager)

Hi, all here's the solution that helped me. By overriding moveFocus in such specific way I managed to modify default behavior of scrolling in layout manager - it skips first items of list field allowing them to stay on top.

Code:
public int moveFocus(int amount, int status, int time) {
        invalidate(getSelectedIndex());

        int unused = super.moveFocus(amount, status, time);
        return Math.abs(unused) + 1;
}

Last edited by nixau : 09-15-2009 at 04:40 AM. Reason: upd
Offline  
Old 10-26-2009, 08:53 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You dont have to use navigationmovement in the manager.

Instead make soem change in your custom list..

in drawListrow method add following lines

int selectedIndex = list.getSelectedIndex();
if(selectedIndex == index){
//your code here...
}
__________________
Crazy for BlackBerry
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.