tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

feat(android): track color of the Ti.UI.Switch #14054

Closed m1ga closed 5 months ago

m1ga commented 5 months ago

Parity for tintColor and adding onTintColor to color the tracks for the Material Switch. Also adds thumbColor and onThumbColor.

var win = Ti.UI.createWindow();

var basicSwitch = Ti.UI.createSwitch({
  tintColor: "red",
  onTintColor: "green",
  onThumbColor: "yellow",
  thumbColor: "blue"
});

// basicSwitch.tintColor = "blue"
win.add(basicSwitch);
win.open();

Screenshot_20240603-140140 Screenshot_20240603-140145

with the thumbColor: Screenshot_20240604-142455

Current workaround Using an Android theme

hansemannn commented 5 months ago

IIRC, we have similar theming capabilities on iOS already, are these the same properties?

m1ga commented 5 months ago

ah, good point. onTintColor is the color for "on". I'll rename the activeTintColor

m1ga commented 5 months ago

Update: