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

fix(android): toolbar items do not update when changing dark/light theme #12765

Merged
merged 2 commits into from May 20, 2021

Conversation

jquick-axway
Copy link
Contributor

JIRA:
https://jira.appcelerator.org/browse/TIMOB-28434

Summary:

  • Child views added to Ti.UI.Toolbar via its items properties do not update themselves after changing dark/light theme.
  • Only an issue when dynamically changing existing window.
  • Not an issue if view are added via the toolbar's add() method.

Test:

  1. Build and run the below JS code on Android 10 or higher.
  2. Tap on the "Home" button after app launches. (Do NOT back out.)
  3. Go to the Android system Settings -> Display screen.
  4. Toggle the dark/light theme switch.
  5. Resume the Titanium app.
  6. Verify toolbar button colors have changed. (Light blue for dark mode. See screenshots here.)
function createButton(name) {
	const button = Ti.UI.createButton({
		title: name,
		style: Ti.UI.BUTTON_STYLE_OPTION_NEUTRAL,
	});
	button.addEventListener("click", function() {
		alert(name + " was clicked on.");
	});
	return button;
}

const window = Ti.UI.createWindow();
const toolbar = Ti.UI.createToolbar({
	items: [
		createButton("Button 1"),
		createButton("Button 2"),
		createButton("Button 3")
	],
	elevation: 2,
	top: 0,
	width: Ti.UI.FILL,
});
window.add(toolbar);
window.open();

@jquick-axway jquick-axway added android bug no tests backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge labels May 3, 2021
@jquick-axway jquick-axway added this to the 10.1.0 milestone May 3, 2021
@build build requested a review from a team May 3, 2021 22:54
@build
Copy link
Contributor

build commented May 3, 2021

Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 14812 tests are passing.
(There are 961 skipped tests not included in that total)

Generated by 🚫 dangerJS against d73c869

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

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

CR: PASS

@lokeshchdhry
Copy link
Contributor

FR Passed.

@sgtcoolguy sgtcoolguy merged commit 5d34f16 into tidev:master May 20, 2021
@build build removed the backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge label May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants