[TIMOB-20189] Android: Updated AttributeProxy to allow fontStyle to be set without having fontWeight to be manually set.
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-01-05T08:55:47.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 5.4.0 |
| Components | Android |
| Labels | n/a |
| Reporter | Collin Price |
| Assignee | Hans Knöchel |
| Created | 2016-01-04T14:35:21.000+0000 |
| Updated | 2016-06-24T21:07:36.000+0000 |
Description
On Android, a user had to manually specify
fontWeight and fontStyle when they wanted to add only a fontStyle to an AttributedString.
For example:
This would do nothing on Android
Ti.UI.createAttributedString({
text: "Hello World",
attributes: [
{
type: Ti.UI.ATTRIBUTE_FONT,
value: { fontStyle: "italic" },
range: [0, 5]
}
]
})
A user would have to add a fontWeight for the text to be "italic"
Ti.UI.createAttributedString({
text: "Hello World",
attributes: [
{
type: Ti.UI.ATTRIBUTE_FONT,
value: { fontWeight: "normal", fontStyle: "italic" },
range: [0, 5]
}
]
})
I created a pull request but was asked to create a JIRA ticket for reference. [https://github.com/appcelerator/titanium_mobile/pull/7605](https://github.com/appcelerator/titanium_mobile/pull/7605)
This was an Android issue.
[~hansknoechel] can you review the PR please?
PR *approved*, thank you [~CollinPrice]!
Verified the fixed.
fontWeightis not needed forfontStyleto work. Closing. Environment: Appc Studio : 4.7.0.201606150733 Ti SDK : 5.4.0.v20160617074028 Ti CLI : 5.0.9 Alloy : 1.9.0 MAC El Capitan : 10.11.4 Appc NPM : 4.2.7-2 Appc CLI : 5.4.0-18 Node: 4.4.4 Nexus 6 - Android 6.0.1