The field as Native SMS inbox list...

Hello everyone...

I made a request message in which I created an Inbox using the list field... I get 3 problems in that:

(1) I stated the height equal to 40 before that I have to draw any text in the field and when I draw the text I followed it by a line to separate the two elements. His work well except for the first item whose row height does not change, and neither the line is drawn after...

(2) Secondly, I want to have things in order, the latter comes on top... right, the opposite... How do I do that?

(3) Finally, I wanted to know we can create our field list similar to the SMS Inbox native blackberry?

Here's my code for the ListCallback for the list:

class ListCallback implements ListFieldCallback {

private Bitmap _rImage;
private Bitmap _urImage;
private Vector listElements = new Vector();
private String cpa = "flse";

public void drawListRow(
ListField list, Graphics g, int index, int y, int w) {
w = Graphics.getScreenWidth();
  if (list.getRowHeight() != 40) {

      list.setRowHeight(40);
    }

_rImage = Bitmap.getBitmapResource("read.png");
_urImage = Bitmap.getBitmapResource("unread.png");

String texti = (String)listElements.elementAt(index);
int ind = texti.length() - 4;

String check = texti.substring(ind);
String text = texti.substring(0,ind);

System.out.println(list.getRowHeight());
if(check.compareTo(cpa) == 0){

g.drawBitmap(0,y,30,30,_urImage,0,0);
g.drawText(text, 31, y, 0, w);

g.setColor(Color.LIGHTGREY);
int yPos = y - 2;
g.drawLine(0, yPos, w, yPos);
}

else
{
g.drawBitmap(0,y,30,30,_rImage,0,0);
g.drawText(text,31, y, 0, w);
}
g.setColor(Color.LIGHTGREY);
int yPos = y + 30;
g.drawLine(0, yPos, w, yPos);

}

public Object get(ListField list, int index) {
return listElements.elementAt(index);
}
public int indexOfList(ListField list, String p, int s) {
return listElements.indexOf(p, s);
}
public int getPreferredWidth(ListField list) {
return Graphics.getScreenWidth();
}
public void insert(String toInsert, int index) {
listElements.addElement(toInsert);
}
public void erase() {
listElements.removeAllElements();
}
}

Help, please!

Thanks in advance...

Yes. You can use the graphics class to control how each line is drawn.

check http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/ui/Graphics.html

for example, you use:

drawBitmap to paint a small icon on the first 32 pixels

drawText to draw text on pixel 40 - xxx

drawBitmap to paint another icon on the right side

You can find samples for implementations listfield on the basis of knowledge and forums.

Tags: BlackBerry Developers

