Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(android): optionBar color properties #14066

Merged
merged 3 commits into from
Jul 10, 2024
Merged

feat(android): optionBar color properties #14066

merged 3 commits into from
Jul 10, 2024

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jun 18, 2024

If you want to change the colors in an OptionBar you'll have to use a theme. This PR adds new properties selectectedBackgroundColor, selectedBorderColor, selectedTextColor and maps the color to the inactive text colors.

Screenshot_20240618-120614

const win = Ti.UI.createWindow();

const optionBarDefault = Ti.UI.createOptionBar({
	top: 0,
  labels: [ 'Option 1', 'Option 2', 'Option 3' ]
});
const optionBar1 = Ti.UI.createOptionBar({
	top: 50,
	selectedBackgroundColor: "red",
	selectedBorderColor: "#fff",
	selectedTextColor: "blue",
	color: "yellow",
  labels: [ 'Option 1', 'Option 2', 'Option 3' ]
});
const optionBar2 = Ti.UI.createOptionBar({
	top: 100,
	color: "yellow",
  labels: [ 'Option 1', 'Option 2', 'Option 3' ]
});
const optionBar3 = Ti.UI.createOptionBar({
	top: 150,
	selectedTextColor: "blue",
  labels: [ 'Option 1', 'Option 2', 'Option 3' ]
});

win.add([optionBarDefault,optionBar1,optionBar2,optionBar3]);

win.open();

@m1ga m1ga marked this pull request as ready for review June 18, 2024 11:37
@hansemannn hansemannn merged commit d5cff3c into master Jul 10, 2024
7 checks passed
@m1ga m1ga deleted the androidOptionBar branch July 10, 2024 08:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants