titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

feat(android): optionBar color properties

Open m1ga opened this issue 2 weeks ago • 0 comments

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 avatar Jun 18 '24 10:06 m1ga