Similar Questions

  • How to catch a sms and let the native SMS Inbox doesn't have reciive it.

    my application has intercept sms, but incoming SMS will be received by our customer and the native system of SMS, how let the native SMS system does not receive or show?

    my method of capture:

    (MessageConnection) Connector.Open ("sms: / /: 0 ');

    A relevant message for your reference to ignore the Inbox for sms message:

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=1346&query.ID=198...

  • BlackBerry smartphones start Messages in the SMS Inbox

    When I go tot the Messages, it always goes the e-mail inbox... is possible to default page is SMS Inbox?

    The message list is a list of all messages, e-mail. SMS, pin, etc.  You should have a separate text message Inbox.  If you do not, go to Messages > Options and function of your operating system there are there to control the settings if the sms/mms and email are combined or not.

  • Emails received in a single account shows no object and sender in the Inbox list.

    Hello

    I have a weird problem with my Thunderbird. I have two accounts in use. One of them, from Sept. 16., 2015, no longer displays the subject and sender to the Inbox list. However, the emails are perfectly fine when open. What bothers me because I can no longer search and sort the list. Help, please. Thank you.

    Looks like your mail files are corrupt.

    Try to rebuild the troubled folder index file.
    Right click on the file - properties - file Repair

    Note: according to corruption it may delete the affected folder messages that cannot be recovered more.
    In this case, you need to restore from a recent backup.

    Corruption is often caused by anti-virus software to play with the Thunderbird e-mail files. Therefore, it is recommended to create an exception for the Thunderbird profile folder, so that the real-time scanner tries to analyze the profile with your mail.

    For more information on localization, see profile
    http://KB.mozillazine.org/Profile_folder_-_Thunderbird

  • I accidentally entered my password in the field 'user ID' a website connection, and pre-populating it now appear in the list of suggestions for that field. Is there a way to make the pre-fill 'forget' a specific entry?

    While connecting to a secure Web site, I was typing too fast and accidentally included my password in the field ID used while connection and press enter before I realized my mistake. I then connected properly, but now Firefox include this false entry (with another entry accidentally misspelled) in the list of suggestions of pre-filling every time I go to this page. I prefer not to cut completely from pre-filling, but obviously I don't want my password to be specified. Can I delete the wrong entry in the list of suggestions as pre-filling watch somehow? (I use Firefox 6.0 on Windows 7)

    Select the entry in the drop-down menu and press "DELETE", Mac users, press 'Shift + Delete '.

  • 8.2 mail is possible to change the font size in the e-mail inbox list? It is necessary to do in Mail preferences, but nothing happens.

    8.2 mail is possible to change the font size in the e-mail inbox list? Otherwise why is there a place to do it in the Prefs of Mail. ?

    Using OS X Yosemite, version 10.10.5, iMac (21.5 inch, at the end of 2013)

    Intel Core i5 at 2.7 GHz

    8 GB 1600 MHz DDR3

    You try to change the font size in the sidebar (files)?

    Maybe this helps: settings > general > size of the sidebar icons.

    Maybe change the resolution of the screen could help?

    Good luck

  • Messsage of SMS is not on the SMS Inbox

    Hi all

    I try to send an SMS with the following code:

         MessageConnection msgConn;
         try {
           msgConn = (MessageConnection)  Connector.open("sms://21616");
           Message msg = msgConn.newMessage(MessageConnection.TEXT_MESSAGE);
           TextMessage txtMsg = (TextMessage) msg;
           System.out.println("*********** SMS Message: " + local.getSms());
           txtMsg.setPayloadText(local.getSms());
           msgConn.send(txtMsg);
         } catch (IOException e) {
           System.out.println("******** Error sending SMS: " + e.toString());
         }
    

    It seems to work without any problems, but when I go to the SMS Inbox, the message is not there, so I'm not able to find out if the message was already sent, or there is a failure or the SMS should be retransmitted or whatever it is, if someone had an idea?

    Thanks in advance.

    As far as I know, the message you send by programming, does not appear in the Outbox...

    Visit this link:

    http://supportforums.BlackBerry.com/T5/Java-development/SMS-not-saving-in-Outbox/TD-p/456188

  • What is the component used to select contact in the field "to:" when create new sms on BB OS 4.6?

    Does anyone know which component is used to select contact in the field "to:" when create new sms on BB OS 4.6? What is KeywordFilterField? If yes - how to customize it to make it look like the sms app? Can you give us some examples of code? I'm new in development for BB and I need this functionality in my application.  I will be very appreciate for any help!

    You will need to implement your own field full auto in this case.

  • Images in the field of the list does not

    Hello

    I create a list field that contains 10 lines and four fields in each line. The first field is the field of the image. But the image does not come. Other three fields (label field) do very well. I use the simulator of 4.7 and 9530.

    I give my code here also. Please help me.

    class TaskListField extends ListField implements ListFieldCallback {
         private Vector rows;
         private Bitmap _mReceiveAmount;
         private Bitmap _mSentAmount;
        private boolean hasfocus=false;
    
         public TaskListField() {
          super(0, ListField.MULTI_SELECT);
          setRowHeight(60);
          setEmptyString("It is Empty!", DrawStyle.HCENTER);
          setCallback(this);
    
          String images[]={"amount_received.png","amount_sent.png"};
    
          _mReceiveAmount = Bitmap.getBitmapResource("amount_received.png");
          _mSentAmount = Bitmap.getBitmapResource("amount_sent.png");
          BitmapField bitmap;
    
          rows = new Vector();
    
          for (int x = 0; x < 10; x++) {
           TableRowManager row = new TableRowManager();
    
           // SET THE  BITMAP FIELD
           // if amount received, display bitmap
         //  if (x % 2 == 0) {
            //bitmap=new BitmapField(_mReceiveAmount);
            row.add(new BitmapField(Bitmap.getBitmapResource(images[0])));
          //}
           // if amount is sent, set bitmap
           //else {
           // bitmap=new BitmapField(_mSentAmount);
              // row.add(new BitmapField(Bitmap.getBitmapResource(images[1])));
          // }
    
           // SET THE DATE LABELFIELD
    //
           LabelField _mDateField = new LabelField("OCT 10,2010", DrawStyle.ELLIPSIS);
           row.add(_mDateField);
    
           // SET THE LIST NAME
           row.add(new LabelField("Details" ,DrawStyle.ELLIPSIS) {
            protected void paint(Graphics graphics) {
             graphics.setColor(0x00878787);
             super.paint(graphics);
            }
           });
    
           // SET THE DUE DATE/TIME
           row.add(new LabelField("$220",DrawStyle.ELLIPSIS | LabelField.USE_ALL_WIDTH | DrawStyle.RIGHT) {
            protected void paint(Graphics graphics) {
             graphics.setColor(0x00878787);
             super.paint(graphics);
            }
           });
           rows.addElement(row);
          }
          setSize(rows.size());
    
         }
    
         // ListFieldCallback Implementation
         public void drawListRow(ListField listField, Graphics g, int index, int y,int width) {
    
            // g.drawBitmap(0, 0, _mReceiveAmount.getWidth(), _mReceiveAmount.getHeight(), _mReceiveAmount, 0, 0);
             TaskListField list = (TaskListField) listField;
    
             TableRowManager rowManager = (TableRowManager) list.rows.elementAt(index);
             rowManager.drawRow(g, 0, y, width, list.getRowHeight());
         // g.drawBitmap(0, 0, _mReceiveAmount.getWidth(), _mReceiveAmount.getHeight(), _mReceiveAmount, 0, 0);
         }
    
         public class TableRowManager extends Manager {
          public TableRowManager() {
           super(0);
          }
    
          // Causes the fields within this row manager to be layed out then
          // painted.
          public void drawRow(Graphics g, int x, int y, int width, int height) {
           // Arrange the cell fields within this row manager.
           layout(width, height);
    
           // Place this row manager within its enclosing list.
           setPosition(x, y);
    
           // Apply a translating/clipping transformation to the graphics
           // context so that this row paints in the right area.
           g.pushRegion(getExtent());
    
           // Paint this manager's controlled fields.
           subpaint(g);
    
           g.setColor(0x00CACACA);
           g.drawLine(10, 0, getPreferredWidth()-10, 0);
    
           // Restore the graphics context.
           g.popContext();
          }
    
          // Arranges this manager's controlled fields from left to right within
          // the enclosing table's columns.
          protected void sublayout(int width, int height) {
           // set the size and position of each field.
           int fontHeight = Font.getDefault().getHeight();
           int preferredWidth = getPreferredWidth();
    
           // start with the Bitmap Field of the priority icon
           Field field = getField(0);
           layoutChild(field, 32, 32);
           setPositionChild(field, 10, 20);
    
           // set the task name label field
           field = getField(1);
           layoutChild(field, 120, fontHeight + 1);
           setPositionChild(field, 70, 3);
    
           // set the list name label field
           field = getField(2);
           layoutChild(field, 150, fontHeight + 1);
           setPositionChild(field, 190, 3);
    
           // set the due time name label field
           field = getField(3);
           layoutChild(field, 150, fontHeight + 1);
           setPositionChild(field, preferredWidth - 172, 3);
    
           setExtent(preferredWidth, getPreferredHeight());
          }
    
          // The preferred width of a row is defined by the list renderer.
          public int getPreferredWidth() {
           return Graphics.getScreenWidth();
          }
    
          // The preferred height of a row is the "row height" as defined in the
          // enclosing list.
          public int getPreferredHeight() {
           return getRowHeight();
          }
         }
    
         public Object get(ListField listField, int index) {
          // TODO Auto-generated method stub
          return null;
         }
    
         public int getPreferredWidth(ListField listField) {
          // TODO Auto-generated method stub
          return 0;
         }
    
         public int indexOfList(ListField listField, String prefix, int start) {
          // TODO Auto-generated method stub
          return 0;
         }
    
         public void onUnFocus(){
             hasfocus=false;
             invalidate();
    
         }
    
    }
    

    your code is quite a mess, and you probably have a misconception on the listfield.

    in drawListRow you paint directly the object to the line. no need to use fields or similar, graphics methods.

    If you have different objects in your listfield you need to branch in your drawListRow method (if bitmap instanceof object etc.).

    your brief description, it appears you want to have the bitmap in the same line as your other information.

    create a bean with the attributes class, that you need, including the bitmap.

    put objects of beans in your listfield and the data structure (vector).

    drawListRow check that it is a bean and draw it.

    for example (rough code, no control null etc.):

    drawBitmap (0, bean.getBitmap ());

    drawText (bean.getBitmap (.getWidth () + 5,) bean.getText ());

  • How do the native sms app icon hidden by my code?

    I want to hide the Native SMS application when my application is installed, did I can do with my code?

    I havn't met any API to achieve this.

  • Problem with the blackBerry Smartphones SMS Inbox

    I had problems with my Blackberry Torch 9860 sms Inbox.  The time and date that are on my phone are correct, but when I go to my sms Inbox, the date is showing that "May 22, 2043" and each message arrives at "12:08" no matter what time it really is.

    This is an easy fix?

    Thank you!

    I ended up remove all the messages of this 'day', so he would not appear in the Inbox and now when I send or receive that he puts the messages in the right time.

    I have nothing else it seemed to have settled himself.

  • Email for blackBerry Smartphones is going to the SMS Inbox

    Hello

    I would like to know how to stop my e-mails to my SMS Inbox! I have a Pearl 8100.

    If anyone knows, I would really appreciate it

    Thank you

    X 2 ^ ^ ^

    Messages is the catch all for all messages in all types of all accounts. A separate SMS/MMS icon can be created according to the levels of certain BONES (you already have the instructions for that above). The BIS-based emails will show in their independent icons, but they all will also still show in the main Messages icon. If you have BES, your messages will be only one default show in Messages, use alternating with everything else. If you have BES and you want to split out, say so and we will provide you a few ways to do this. But Messages will always be the Tote.

  • The maximum size of the text entered in the field "Search" the list view

    I created an APEX 5.0 application using theme 51. I have a simple list view for which the function 'Enable search' is checked.

    I want to limit the length of the "search string" in the field "search". How can I do this?

    There seems to be no limit on the size of the string in the search field. Enter a very large string in this field and submitting research causes APEX return an "Internal Server" error

    CITY

    Hi Michael,

    the amount of data entering your users? Because the limit should be 32 KB.

    Unfortunately, the search field is generated by the jQuery Mobile framework so we do not really have control of a limit, but you can specify the static 'ID' attribute in your area in order to "myListView" and then add the following code to your page "Run when the page loads" level attribute

    $( "#myListView input[data-type=search]" ).attr( "maxlength", 255 );
    

    But I doubt that this is necessary. Can you please post a screenshot of your error message "internal server".

    Concerning

    Patrick

  • change the field type selection list of text based on the data in the other domain.

    Hello

    We have a requirement where we are looking to display the page as element select list or a free text field based on the value of the item to another page.

    Say, we have two fields

    Day:

    Products:

    If day = 'Monday' produced a drop in low field of another product would be a free text field.   Is this possible in APEX?

    This is the configuration I did.

    I used the field produced twice (as a text and list field select) as an element of a page., dependent on the value of the day I used the dynamic properties of actions to show/hide these fields.

    However, when I click on submit, it throws an error:

    ORA-06550: line 1, column 108: PL/SQL: ORA-00957: name of column in double ORA-06550: line 1, column 13: PL/SQL: statement ignored


    Kind regards

    Satya

    You can have both share the same database column, the process of the APEX DML does not know how to consolidate.

    You will need to add a calculation and determine the real value based on two fields, up to an only one mapped to db.

  • Treatment options for form (use the value of a form field to select a shared list or a web redirect page)

    Hello

    I tried something with the processing of the forms which doesn't seem to work. I wonder if the function really works or if I'm doing something wrong.

    Here is an example of what I do: I have a form that I want to use. I add "Web Page redirection" processing step to my form. When I click on the processing step to set up, under "General settings" there is an option that says "Choose how the launch of destination page is selected." In this drop-down menu, there are three options: always redirect to the same landing page, use a drop-down list to select the landing page and the value of a form field allows you to select the destination page. I have a hidden field on the form that contains the URL of the web page to which I would like to redirect. When I select 'Use the value of a form field to select the landing page', I select the hidden field to the field that contains the URL of the web page to which I want to redirect. It's my setup. However, when I submit the form, nothing happens, I do not redirect to the URL contained in the hidden field... This function still works? I'm doing something wrong? I can't seem to get the function "Use a drop-down list to select the destination page" to work either. The same thing happens when I try to use the "Add Contact to shared the list" processing step. I add the name of the list that is shared in the field hidden, but the contact does not appear in the shared list... These functions still work? If yes how do I configure them?

    Thank you!

    Well, I understood the problem of the shared list... You must add the ID of the list shared in the hidden field. I had to use Firebug to see the real ID of the shared list. Once you have the ID, use you it as a static value in the field. If the HTML code of the form will look something like this:

    If you do not use the lookup data ID. You use the ID real asset on the shared list. You must use something like Firebug to find.

    I'm glad everything is working.

Maybe you are looking for