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): badgeTextColor property #13874

Merged
merged 2 commits into from
Jul 18, 2023
Merged

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jun 28, 2023

Currently you can only set the badgeColor (background) but not the text color. badgeTextColor can be used to do that now.

added badgeBackgroundColor and added a deprecation warning to badgeColor to use the new property

const isAndroid = Ti.Platform.osname === 'android';
let tabGroup;

const window = Ti.UI.createWindow();

tabGroup = Ti.UI.createTabGroup({
	style: isAndroid ? Ti.UI.Android.TABS_STYLE_BOTTOM_NAVIGATION : undefined,
	tabs: [
		Ti.UI.createTab({
			window,
			title: "test"
		}),
		Ti.UI.createTab({
			window:Ti.UI.createWindow(),
			title: "test"
		})
	]
});

//tabGroup.tabs[0].badgeColor = "black" // deprecated - shows a warning
tabGroup.tabs[0].badgeBackgroundColor = "black"
tabGroup.tabs[0].badgeTextColor = "white"
tabGroup.tabs[0].badge = 1

tabGroup.open();

Screenshot_20230628-122134

Code is a copy of the badgeColor part and just using setBadgeTextColor instead of setBackgroundColor

@m1ga
Copy link
Contributor Author

m1ga commented Jul 18, 2023

added badgeBackgroundColor and made a deprecation warning in badgeColor to use the new property now

Copy link
Collaborator

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

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

Great change, thank you!

@hansemannn hansemannn merged commit c591f9c into master Jul 18, 2023
7 checks passed
@m1ga m1ga deleted the 230628_android_badgeTextColor branch September 23, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants