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

SRAM 8kx8 Static RAM 6264 Family 8k x 8 DIP28 used - 4 pieces
$4.95
SRAM 8kx8 Static RAM 6264 Family 8k x 8 DIP28 used  - 4 pieces pictureAllen-Bradley VersaView 1500P 6181P-15NSXPH Intel Celeron 2GHz 512MB RAM 40GB HD
$499.99
Allen-Bradley VersaView 1500P 6181P-15NSXPH Intel Celeron 2GHz 512MB RAM 40GB HD pictureAS4C1M16E5-60JC Alliance Semi 16-MEG D-RAMs 60ns Lot of 10 Pieces
$19.99
AS4C1M16E5-60JC Alliance Semi 16-MEG D-RAMs 60ns Lot of 10 Pieces picture5A320J0, Code RAM51VV0, NGDD, 040108000, Maxtor 320GB IDE 3.5 PCB
$18.39
5A320J0, Code RAM51VV0, NGDD, 040108000, Maxtor 320GB IDE 3.5 PCB pictureNMC3764N-15, NMC3764N15 NATIONAL SEMI. DYNAMIC RAM 16 PIN DIP USED Qty 18
$24.0
NMC3764N-15, NMC3764N15 NATIONAL SEMI. DYNAMIC RAM 16 PIN DIP USED Qty 18   picture






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