是否可以在应用程序中实现上述默认的黑莓文本消息会话列表视图。 如果是,我该怎么办?关于它,我完全是空白,我没有找到任何领先的方法。 我将从我的应用程序服务器获取上述消息。 请帮忙!!
答案 0 :(得分: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);
}
}
}