effect of animation for horizontal field Manager

Hello
I have three willing fieldManagers horizontally in the content of

average fieldmanager will change on click of a button

is it possible to apply slide in French - sliding effect to these content?

I don't want to do the new screen n again?

Wrap the Middle Manager in a HorizontalFieldManager (HORIZONTAL_SCROLL). When you want to remove the old content and slide into the new, follow these steps:

(1) adds the new content the HFM;

(2) an animation slide to the left edge of the old content (probably 0) up to the left edge of the new (getLeft() returns). Use the method suggested by Peter;

(3) once the animation finished, remove old content and setHorizontalScroll on the HFM wrapping to 0 (since the new content now starts it).

Tags: BlackBerry Developers

Similar Questions

  • How to set horizontal scrolling to horizontal field Manager when fields are added using a loop for?

    The following code snippet contains a horizontal field Manager to which are added five buttons.

    1. I can't the value of horizontal scrolling to horizontal management Manager because of who I am not able to access the keys 4 and 5.

    2. usually, we put horizontal scrolling in the following way:

    container = new HorizontalFieldManager(USE_ALL_WIDTH|HORIZONTAL_SCROLL|HORIZONTAL_SCROLLBAR);
    

    3. so I also tried setting of horizontal scrolling in the following way

       container = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL|Manager.HORIZONTAL_SCROLLBAR)
                {
    
                    protected void sublayout(int maxWidth, int maxHeight) {
    
                        Field field = null;
                        int x = 0;
                        int y = 0;
                        int maxFieldHeight = 0;
                        int maxFieldWidth = 0;
                        for (int i = 0; i < getFieldCount(); i++)
                        {
                            field = getField(i);
                            layoutChild(field, maxWidth, maxHeight);
                            setPositionChild(field, x/*width-field.getWidth()*/,y);
    
                            x+=field.getWidth();
    
                            maxFieldWidth = maxFieldWidth + field.getWidth();
                            System.out.println("field width"+field.getWidth());
                            System.out.println(" max field width"+maxFieldWidth);
    
                            if(i==0)
                            {
                                maxFieldHeight = field.getHeight(); // height set of the first button since all components have the same height
                            }
                        }
                        System.out.println("final max field width"+maxFieldWidth);
    
                        setExtent(maxFieldWidth, maxFieldHeight);
    
                    }
                };
    

    but it's not working.

    4 I found this property: (position) horizontalFieldManager.setHorizontalScroll; that contains the parameterioo where the post is supposed to be the new horizontal scroll position. I tried passing the coordinate x of horizontal field Manager, but it does not work. I should pass as a parameter position?

    HorizontalFieldManager container = new HorizontalFieldManager()
    {
        protected void sublayout(int maxWidth, int maxHeight)
        {
            Field field = null;
            int x = 0;
            int y = 0;
            int maxFieldHeight = 0;
            for (int i = 0; i < getFieldCount(); i++)
            {
                field = getField(i);
                layoutChild(field, maxWidth, maxHeight);
                setPositionChild(field, x,y);
                x+=field.getWidth();
                if(i==0)
                {
                    maxFieldHeight = field.getHeight(); // height set of the first button since all components have the same height
                }
            }
    
            setExtent(Display.getWidth(), maxFieldHeight);
    
        }
    };
    
    ButtonField button1 = new ButtonField("Button1");
    ButtonField button2 = new ButtonField("Button2");
    ButtonField button3 = new ButtonField("Button3");
    ButtonField button4 = new ButtonField("Button4");
    ButtonField button5 = new ButtonField("Button5");
    
    container.add(button1);
    container.add(button2);
    container.add(button3);
    container.add(button4);
    container.add(button5);
    
    add(container);
    

    Need your valuable comments and suggestions. Please help me.

    I think that there is a bug in the sublayout (your HorizontalFieldManager 0 mode.  Given that the code did what I think WHAT HFM will do anyway, I recommend that you try to do this with a standard HFM, using this style:

    Manager.HORIZONTAL_SCROLL | Manager.HORIZONTAL_SCROLLBAR

    Let us know how you go.

    When I have more time I'll explain the bug, but if you want to investigate something, be aware that the maximum size that you can use in setExtent are the values that are passed to sublayout.  Compare the width as you try to define in setExtent whose width is increased.

  • Assign a spacing equal to the fields in the horizontal field Manager

    Hello

    I add a number of vertical field managers to a horizontal field Manager. Each manager of vertical field has a text with an image under. The text varies in width images in each vertical field Manager seem to have a different amount of space between them. Is there a way to remedy this situation? Joined a raw image in the way that message on the screen. How can I get the same amount of space between each area of the rectangle?

    Thank you

    Here's some code that I received from one of the sessions at the last DevCon.  Should be useful.  Might help explain customer managers too.

    /*
     * EqualSpaceToolbar.java
     *
     * Research In Motion Limited proprietary and confidential
     * Copyright Research In Motion Limited, 2009-2009
     */
    
    import net.rim.device.api.ui.*;
    
    public class EqualSpaceToolbar extends Manager {
    
        private static final int SYSTEM_STYLE_SHIFT = 32;
    
        public EqualSpaceToolbar() {
            this( 0 );
        }
    
        public EqualSpaceToolbar( long style ) {
            super( USE_ALL_WIDTH | style );
        }
    
        protected void sublayout( int width, int height ) {
            int numFields = getFieldCount();
            int maxHeight = 0;
    
            // There may be a few remaining pixels after dividing up the space
            // we must split up the space between the first and last buttons
            int fieldWidth = width / numFields;
            int firstFieldExtra = 0;
            int lastFieldExtra = 0;
    
            int unUsedWidth = width - fieldWidth * numFields;
            if( unUsedWidth > 0 ) {
                firstFieldExtra = unUsedWidth / 2;
                lastFieldExtra = unUsedWidth - firstFieldExtra;
            }
    
            int prevRightMargin = 0;
    
            // Layout the child fields, and calculate the max height
            for( int i = 0; i < numFields; i++ ) {
    
                int nextLeftMargin = 0;
                if( i < numFields - 1 ) {
                    Field nextField = getField( i );
                    nextLeftMargin = nextField.getMarginLeft();
                }
    
                Field currentField = getField( i );
                int leftMargin = i == 0 ? currentField.getMarginLeft() : Math.max( prevRightMargin, currentField.getMarginLeft() ) / 2;
                int rightMargin = i < numFields - 1 ? Math.max( nextLeftMargin, currentField.getMarginRight() ) / 2 : currentField.getMarginRight();
                int currentVerticalMargins = currentField.getMarginTop() + currentField.getMarginBottom();
                int currentHorizontalMargins = leftMargin + rightMargin;
    
                int widthForButton = fieldWidth;
                if( i == 0 ) {
                    widthForButton = fieldWidth + firstFieldExtra;
                } else if( i == numFields -1 ) {
                    widthForButton = fieldWidth + lastFieldExtra;
                }
                layoutChild( currentField, widthForButton - currentHorizontalMargins, height - currentVerticalMargins );
                maxHeight = Math.max( maxHeight, currentField.getHeight() + currentVerticalMargins );
    
                prevRightMargin = rightMargin;
                nextLeftMargin = 0;
            }
    
            // Now position the fields, respecting the Vertical style bits
            int usedWidth = 0;
            int y;
            prevRightMargin = 0;
            for( int i = 0; i < numFields; i++ ) {
    
                Field currentField = getField( i );
                int marginTop = currentField.getMarginTop();
                int marginBottom = currentField.getMarginBottom();
                int marginLeft = Math.max( currentField.getMarginLeft(), prevRightMargin );
                int marginRight = currentField.getMarginRight();
    
                switch( (int)( ( currentField.getStyle() & FIELD_VALIGN_MASK ) >> SYSTEM_STYLE_SHIFT ) ) {
                    case (int)( FIELD_BOTTOM >> SYSTEM_STYLE_SHIFT ):
                        y = maxHeight - currentField.getHeight() - currentField.getMarginBottom();
                        break;
                    case (int)( FIELD_VCENTER >> SYSTEM_STYLE_SHIFT ):
                        y = marginTop + ( maxHeight - marginTop - currentField.getHeight() - marginBottom ) >> 1;
                        break;
                    default:
                        y = marginTop;
                }
                setPositionChild( currentField, usedWidth + marginLeft, y );
                usedWidth += currentField.getWidth() + marginLeft;
                prevRightMargin = marginRight;
            }
            setExtent( width, maxHeight );
        }
    
    }
    
  • How to change the background color of the horizontal field Manager

    How can we tell the background color of the horizontal field Manager (hfm) hanger

    If we should extend and override in ppaint, I tried

    I got color of hfm in tag I added to this

    all give me idea

    Try this:

            HorizontalFieldManager manager = new HorizontalFieldManager()
            {
                public void paint(Graphics graphics)
                {
                    graphics.setBackgroundColor(0x000000FF);//blue
                    graphics.clear();
                    super.paint(graphics);
                }
            };
    

    Concerning

    Bika

  • UI - Custom Paint in Horizontal Field Manager after completing the setting scrolling

    Hello

    I am able to do horizontal page scrolling when you add fields in horizontalFieldManger.

    But now I want to do a custom in horizontalFieldManager, paint using the page horizontal scrolling top given adjustment.

    Thank you

    It seems that you want to have background - repeat some almost text in your example. Then move it out of the subpaint and by the paintBackground-, you will not have to invoke any Super... here.

    Now when you say that a horizontal scrolling does not work, what exactly do you see? What do you see? Do you have enough focusable fields in your handler for scroll? Have HORIZONTAL_SCROLL style bit set?

  • some fields shows don't not in horizontal field Manager

    Hello

    I try to have several lines with label, number and units. For example temperature, 17, F. When the application draws lines the label is visible, but the units are not. No idea why? Maybe it's pushing too far to the right, and they are off the screen? I use the Simulator for this.

    I tried to limit the size of the label field with no luck and I have also experimented with eliminating the label field, which causes the units to appear but then of course I still need labels. My code is below:

    Private HorizontalFieldManager generateMeasurementField (label As String, String unitLabel) {}
    Line HorizontalFieldManager = new HorizontalFieldManager();
    Field TextField = new TextField();
    field.setEditable (false);
    field.setLabel (label);
    UnitField TextField = new TextField();
    unitField.setText (unitLabel);
    unitField.setEditable (false);
    Row.Add (Field);
    Row.Add (unitField);
            
    next row;
    }

    And then I subsequently add each row to the Senior Manager.

    TextField is eager for width: it occupies the entire available width (do not leave anything for the rest of the fields). If you do not need to edit the text, use LabelField instead: they are economical and meet only as needed.

  • How to add the line of separation in the horizontal field Manager

    I want to get as

    name | Age | year

    all this in a horizontalfield Manager, how to do.

    I used the field separator, comes to the entire screen, such as

    name | Age | year

    |       |

    |       |

    |       |

    How do I solve this problem

    Thank you

    You can also do this by substituting your HorizontalFieldManager sublayout() method.

    As:

            h = new HorizontalFieldManager()
            {
                protected void sublayout( int maxWidth, int maxHeight )
                {
                    int width = Display.getWidth();
                    int height = 30; //height of the manager
    
                    super.sublayout( width, height);
                    setExtent( width, height);
                }
    
            };
    

    Concerning

    Bika

  • align the horizontal field Manager

    Hello

    I need where I want my horizontalfieldmanager just above the horizontalfieldmanager another which is initilized as setStatus... (below the screen)...

    use an optimization of resources, place the two hfms, use setStatus with optimization of resources.

  • field label and text field editing in vertical field Manager

    Hi, am new to the blackberry development. Developing an application in which I placed the field label and modify the field in the Manger of two vertical field and place them in a horizontal field Manager, but when run the present I don't see the label text field I see am doin BB 4.7, following is my code

    LabelField name = new LabelField ("first name :")
    {
    public void paint (Graphics g)
    {
    Super.Paint (g);
    g.setColor (Color.BLACK);
    Do police = this.getFont (.derive(Font.DROP_SHADOW_RIGHT_EFFECT |)) Font.ENGRAVED_EFFECT, h);
    this.setFont (do);
    }
    };
     
    FirstName = new EditField ("Name", "", 25, EditField.FILTER_DEFAULT |) FIELD_RIGHT) {}
    {} public void paint (Graphics g)
    getManager () .invalidate ();
    Do police = this.getFont () .derive (Font.DROP_SHADOW_RIGHT_EFFECT |) Font.ENGRAVED_EFFECT, h);
    this.setFont (do);
    g.drawRect (6, 0, (int) (Display.getWidth()/1.8), getHeight());
    Super.Paint (g);
    }
    };
    HorizontalFieldManager hrMgr = new HorizontalFieldManager();
    final VerticalFieldManager vfMgr2 = new VerticalFieldManager();
    VerticalFieldManager vfMgr1 = new VerticalFieldManager()
    {
    protected void sublayout (int width, int height)
    {
    int w = (int) (Display.getWidth () - vfMgr2.getPreferredWidth () - 20);
    Field field;
    int fieldCount;
    int x = 0;
    int y = 0;

    fieldCount = getFieldCount();
    int d = (int) ((Display.getWidth()/4.5));
    for (int i = 0; i)< fieldcount;="">
    {
    field = getField (i);
    setPositionChild (field, x, y);
    layoutChild (field, w, height);
    y += field.getContentHeight ();
    }
    setExtent (d, a);
    }
    };
    vfMgr1.add (Name);
    vfMgr2.add (FirstName);
    hrMgr.add (vfMgr1);
    hrMgr.add (vfMgr2);
    Add (hrMgr);

    The same a s job well if put a choice field of object instead of text edit field is I see the field and choice of subject field in a single line, but is not in the case of text editing field, please help me on this point, Thanhs beforehand.

    Thanks for your valuable reply Mr.simon,

    But I have reached my goal by adjusting the width of vertical field nursery and got a solution... These are the changes I made in my sublayout...

    protected void sublayout (int width, int height)
    {
                    int w = (int) (Display.getWidth()/1.3);
    Field field;
    int fieldCount;
    int x = 10;
    int y = 0;

    fieldCount = getFieldCount();
                  int d = (int) ((Display.getWidth () / 3));
    for (int i = 0; i)< fieldcount;="">
    {
    field = getField (i);
    setPositionChild (field, x, y);
    layoutChild (field, w, height);
    y += field.getContentHeight ();
    }
    setExtent (d, a);
    }
    };

  • Horizontal area manager

    Hello

    I have a HorizontalFieldmanager that contains two buttons fields... I added these two buttons for that HorizontalFieldmanager... I want the buttons should be the central position of the screen... but they are coming up on the left side of the screen... I used like this

    HorizontalFieldManager hfm=new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH|HorizontalFieldManager.FIELD_HCENTER);
    
    ButtonField submit=new ButtonField("Submit",ButtonField.FIELD_HCENTER|ButtonField.HCENTER);
    
    ButtonField cancel=new ButtonField("Cancel",ButtonField.FIELD_HCENTER|ButtonField.HCENTER);
    

    HorizontalFieldManager does not respect the horizontal alignments because it has its own approach to horizontal placement.  VerticalFieldManager respect that, though.  The simplest approach would be to:

    • Create two button controls - without the alignment style bits (I give them usually CONSUME_CLICK and NEVER_DIRTY but it's different)
    • Create a horizontal field Manager - with FIELD_HCENTER as one of the style bits
    • Add these two buttons in the horizontal field manager
    • create a handler of vertical field with USE_ALL_WIDTH as one of the style bits
    • Add horizontal management Manager to the vertical field manager

    This way your horizontal field Manager will place the buttons next to each other while the vertical field Manager notice the flag FIELD_HCENTER on the HFM and Center the gadget all the width of the screen (it's why we USE_ALL_WIDTH here)

  • Delete scrolling of the development of horizontal area manager.

    Hello

    I create a project where I have a horizontal field Manager that contains a set of vertical field managers. I've implemented the buttons on each vertical field Manager that allows a horizontal scrolling through the horizontalfieldmanager.

    Red = Horiontal Field Manager

    Blue = Vertical responsible field (each of them is a full screen width)

    Green = buttons to scroll through each VFM

    My problem is that there are fields focusable in each optimisation of resources, which means that I am able to scroll horizontally HFM using the trackpad.  I don't want that.  I want that the only method of scrolling horizontally to be pressing the green buttons.  This ensures that my VFM is centered.

    I would still be able to scroll horizontally through each VFM with the trackpad.

    Any ideas would be appreciated.

    Thank you

    Probably the best thing to do would be to substitute navigationMovement and simply return true if dx! is 0 (otherwise return super.navigationMovement).

  • Horizontal scrolling for the GridField Manager problem

    Hi all

    I have my working in the Application in which I have my display my data using GridField Manager. I used the code in the example given in link by tboatright of the user.

    Now in my application, I used the extension of the screen and it automatically gives the vertical scroll bar if the total height of lines in my GridField Manager is more than BB Simulator screen. In using this I can scroll vertically easily by substituting navigationMovement (int dx, int dy, int, int time status) method...

    Now the problem is, I have 6 columns in my network manager and their width is 80 each. So only 3 columns are displayed on the Simulator screen when the first time grid is displayed but I get no horizontal scroll bar, I m not able to scroll horizontally through my all columns. Now using dominant navigationMovement (dx int, int dy, int, int time status) method (in accordance with its encoding in the above link), I am able to setFocus on the columns by pressing the left/right keys on my keyboard on Simulator of BB, but with this screen doesn't move (scroll) left or right accordingly if I m not able to see column4 column 5, column6, which are placed to the right of the main screen width of BB.

    I hope that my question in the clear for you guys...

    Thanks in advance

    You have set the style for the screen like HORIZONTAL_SCROLLBAR and HORIZONTAL_SCROLL? because the style VERTICAL_SCROLL and VERTICAL_SCROLLBAR will be set by default. We must define explicitly for horizontal scrolling

  • Dettach Field Manager for reuse with other managers

    Is it possible to use a field (same instance of a field) with many managers (not at the same time). Let me explain further.

    I spread a field class that retrieve multiple images from the internet using httpconnections. What I want is to use the same field in different eras with different managers like this:

        HorizontalFieldManager Manager1 = new HorizontalFieldManager();
        HorizontalFieldManager Manager2 = new HorizontalFieldManager();
        VerticalFieldManager Manager3 = new VerticalFieldManager();
    
        myField webField = myField("http://www.myurl.com/contents"); //--> This brings lots of information
    
        private void showInManager1(){
            Manager1.add(webField);
        }
    
        private void showInManager2(){
            Manager2.add(webField);
        }
    
        private void showInManager3(){
            Manager3.add(webField);
        }
    
        myapp(){
            showInManager1(); //--> if I do this here no problem.
            showInManager2(); //--> As the "global" myField is already "attached" to the Manager1 an exception is thrown.
            showInManager3(); //--> Same here
        }
    

    As well as the code above what I want is to reuse the same domain instead of creating a new instance every time like this:

     HorizontalFieldManager Manager1 = new HorizontalFieldManager();
        HorizontalFieldManager Manager2 = new HorizontalFieldManager();
        VerticalFieldManager Manager3 = new VerticalFieldManager();
    
        myField webField = myField("http://www.myurl.com/contents"); //--> This brings lots of information
    
        private void showInManager1(){
            Manager1.add(webField);
        }
    
        private void showInManager2(){
            Manager2.add(webField);
        }
    
        private void showInManager3(){
            Manager3.add(webField);
        }
    
        private void dettachFromManager(myField theField){
            thefield.dettach() //--> This doesnt exist, this is what I want to do.
        }
    
        myapp(){
            showInManager1();
            dettachFromManager(webField);
            showInManager2();
            dettachFromManager(webField);
            showInManager3();
        }
    

    I hope it's clear enough to explain what I want to do. Any help or comment is appreciated.

    Iron

    Thanks for your information. Anyway what I was looking for was a way for the field of dettach or remove itself from the existing Manager. I don't know why I can't last night (maybe I was asleep).

    Here's how I found works for me. I just added the function below to my extent of myField:

     public void dettach(){
            try{
                Manager _manager;
                _manager = this.getManager();
                _manager.delete(this);
            }catch(Exception ex){
                System.out.println("     ERROR->" + String.valueOf(ex));
            }
        }
    

    And called it right when I need it. Easy.

    Thanks, I hope this can help others.

  • How to extend your horizontal field of vision for Cisco TelePresence PrecisionHDMC camera

    Hello

    We use the camera PrecisionHDMC of Cisco TelePresence, but we want to expand the horizontal field of vision?

    Do what van?

    Kind regards

    Martin

    Hello Martin

    Telepresence PrecisionHDMC camera comes with the fixed maximum VISION field, depends on the model you have.

    Please visit this link:

    http://www.Cisco.com/en/us/prod/collateral/ps7060/ps11307/ps11335/data_sheet_c78-669051.PDF

    Thank you

    Rafal

  • problem with the vertical field Manager

    Hello

    My application has a screen. On this, I add a Senior Manager vertical field. I add new labelfields dynamically to this vertical field Manager.  When I give the text in the constuctor of the etiquette field, each of them is the fine display. But when I tried to draw the text to the painting, it does not appear.

    Here is my code...

    vfm = new VerticalFieldManager(VERTICAL_SCROLL | FOCUSABLE);
            for (int i = 0; i < 4; i++) {
                index = i;
                LabelField labelField = new LabelField() {
                    protected void paint(Graphics graphics) {
                        // TODO Auto-generated method stub
    //                  super.paint(graphics);
                        graphics.setColor(Color.BLACK);
                        graphics.drawText(displayString[index], 0, 0);
                    }
                };
                vfm.add(labelField);
            }
            add(vfm);
    

    Please help me find a solution.

    First of all, stop saying that it is VerticalFieldManager who has done something bad for you. It has nothing to do with it.

    You use the index in your LabelField painting method. Use paint value is the current value of the index at the time of the painting. Painting happens way after you have created all your LabelFields, when the index stopped to change and has the last value of the loop variable (in your case, it's 3).

    This, as well as LabelFields width zero (that you seem to have supported) so are the problems of your original code. Store the value of i in your LabelField somehow if you insist on using the table values. If only check out you them once and do not change them, consider creating your LabelFields with the text from this displayString table.

    Even better: as you do not use the LabelField paint, why not create a custom field received a text and paint your smileys and all? Of course, you have to implement available as well, but it's useful even when your smileys will take a different width than the corresponding symbols.

    To summarize: your current approach is bad. Take a step back, work on the design, and then implement.

Maybe you are looking for