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): menu item icon wrongly ignores theme #13106

Merged
merged 2 commits into from Oct 20, 2021

Conversation

jquick-axway
Copy link
Contributor

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

Summary:

  • When assigning a MenuItem "icon" property a res drawable integer ID, the app's theme is wrongly ignored.
  • This is only an issue if the drawable XML file contains color attributes. This is not an issue if it uses hard-coded colors.

Steps to reproduce:

  1. Use the below code as the "app.js".
  2. Create the following folder: ./platform/android/res/drawable
  3. Copy ic_baseline_delete_24.xml from TIMOB-28547 to above folder.
  4. Build and run on Android using the "light" theme.
  5. Verify you see a "gray" trash icon in the top-right corner. (Used to be white on white, making it invisible.)
const window = Ti.UI.createWindow();
window.activity.onCreateOptionsMenu = (e) => {
	const menuItem = e.menu.add({
		icon: Ti.App.Android.R.drawable.ic_baseline_delete_24,
		showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS,
	});
	menuItem.addEventListener("click", () => {
		alert("Menu item clicked on.");
	});
};
window.open();

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

@build
Copy link
Contributor

build commented Oct 20, 2021

Warnings
⚠️ Tests have failed, see below for more information.
Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 1 tests have failed There are 1 tests failing and 1162 skipped out of 20863 total tests.
📖

💾 Here's the generated SDK zipfile.

Tests:

ClassnameNameTimeError
android.emulator.main.Titanium.Geolocation.methods#forwardGeocoder() works via callback argument (12)5.012
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Geolocation.<anonymous> (/ti.geolocation.test.js:585:32)

Generated by 🚫 dangerJS against 85f2d1b

@jquick-axway jquick-axway merged commit f3c4057 into tidev:master Oct 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

3 participants