diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java index bc765e17d17..07da2097115 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java @@ -397,6 +397,10 @@ public void processProperties(KrollDict d) TiConvert.toFloat(dict.get(TiC.PROPERTY_MULTIPLY), 0)); } } + if (d.containsKey(TiC.PROPERTY_LETTER_SPACING)) { + float value = TiConvert.toFloat(d.get(TiC.PROPERTY_LETTER_SPACING)); + tv.setLetterSpacing(value); + } if (d.containsKey(TiC.PROPERTY_COLOR)) { Object color = d.get(TiC.PROPERTY_COLOR); if (color == null) { @@ -591,8 +595,11 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP if (newValue instanceof HashMap) { HashMap dict = (HashMap) newValue; tv.setLineSpacing(TiConvert.toFloat(dict.get(TiC.PROPERTY_ADD), 0), - TiConvert.toFloat(dict.get(TiC.PROPERTY_MULTIPLY), 0)); + TiConvert.toFloat(dict.get(TiC.PROPERTY_MULTIPLY), 0)); } + } else if (key.equals(TiC.PROPERTY_LETTER_SPACING)) { + float val = TiConvert.toFloat(newValue); + tv.setLetterSpacing(val); } else if (key.equals(TiC.PROPERTY_HEIGHT)) { // Update the view's height. // Note: We may need to update lines/maxLines settings when switching to an auto-sized height. diff --git a/android/titanium/src/java/org/appcelerator/titanium/TiC.java b/android/titanium/src/java/org/appcelerator/titanium/TiC.java index 704af44e031..41b0a8bb2bf 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/TiC.java +++ b/android/titanium/src/java/org/appcelerator/titanium/TiC.java @@ -527,6 +527,8 @@ public class TiC public static final String PROPERTY_LAYOUT = "layout"; public static final String PROPERTY_LAYOUT_ID = "layoutId"; public static final String PROPERTY_LEFT_DRAWER_LOCK_MODE = "leftDrawerLockMode"; + + public static final String PROPERTY_LETTER_SPACING = "letterSpacing"; public static final String PROPERTY_LINES = "lines"; public static final String PROPERTY_LINE_SPACING = "lineSpacing"; public static final String PROPERTY_LIFECYCLE_CONTAINER = "lifecycleContainer"; diff --git a/apidoc/Titanium/UI/Label.yml b/apidoc/Titanium/UI/Label.yml index d1eee23015e..1ecaa88781c 100644 --- a/apidoc/Titanium/UI/Label.yml +++ b/apidoc/Titanium/UI/Label.yml @@ -181,6 +181,12 @@ properties: permission: read-only since: "12.3.0" + - name: letterSpacing + summary: Letter spacing of the [text](Titanium.UI.Label.text) as a float value. + platforms: [android] + type: Number + since: "12.4.0" + - name: lineSpacing summary: Line spacing of the [text](Titanium.UI.Label.text), as a dictionary with the properties `add` and `multiply`. platforms: [android]