Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): label breakStrategy & hyphenationFrequency #13706

Merged
merged 6 commits into from
Sep 23, 2023

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jan 8, 2023

Addding hyphenationFrequency and breakStrategy to the Label

blue: default label,
rest is different breakStrategy and hyphenationFrequency modes.

Screenshot_20230108-164440

const win = Ti.UI.createWindow();
const sv = Ti.UI.createScrollView({width: 250, borderColor:"red", layout:"vertical"})
var lbl = Ti.UI.createLabel({text:"Tuppaware Party", color:"blue", font:{fontSize: 55}, bottom: 20, textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER})
sv.add(lbl)

for (var i = 0; i<=3; ++i) {
	var lbl = Ti.UI.createLabel({text:"Tuppaware Party", breakStrategy: i, font:{fontSize: 55}, bottom: 20, textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER})
	sv.add(lbl)
}

for (var i = 0; i<=4; ++i) {
	var lbl = Ti.UI.createLabel({text:"Tuppaware Party", hyphenationFrequency: i, font:{fontSize: 55}, bottom: 20, textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER})
	sv.add(lbl)
}
win.add(sv);
win.open();

Constants:

  • Ti.UI.BREAK_SIMPLE

  • Ti.UI.BREAK_HIGH_QUALITY

  • Ti.UI.BREAK_BALANCED

  • Ti.UI.HYPHEN_NONE

  • Ti.UI.HYPHEN_NORMAL

  • Ti.UI.HYPHEN_FULL

  • Ti.UI.HYPHEN_NORMAL_FAST

  • Ti.UI.HYPHEN_FULL_FAST

Todo

  • use constants
  • use TiC for property names
  • documentation

@m1ga m1ga marked this pull request as ready for review January 8, 2023 16:31
@cb1kenobi cb1kenobi merged commit f5181db into master Sep 23, 2023
7 checks passed
@m1ga m1ga deleted the 230108_hyphen branch September 23, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants