You have the ability to customize the look and feel of the template. How much customization is available depends on the RPC version of the head unit you are connected with as well as the design of the HMI.
You can customize the color scheme of your app using template coloring APIs.
You can change the template colors of the initial template layout in the lifecycleConfiguration
.
// Set color schemes RGBColor green = new RGBColor(126, 188, 121); RGBColor white = new RGBColor(249, 251, 254); RGBColor grey = new RGBColor(186, 198, 210); RGBColor darkGrey = new RGBColor(57, 78, 96); TemplateColorScheme dayColorScheme = new TemplateColorScheme() .setBackgroundColor(white) .setPrimaryColor(green) .setSecondaryColor(grey); builder.setDayColorScheme(dayColorScheme); TemplateColorScheme nightColorScheme = new TemplateColorScheme() .setBackgroundColor(white) .setPrimaryColor(green) .setSecondaryColor(darkGrey); builder.setNightColorScheme(nightColorScheme);
You may only change the template coloring once per template; that is, you cannot call changeLayout
, SetDisplayLayout
or Show
for the template you are already on and expect the color scheme to update.
You can change the template color scheme when you change layouts. This guide requires SDL Java Suite version 5.0. If using an older version, use SetDisplayLayout
(any RPC version) or Show
(RPC v6.0+) request.
// Set color schemes RGBColor green = new RGBColor(126, 188, 121); RGBColor white = new RGBColor(249, 251, 254); RGBColor grey = new RGBColor(186, 198, 210); RGBColor darkGrey = new RGBColor(57, 78, 96); TemplateColorScheme dayColorScheme = new TemplateColorScheme() .setBackgroundColor(white) .setPrimaryColor(green) .setSecondaryColor(grey); TemplateColorScheme nightColorScheme = new TemplateColorScheme() .setBackgroundColor(white) .setPrimaryColor(green) .setSecondaryColor(darkGrey); TemplateConfiguration templateConfiguration = new TemplateConfiguration() .setTemplate(PredefinedLayout.GRAPHIC_WITH_TEXT.toString()) .setDayColorScheme(dayColorScheme) .setNightColorScheme(nightColorScheme); sdlManager.getScreenManager().changeLayout(templateConfiguration, new CompletionListener() { @Override public void onComplete(boolean success) { if (success) { // Color set with template change } else { // Color and template not changed } } });
You can also customize the title and icon of the main menu button that appears on your template layouts. The menu icon must first be uploaded with a specific name through the file manager; see the Uploading Images section for more information on how to upload your image.
// The image must be uploaded before referencing the image name here SetGlobalProperties setGlobalProperties = new SetGlobalProperties() .setMenuTitle("customTitle") .setMenuIcon(image); setGlobalProperties.setOnRPCResponseListener(new OnRPCResponseListener() { @Override public void onResponse(int correlationId, RPCResponse response) { if (response.getSuccess()){ // Success } } }); sdlManager.sendRPC(setGlobalProperties);