-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[TIMOB-24080] Implementing ParagraphStyle Ti.UI.AttributedString #8558
Conversation
@kopiro Please check my comments in the JIRA ticket for further discussions, thx! |
Hi, @hansemannn I added the Android implementation, but I can't test because of this error (is the new scons.js build system)
Any hint about that? |
ok to test |
@kopiro Looks like it's failing to grab the updated V8 libraries for Android. As part of the build it should download the new pre-built V8 libraries, and I'm guessing it timed out or had a network failure or something? Because it then errors saying it can't find one of the library files compiled against ARM. Maybe just retry and hopefully it grabs the zip properly this time? |
I noticed we don't have any unit-tests for attributed strings, yet, so it would be a good chance to add all of them. Since they are constant-based, we are able to test them pretty straight forward. I can assist you with writing them, as soon as the build itself passes. |
@hansemannn we noticed (me and @progress44) that is a "mistake" in the implementation. To implement the line height, we used the Example: alignment + line-height. Maybe, a better implementation could be to expose the NSMutableParagraphStyle directly. The main problem is that the |
@kopiro Is it possible to logical AND ( | ) both? I can check the architecture design later this week. |
@hansemannn I implemented totally the ParagraphStyle and removed the LINE_BREAK.
|
ca06434
to
e4ed741
Compare
@hansemannn what here? We use this code in production and it seems stable. |
Give some time to think about it next week. Github should have a ping functionality for being pinged after x days / weeks :-) |
Let me know if you want to know more info and if it's all clears, oherwise I'll explain. |
Whoops, didn't want to close it. Sure will do |
@hansemannn Aligned with master |
@@ -599,30 +598,45 @@ -(NSString *)ATTRIBUTE_LETTERPRESS_STYLE | |||
{ | |||
return NSTextEffectLetterpressStyle; | |||
} | |||
-(NSNumber*)ATTRIBUTE_LINE_BREAK_BY_WORD_WRAPPING | |||
-(NSNumber*)ATTRIBUTE_PARAGRAPH_STYLE_LINE_BREAK_BY_WORD_WRAPPING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change. We should deprecate them like in the above example + remove it in the next major release.
NSNumber * num = [TiUtils numberFromObject:value]; | ||
[paragraphStyle setLineBreakMode:[num unsignedIntegerValue]]; | ||
attrValue = paragraphStyle; | ||
DebugLog(@"[WARN] Ti.UI.AttributeNameLineBreak is deprecated, you must use AttributeNameParagraphStyle.lineBreak"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the DEPRECATED_REPLACED
macro instead. This could work:
DEPRECATED_REPLACED(@"UI.ATTRIBUTE_LINE_BREAK", @"UI.ATTRIBUTE_PARAGRAPH_STYLE.linebreak", @"6.2.0");
Basically, this will generate a unified warning for you. The "Ti" is not needed, since it will be processed by the macro definition. Bu
@hansemannn ping! @kopiro I don't see the Android changes in this PR. Do you still have them? |
Cherry picked and rebased into #10032 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-24080