Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20189] Android: Updated AttributeProxy to allow fontStyle to be set without having fontWeight to be manually set.

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2016-01-05T08:55:47.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid
Labelsn/a
ReporterCollin Price
AssigneeHans Knöchel
Created2016-01-04T14:35:21.000+0000
Updated2016-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]
		}
	]
})

Comments

  1. Collin Price 2016-01-04

    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)
  2. Collin Price 2016-01-04

    This was an Android issue.
  3. Chee Kiat Ng 2016-01-05

    [~hansknoechel] can you review the PR please?
  4. Hans Knöchel 2016-01-05

    PR *approved*, thank you [~CollinPrice]!
  5. Lokesh Choudhary 2016-06-24

    Verified the fixed. fontWeight is not needed for fontStyle to 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

JSON Source