Skip to content

feat(android): add letterSpacing to Label#13984

Merged
hansemannn merged 3 commits intomasterfrom
androidLetterSpacing
Apr 28, 2025
Merged

feat(android): add letterSpacing to Label#13984
hansemannn merged 3 commits intomasterfrom
androidLetterSpacing

Conversation

@m1ga
Copy link
Contributor

@m1ga m1ga commented Feb 5, 2024

iOS can do letterspacing with a attributedString already. Android doesn't have this property. As it just a text property I've added it the same way as lineSpacing so it is a native Label property.

var win = Ti.UI.createWindow({
	layout: "vertical"
});
var textLabel = Ti.UI.createLabel({
	text: "some text",
	letterSpacing: -0.1,
	font: {
		fontSize: 40
	}
});
var textLabel2 = Ti.UI.createLabel({
	text: "some text",
	letterSpacing: 0.1,
	font: {
		fontSize: 40
	}
});

win.add([textLabel, textLabel2]);
win.open();

Screenshot_20240205-091745

@m1ga m1ga added the feature label May 23, 2024
@hansemannn hansemannn requested a review from Copilot April 28, 2025 08:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the letterSpacing property on Android Labels, mirroring the implementation of lineSpacing.

  • Updates the API documentation to include letterSpacing.
  • Adds a constant for letterSpacing in TiC.java.
  • Implements letterSpacing handling in TiUILabel both during initial property processing and on property changes.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
apidoc/Titanium/UI/Label.yml Documents the new letterSpacing property
android/titanium/src/java/org/appcelerator/titanium/TiC.java Introduces the PROPERTY_LETTER_SPACING constant
android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java Adds letterSpacing logic in property processing and change handling

@hansemannn hansemannn merged commit ee8b04c into master Apr 28, 2025
7 checks passed
@m1ga m1ga deleted the androidLetterSpacing branch May 13, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants