UI Framework Building Block
The purpose of the UI Framework is to assure a consistent and uniform user experience across all third party applications by establishing a suite of standard UI library components and a shared UI framework.
The UI Framework is intended to be distributed to FCA’s authorized Tier 1 suppliers and third party partners for application development on the Uconnect® Panasonic VP4R head unit (HU). It supports both 8.4” (landscape) and 12” (portrait) HU screen display variants integrated into a single common package. The UI framework is intended to be used for managing the necessary screen templates, localization files, and resource files. All common UI components shall have a dependency on preloading the shared UI framework.
The UI Framework is dependent on the Aicas Application Management System (AMS) 2.0 and the Codename One 2.0 frameworks. It complies with FCA Uconnect® HMI design and style guides and supports the Uconnect® Simplified Branding theme for all components.
About this guide
This guide is intended to provide basic instructions on using the UI Framework. It will take you through getting your PC set-up to use the UI Framework and create a HelloWorld app using Eclipse.
Prerequisites
New Eclipse project creation
You can start your first app by creating a new Eclipse project.
Adding a form
public class HelloXlet extends FCAXlet {
@Override
public Component createSplashScreen() {
// TODO Auto-generated method stub
return null;
}
@Override
public String l10n() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class< ? extends FCAForm> mainFormClass() {
return HelloForm.class;
}
@Override
public String resourcesFileName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String theme() {
// TODO Auto-generated method stub
return null;
}
}
public class HelloForm extends FCAForm {
@Override
protected void onCreate(Bundle params) {
setTitle("HelloForm");
setLayout(new BorderLayout());
Label label = new Label("HelloWorld");
label.getUnselectedStyle().setAlignment(CENTER);
Font font = ResourceManager.getInstance().getFont(42);
label.getUnselectedStyle().setFont(font);
addComponent(BorderLayout.CENTER, label);
}
}
NOTE: onCreate() method is called on UI thread. Do not run heavy task there. You may refer to Android framework Activity’s lifecycle as the
FCA UI Components library is built on nearly the same pattern.
Show splash screen during app initialization
@Override
public Component createSplashScreen() {
Label bgImageLabel = null;
InputStream is = null;
try {
// Load a background image from resources
is = getClass().getResourceAsStream("/res/splash.png");
Image splashImage = Image.createImage(is);
// Construct a new label with the background image
bgImageLabel = new Label(splashImage);
// Set the label style
Style style = bgImageLabel.getStyle();
style.setBgColor(0);
style.setBgTransparency(0);
style.setAlignment(Label.CENTER);
bgImageLabel.setVerticalAlignment(Label.CENTER);
} catch (IOException e) {
// ignored
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
// ignored
}
}
}
return bgImageLabel;
}
}
TIP: Also you may run some long-lasting task on xlet start - override “public void onLoad()” in “HelloXlet” - it will be executed on BG thread.
Run Your Xlet
Updated: 12/28/2017