summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal Alsharifi <bilal.alsharifi@gmail.com>2019-07-15 11:22:23 -0400
committerBilal Alsharifi <bilal.alsharifi@gmail.com>2019-07-15 11:22:23 -0400
commit6e554f5984eba646d046fcfb60a4d0826b3e264e (patch)
treed15fce4e7c374f865f177c280c0d97357dd865b8
parente8bb48dcce4654fcd0d819580dcf68e879f7b225 (diff)
downloadsdl_android-6e554f5984eba646d046fcfb60a4d0826b3e264e.tar.gz
Update screenManager to support templateTitle
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java23
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java20
2 files changed, 42 insertions, 1 deletions
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java
index cc33bae86..32acaf5a4 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java
@@ -343,6 +343,29 @@ abstract class BaseScreenManager extends BaseSubManager {
}
/**
+ * Sets the title of the new template that will be displayed.
+ * How this will be displayed is dependent on the OEM design and implementation of the template.
+ * @param templateTitle the title of the new template that will be displayed
+ * <p></p>
+ * <ul>
+ * <li>Minlength: 0</li>
+ * <li>Maxlength: 100</li>
+ * </ul>
+ */
+ public void setTemplateTitle(String templateTitle){
+ this.textAndGraphicManager.setTemplateTitle(templateTitle);
+ }
+
+ /**
+ * Gets the title of the new template that will be displayed
+ * How this will be displayed is dependent on the OEM design and implementation of the template.
+ * @return templateTitle - String value that represents the title of the new template that will be displayed
+ */
+ public String getTemplateTitle(){
+ return this.textAndGraphicManager.getTemplateTitle();
+ }
+
+ /**
* Set softButtonObjects list and upload the images to the head unit
* @param softButtonObjects the list of the SoftButtonObject values that should be displayed on the head unit
*/
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
index 45f1dad0b..ee269aad8 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
@@ -90,7 +90,7 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
private OnSystemCapabilityListener onDisplayCapabilitiesListener;
private SdlArtwork primaryGraphic, secondaryGraphic;
private TextAlignment textAlignment;
- private String textField1, textField2, textField3, textField4, mediaTrackTextField;
+ private String textField1, textField2, textField3, textField4, mediaTrackTextField, templateTitle;
private MetadataType textField1Type, textField2Type, textField3Type, textField4Type;
//Constructors
@@ -128,6 +128,7 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
textField4 = null;
textField4Type = null;
mediaTrackTextField = null;
+ templateTitle = null;
textAlignment = null;
primaryGraphic = null;
secondaryGraphic = null;
@@ -379,6 +380,10 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
show.setMediaTrack(mediaTrackTextField);
}
+ if (templateTitle != null && templateTitle.length() > 0){
+ show.setTemplateTitle(templateTitle);
+ }
+
List<String> nonNullFields = findValidMainTextFields();
if (nonNullFields.isEmpty()){
return show;
@@ -890,6 +895,19 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
return textField4Type;
}
+ void setTemplateTitle(String templateTitle){
+ this.templateTitle = templateTitle;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ String getTemplateTitle(){
+ return templateTitle;
+ }
+
void setPrimaryGraphic(SdlArtwork primaryGraphic){
this.primaryGraphic = primaryGraphic;
if (!batchingUpdates){