0

在此处输入图像描述

是否可以在应用程序中实现上述默认的黑莓短信对话列表视图。如果是,我该怎么做?我对此完全空白,我没有找到任何线索来推进这件事。我将从我的应用程序服务器获得上述消息。请帮忙!!

4

1 回答 1

0

在此处输入图像描述

在此处输入图像描述

我用过这些图片。

final Border rightBorder = BorderFactory.createBitmapBorder(new XYEdges(16, 23, 27, 16), Bitmap.getBitmapResource( "bubble_right.png" ) ); 
final Border leftBorder = BorderFactory.createBitmapBorder(new XYEdges(16, 16, 27, 23), Bitmap.getBitmapResource( "bubble_left.png" ) );

addHeading(leftBorder, Field.FIELD_LEFT,0xbdbdbd, txt,time_);


 public static void addHeading(Border border, long style, int backgroundcolour, String msg ,String time_) {
    VerticalFieldManager vfm = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR | Field.USE_ALL_WIDTH );
    vfm.setMargin(0, 0, 0, 0);
    FieldLayout tt =  new FieldLayout(style, backgroundcolour, msg,time_);
    tt.setBorder(border);
    tt.setMargin( 5, 5, 5, 5 );
    vfm.add(tt);
    add(vfm);

}





public class FieldLayout extends VerticalFieldManager{

    Bitmap a;


     public FieldLayout(long style, final int backgroundcolour, String msg,String time_) {
  //  FieldLayout(long style,final int backgroundcolour,final String msg, final String picture) {
        super(style);


    HorizontalFieldManager hfm = new HorizontalFieldManager(){
        public void paint(Graphics graphics) {
            graphics.setBackgroundColor(backgroundcolour);
            graphics.clear();
            super.paint(graphics);
        }
    };



    VerticalFieldManager vfm = new VerticalFieldManager(){
        public void paint(Graphics graphics) {
            graphics.setBackgroundColor(backgroundcolour);
            graphics.clear();
            super.paint(graphics);
        }
    };

    LabelField lf = new LabelField(msg, Field.FOCUSABLE){
        private XYRect xyrect=new XYRect();
        protected boolean navigationClick(int status, int time){
            Application.getApplication().invokeLater(new Runnable(){
                public void run() {

                }
            });
                return true;
        }
    };
    lf.setPadding(0,0,0,3);
    vfm.add(lf);

   /* LabelField tim = new LabelField(time_, Field.FOCUSABLE){
        private XYRect xyrect=new XYRect();
        protected boolean navigationClick(int status, int time){
            Application.getApplication().invokeLater(new Runnable(){
                public void run() {

                }
            });
                return true;
        }
    };
    tim.setFont(Font.getDefault().derive( Font.PLAIN,5, Ui.UNITS_pt));
    tim.setPadding(3,3,0,0);
    vfm.add(tim);*/
    // set the pin point in the map 

    hfm.add(vfm);

    add(hfm);

    setPadding(0,0,0,0);
    setMargin(0, 0, 0, 0);
}


protected void paintBackground(Graphics g){
    int oldColor = g.getColor();
    try {
        g.setColor(0xE0E0E0);

    } finally {
        g.setColor(oldColor);
    }
}


}
于 2012-06-08T07:19:10.777 回答