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

[TIMOB-24192] Android: Implement Ti.UI.PickerRow getColor() and setColor() #8669

Merged
merged 2 commits into from Jan 3, 2017

Conversation

garymathews
Copy link
Contributor

  • Implement setColor() and getColor() for Titanium.UI.PickerRow
TEST CASE
var w = Ti.UI.createWindow({
		layout: 'vertical',
		backgroundColor: 'grey'
	}),
	p = Ti.UI.createPicker(),
	b = Ti.UI.createButton({title: 'toggle color'}),
	apple = Ti.UI.createPickerRow({
		title: 'apple',
		color: 'red'
	});

b.addEventListener('click', function() {
	if (apple.getColor() == 'red') {
		apple.setColor('green');
	} else {
		apple.setColor('red');
	}
});

p.add([
	apple,
	Ti.UI.createPickerRow({
		title: 'grape',
		color: 'purple'
	}),
	Ti.UI.createPickerRow({
		title: 'orange',
		color: 'orange'
	})
]);

w.add(b);
w.add(p);
w.open();

JIRA Ticket

@@ -29,6 +30,18 @@ public PickerRowProxy()
}

@Kroll.getProperty @Kroll.method
public String getColor()
{
return (String)getProperty(TiC.PROPERTY_COLOR);
Copy link
Contributor

Choose a reason for hiding this comment

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

add a space like so return (String) getProperty(TiC.PROPERTY_COLOR);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The formatting of casts is inconsistent throughout, so it's down to personal preference.

}

@Kroll.setProperty @Kroll.method
public void setColor(String value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could use color instead of value? Maybe value was used in setTitle to remove ambiguity as title already exists as field? Your call.

Otherwise, looks good to merge!

@frankieandone
Copy link
Contributor

CR and FT PASSED

@frankieandone
Copy link
Contributor

CR and FT PASSED

@frankieandone frankieandone merged commit c1b356e into tidev:master Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants