How to make inline LabelFields

I work in a Blackberry app (OS 5.0) and must show the latest tweets of the user.
I am able to get the end of Twitter data. Now after reviewing entities (hashtags, URLS, user-mentions etc.), I need to display with different formatting (color, bold etc.). If I use different LabelFields for different parts of the tweet.
But LabelFields by default block elements. How do I put "inline" these LabelFields, so that it looks to the way it is shown in Twitter?

Like this:

In fact, there is a field that was made specifically for this purpose - ActiveRichTextField. You can even navigate between the different "regions" of this field and click different reactions in different regions.

Tags: BlackBerry Developers

Similar Questions

  • How to make a LabelField align right when the text is long?

    In order to make a good LabelField aligned, I create the LabelField with style "FIELD_RIGHT and add it to a value for money, it works when the text can be displayed on a single line." But when the text is long, over a single line, it works well.

    For example, if the text is "ABDEL FARZAD", appears like this:

    It looks like aligned left

    How can I get it?

    .

    No guarantee, but instead of Field.RIGHT, try

    FIELD. USE_ALL_WIDTH | DrawStyle.RIGHT

  • How to make a labelfield right aligned text

    I want to make my label text aligned to right field in then the screen

    LabelField content = new LabelField(description,LabelField.FOCUSABLE|USE_ALL_WIDTH|FIELD_RIGHT)
    

    This labelfield, I add to an optimization of internal resources

    VerticalFieldManager vfm = new VerticalFieldManager (
                    VerticalFieldManager .VERTICAL_SCROLL
                            | VerticalFieldManager .FOCUSABLE) {
                protected void sublayout(int width, int height) {
    
                    super.sublayout(Display.getWidth() - 20, height);
                    setExtent(Display.getWidth() - 20, 33);
                }
            };
    

    This optimization of internal resources, I add to main vfm called external resources management and in defining its position

    layoutChild(vfm, maxWidth, maxHeight);
                        setPositionChild(vfm,290, 123);
    

    My screen is 320 x 240

    But the text goes out of the screen. Help, please

    Forget all the positioning in the Manager and try this:

    Content LabelField = new LabelField (description, LabelField.FOCUSABLE |) DRAWSTYLE. (RIGHT);

    Announcing this to a VerticalFieldManager or directly to your screen and I think this should work for you.

    If this is not the case, let know us and we can look at the positioning of the field.

    As a side note, it seems doubtful:

    protected void sublayout (int width, int height) {}
    Super.sublayout (Display.GetWidth () - 20, height);
    setExtent (Display.getWidth () - 20: 33);
    }

    What you trying to do?  Why is the 33 important?

  • How to create a labelfield with fixed width and dynamic height?

    I got this question in fact for a long time and I have not found answer in this forum so far.

    As we know, we can use:

    public int getPreferredWidth()
    {
        return fixedSize;
    }
    
    protected void layout(int width,int height)
    {
        super.layout(getPreferredWidth(), getPreferredHeight());
        super.setExtent(getPreferredWidth(), getPreferredHeight());
    }
    

    to set the width fixed in a field, but if the text is too long and should be multiline, this will bring problem, getPreferredHeight() only returns the preferred height, which is actually not the actual height, so the text will be hashed.

    So what should this setting? height?

    super.setExtent(getPreferredWidth(), height));
    

    No.... the height value is too large.

    So, how can we set this parameter to make this labelfield looks perfectly.

    Any idea?

    A search on the web is expected to increase a lot of examples of functions in Java text wrapping. Especially for BlackBerry, you can use Font.getAdvance (String text, int start, int len) to measure the width of a text segment without the expense of creation of substrings.

    The basic logic is to analyze the text character by character. If the "\n" character, force a line break. If the character is a space, then it is a line break candidate; Check if the line so far is set. If so, then move the candidate to that character end and continue; If this is not the case, go back to the previous candidate break and put an end to the line right there. The loop is initialized so that there is always at least one character on the line. The process ends when you run out of text. Details (including dealing with empty text, several spaces, etc.) are kept as an exercise for the reader, or search the Web well.

    I wouldn't worry efficiency. Put on the page of the field is not all that often, and when it's done, there's no escape from the need to make the work of packaging line at some point before the text is rendered on the screen. One way to avoid unnecessarily repeating work is to memoize the function of packaging line: wrapped lines and the width of the film cache and reuse them as needed. The cache is marked invalid if changes to text or the current width and the width of the film cached differ.

  • How to make the decrement on listField list?

    IM create code like this:

    public class ScreenList extends MainScreen implements ListFieldCallback{
        String x[];
        ListField list;
        public ScreenList(){
            String arr[] ={"1", "2","3","4","5","6"};
            list = new ListField();
    
            int length = arr.length;
            x = new String[ length];
            for(int i=length-1; i>=0; i--){
                x[i]=arr[i];
                //add(new LabelField(arr[i]);
            }
            list.setSize(length);
            list.setCallback(this);
            this.add(list);
        }
    
        public void drawListRow(ListField arg0, Graphics arg1, int index, int y,
                int width) {
            // TODO Auto-generated method stub
            arg1.drawText(x[index], 0, y);
    
        }
    

    If I always try on Simulator Simulator print 1,2,3,4,5,6, but if I try to print to new Label 6,5,4,3,2,1 result

    My question... How to make the decrement with listField list implements reminder? Thanks in advance...

    Oops sorry correction instead of length use length - 1

  • How to make animated gifs to work in FCPX?

    Hello

    How to make animated gifs to work in FCPX?

    They work in FCP7 (FCS) but not FCPX. Strange.

    assailed

    Elmer

    If you had FCP7, you have Quicktime 7 Pro (upgraded automatically at installation FCP7). Check your Applications > Utilities folder.

    Open the gif in QT7 and export as... (Sequence Quicktime Movie > Open Options)... might as well go with ProRes LT and make sure that you pay attention to the size option (select current if the original is 100%).

  • How to make live iPhone photos 7

    How to make a live Webcam picture on my new iPhone 7

    http://help.Apple.com/iPhone/10/#/iph1e767793c

  • Can you please tell me how to make the thicker arrows on the Pages.

    Can you please tell me how to make the thicker arrows on the Pages. Thank you very much. There is something incredibly simple to do, but I, having a disconcerting brain, am totally unable to understand. Please please help me. Thank you

    < re-titled by host >

    Try here > Pages for Mac: Add and edit forms

  • How to make the list of instrumental music

    How to make a list of all my player someone help

    Alan

    iTunes is not a method to determine what tracks have vocals. You can create a normal playlist and put what you want in it.

    TT2

  • How to make itunes on an Android 5.1.1

    How to make itunes on my android5.1.1

    Do you mean how can you get an app called iTunes on your Android? If so, you can't. You can, however, download the app Apple music store Google play.

    Or, do you mean, how can you get the music you bought on the iTunes Store on your Android? You would be transferred in any way that you usually transfer the music on your phone. Drag and drop generally works very well.

  • How to make a wired internet connection to my macbook pro?

    How to make a wired internet connection to my macbook pro

    < removed >

  • How to make an update of location to a group of photos at the same time?

    How to make an update of location to a group of photos at the same time?  This used to be a feature in iPhoto.

    I use El Capitan 10.11.6 and Photos 1.5

    If yu have OS X 10.5.1 s you say that you can not - with OS X 10.11.6 Photos 1.5 (a free update in the app store) you select them and info - enter the location and it will apply to all photos

    LN

  • How to make a screenshot?

    How to make a screenshot?

    We can help with Firefox for Android, but we still don't know the ins and outs of the differences in system on all Android devices. To do this, you could use an Android-enthusiast forum like: http://forums.androidcentral.com/

  • When I reply to an email with attachments, I lose the original email attachments. How to make a comeback?

    When I reply to an email with attachments, I lose the original email attachments. How to make a comeback?

    Peter

    MacAir mid 2013

    MOSX 10.11.6

    Consult your mail > Preferences > composition > include all of the original text

    Mail > Preferences > accounts > advanced

  • How to make a white sticker in Photos?

    How to make a white sticker in Photos?

    The strength of the tile has a negative value. Then the tile will turn into a White halo instead of a dark vignette.

    With an elasticity of-1,00:

Maybe you are looking for

  • Bookmark function icon not the same as in previous versions of FF

    I just installed FF 15.0.1.When as I click the icon of bookmarks (a blue with star), I have a menu drop-down useless. In older versions, clicking on this icon will cause the Bookmarks Sidebar is displayed with all my favorites in there. Now I have to

  • Home Edition XOOM: Software Update/update News

    Please subscribe to this thread. As any new update for the general public becomes available, it will be displayed here. To subscribe to this thread, click on the link to the right of "Receive the Notifications by Email" If you subscribe it will chang

  • Pavilion dv6: failure of hard drive test

    my system does not work and I tried to go to safe mode but is not wor and I trried to do system test and there all tests except the short DST hard drive, it failed with the following information Failure ID: OLKQ0F-5SW7JD-QFPH5A-60XE03 PRODUCT ID: A7M

  • Stolen Hotmail accounts

    I wish that everyone in the forum knows, it's a total waste of time to ask for help here because there are no positive responses and the just wishful thinking. The owners of hotmail with their money and resources should have enough we find a way to a

  • Vista Media Center - TV station changed its frequency. Media Center cannot find station on the new frequency.

    My ABC (Cincinnati) local affiliate, WCPO, today broadcasting on Channel VHF 9 - 09/12/2010. They are now on a UHF frequency radio. I don't know what channel/frequency. When this switch occurred, Media Center has started to display the message "No TV