LabelField _labelTwitter;
LabelField _labelAlipay;
public AboutScreen(String title, String version, String intro, String author, String email, String weibo, String facebook, String twitter, String alipay)
{
super(new VerticalFieldManager(FOCUSABLE | NO_VERTICAL_SCROLL));
Languages language = new Languages();
setBorder(AboutScreenConfig.border_popup_Transparent);
setBackground(AboutScreenConfig.bg_popup_Transparent);
LabelField labelAbout = new LabelField(language.getAbout(), USE_ALL_WIDTH | LabelField.ELLIPSIS);
labelAbout.setFont(AboutScreenConfig.FONT_ABOUT_TITLE);
labelAbout.setPadding(0, 0, 1, 0);
LabelField labelTitle = new LabelField(title, USE_ALL_WIDTH | LabelField.ELLIPSIS);
labelTitle.setFont(AboutScreenConfig.FONT_ABOUT_LARGE);
LabelField labelVersion = new LabelField(language.getVersion() + version, USE_ALL_WIDTH | LabelField.ELLIPSIS | LabelField.RIGHT);
labelVersion.setFont(AboutScreenConfig.FONT_ABOUT_SMALL);
VerticalFieldManager vfmTitle = new VerticalFieldManager(FIELD_VCENTER);
vfmTitle.add(labelAbout);
vfmTitle.add(new SeparatorField());
vfmTitle.add(labelTitle);
vfmTitle.add(labelVersion);
VerticalFieldManager vfmContent = new VerticalFieldManager(VERTICAL_SCROLL);
HorizontalFieldManager horizontalContactTitle = new HorizontalFieldManager();
//HorizontalFieldManager horizontalShortcutTitle = new HorizontalFieldManager();
//VerticalButtonFieldSet vbf = new VerticalButtonFieldSet(USE_ALL_WIDTH);
LabelField labelIntro = new LabelField(intro);
LabelField labelContact = new LabelField(language.getContact(), USE_ALL_WIDTH | LabelField.ELLIPSIS);
labelContact.setFont(AboutScreenConfig.FONT_ABOUT_HEADLINE);
LabelField labelAuthor = addLabel("\u2022 " + author);
if (!email.equalsIgnoreCase("")) {_labelEmail = addLabel("\u2022 " + language.getEmail() + email);}
if (!weibo.equalsIgnoreCase("")) {_labelWeibo = addLabel("\u2022 " + language.getWeibo() + weibo);}
if (!facebook.equalsIgnoreCase("")) {_labelFacebook = addLabel("\u2022 " + language.getFacebook() + facebook);}
if (!twitter.equalsIgnoreCase("")) {_labelTwitter = addLabel("\u2022 " + language.getTwitter() + twitter);}
if (!alipay.equalsIgnoreCase("")) {_labelAlipay = addLabel("\u2022 " + language.getAlipay() + alipay);}
/*
LabelField labelShortcut = new LabelField("快捷键:", USE_ALL_WIDTH | LabelField.ELLIPSIS);
labelShortcut.setFont(AboutScreenConfig.FONT_ABOUT_HEADLINE);
LabelField shortB=addLabel("\u2022 B:列表滚动到底部");
LabelField shortT=addLabel("\u2022 T:列表滚动到顶部");
LabelField shortL=addLabel("\u2022 L:获取最新新闻");
LabelField shortH=addLabel("\u2022 H:获取热门新闻");
LabelField shortS=addLabel("\u2022 S:获取专题分类");
LabelField shortC=addLabel("\u2022 C:选择往期新闻");
LabelField shortN=addLabel("\u2022 N:下一期新闻");
LabelField shortP=addLabel("\u2022 P:上一期新闻");
LabelField shortA=addLabel("\u2022 A:显示本窗口");
LabelField shortX=addLabel("\u2022 X:退出程序");
ButtonField btnWriteAReview = new ButtonField("编写评论", ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
btnWriteAReview.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context)
{
try
{
openAppWorld(AboutScreenConfig.BBW_APPID);
} catch(final Exception e)
{
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
if(e instanceof ContentHandlerException)
{
Dialog.alert("BlackBerry World is not installed!");
} else {
Dialog.alert("Problems opening App World: " + e.getMessage());
}
}
});
}
}
});
ButtonField btnBrowseOtherApps = new ButtonField("浏览其它软件", ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
btnBrowseOtherApps.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context)
{
BrowserSession browser=Browser.getDefaultSession();
browser.displayPage("http://appworld.blackberry.com/webstore/vendor/69061");
}
});
*/
horizontalContactTitle.add(labelContact);
horizontalContactTitle.add(new LabelField("", LabelField.FOCUSABLE));
vfmContent.add(labelIntro);
vfmContent.add(new LabelField());
vfmContent.add(horizontalContactTitle);
vfmContent.add(labelAuthor);
if (_labelEmail != null) {vfmContent.add(_labelEmail);}
if (_labelWeibo != null) {vfmContent.add(_labelWeibo);}
if (_labelAlipay != null) {vfmContent.add(_labelAlipay);}
if (_labelFacebook != null) {vfmContent.add(_labelFacebook);}
if (_labelTwitter != null) {vfmContent.add(_labelTwitter);}
vfmContent.add(new LabelField());
/*
horizontalShortcutTitle.add(labelShortcut);
horizontalShortcutTitle.add(new LabelField("", LabelField.FOCUSABLE));
vfmContent.add(horizontalShortcutTitle);