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

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

Merged
merged 6 commits into from
Jun 25, 2024
Merged

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jun 3, 2024

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

@m1ga m1ga added the feature label Jun 15, 2024
@hansemannn
Copy link
Collaborator

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

@m1ga
Copy link
Contributor Author

m1ga commented Jun 15, 2024

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

@m1ga
Copy link
Contributor Author

m1ga commented Jun 15, 2024

Update:

  • renamed activeTintColor to onTintColor for iOS parity.
  • renamed activeThumbColor to onThubColor to match the other property

@hansemannn hansemannn merged commit 07df689 into master Jun 25, 2024
7 checks passed
@m1ga m1ga deleted the androidSwitch branch June 25, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants