BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-24-2008, 10:37 PM   #1
ambar
New Member
 
Join Date: Jul 2008
Model: 7100T
PIN: N/A
Carrier: sad
Posts: 14
Default ScrollChangeListener

Please Login to Remove!

Hi

I tried making a Terms and conditions screen wherein the user gets an option to move to the next screen when he has scrolled to the end of the screen.I thought using the ScrollChangeListener would solve my problem and well it did.

I tested it some time back and it worked like a charm.But in the last few days I am unable to get it to work .I know it sound ridiculous but its not working.Can anybody help me out in this.The problem now is that the listener is not called by the system which implies that it is not getting set properly.

Please hep.Here's the code:

Code:
 public TandC(  )
    {   
        Font boldFont = Font.getDefault().derive( Font.BOLD );
        int fontHeight = Font.getDefault().getHeight();

        Font labelFont = Font.getDefault().derive( Font.BOLD,
                                                   fontHeight + 4,
                                                   Ui.UNITS_px );
        Font italics = Font.getDefault().derive( Font.ENGRAVED_EFFECT|Font.ITALIC|Font.JAPANESE_HINT);
       //TODO:
        LabelField title1 = new LabelField( "mainTitle",
                                            LabelField.FIELD_HCENTER );
        title1.setFont( labelFont );
        setTitle( title1 );

        LabelField title = new LabelField( "title2" ,LabelField.FIELD_HCENTER);
        title.setFont( boldFont );
        add( title );
        //for spacing
        add( new LabelField("") );
        
        LabelField title2 = new LabelField( "Terms And Conditions" ,LabelField.FIELD_LEFT);
        title2.setFont( boldFont );
        add( title2 );
        
        add( new LabelField("") );
        LabelField content = new LabelField("a lot of text  a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text a lot of text ", LabelField.FIELD_LEFT );
        content.setFont( italics );
        add( content );

        setScrollListener( new ScrollListener() );
//I have also tried setting this listener to a verticalfield manager which adds the above "lot of text" field and then adds itself to the screen.
    }

    class ScrollListener implements ScrollChangeListener
    {
//Control wont come here.Thats my problem!!!
        public void scrollChanged( Manager manager, int newHorizontalScroll,
                                   int newVerticalScroll )
        {
            if( !m_TandCread
                    && ( newVerticalScroll >= ( manager.getVirtualHeight() - manager.getVisibleHeight() ) ) )
            {
                m_TandCread = true;//signifies if the screen has been scrolled to the bottom.
            }
        }

    }
Please help me out with this

Last edited by ambar; 09-24-2008 at 11:43 PM..
Offline  
Old 09-25-2008, 01:03 PM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

Why not just add a button to the bottom of the screen, "I agree" ??
Offline  
Old 09-29-2008, 12:35 AM   #3
ambar
New Member
 
Join Date: Jul 2008
Model: 7100T
PIN: N/A
Carrier: sad
Posts: 14
Default

thankx 4 ur reply.
Its a requirement that I need to adhere to.
Could u point put something wrong in the code? I guess its something to do with setting the listener.
Could anyone try out this code and play a bit...
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Jelenko Commodore LS VPF with Pump  picture

Jelenko Commodore LS VPF with Pump

$875.00



Mitsubishi Control Board DM00N649.  SM76A127G02 . Ductless unit 47-0910KR (C64) picture

Mitsubishi Control Board DM00N649. SM76A127G02 . Ductless unit 47-0910KR (C64)

$120.00



POLAR PLASTICS C64 Construction Film,6x100,4Mil,Clear PK 4 picture

POLAR PLASTICS C64 Construction Film,6x100,4Mil,Clear PK 4

$178.04



Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC picture

Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC

$49.00



Windsor Commodore Duo 20

Windsor Commodore Duo 20" Carpet extractor w/Lester Charger 25900/Battery/99hour

$2911.95



Mahlo K 1313 /w Base Terminal 2263036 SKBI 64/C64 Gepruft PLC K1313 Dual P/I picture

Mahlo K 1313 /w Base Terminal 2263036 SKBI 64/C64 Gepruft PLC K1313 Dual P/I

$650.00







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