Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27837] Android: Custom theme ignored by modal/translucent windows as of 9.0.0

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2020-04-10T19:42:49.000+0000
Affected Version/sRelease 9.0.0
Fix Version/sRelease 9.0.1
ComponentsAndroid
Labelsandroid, modal, regression, theme, translucent, window
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-04-08T00:51:37.000+0000
Updated2020-06-16T14:30:09.000+0000

Description

*Summary:* As of Titanium 9.0.0, a custom Android theme/style defined in XML is ignored by windows: * With "modal" property set to true. * With "opacity" property set less than 1.0. (ie: translucent windows) *Steps to reproduce:*

Create a Classic app project with below files.

Build and run on Android.

Notice modal window's title bar is dark gray, but theme sets it to red.

Notice button's text is in all caps, but theme sets it to use lowercase letters.

app.js
var window = Ti.UI.createWindow({
	title: "Modal Window",
	modal: true,
});
var closeButton = Ti.UI.createButton({
	title: "Close",
});
closeButton.addEventListener("click", function() {
	window.close();
});
window.add(closeButton);
window.open();
tiapp.xml
<?xml version="1.0" encoding="UTF-8"?>
<ti:app>
	<android>
		<manifest>
			<application android:theme="@style/MyTheme"/>
		</manifest>
	</android>
</ti:app>
./platform/android/res/values/my_theme.xml
<?xml version="1.0" encoding="UTF-8"?>
<resources>
	<style name="MyTheme" parent="@style/Theme.AppCompat">
		<item name="buttonStyle">@style/MyButtonStyle</item>
		<item name="colorPrimary">#FF0000</item>
	</style>
	<style name="MyButtonStyle" parent="@style/Widget.AppCompat.Button">
		<item name="android:textAllCaps">false</item>
	</style>
</resources>

Comments

  1. Joshua Quick 2020-04-08

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/11600 PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11601
  2. Samir Mohammed 2020-04-09

    FR Passed on Master and 9_0_X. waiting on Jenkins build.
  3. Christopher Williams 2020-04-09

    merged to master and 9_0_X
  4. Satyam Sekhri 2020-04-10

    Verified on: Mac OS: 10.15.4 SDK: 9.0.1.v20200409100807, 9.1.0.v20200409073825 Appc CLI: 8.0.0 JDK: 11.0.4 Node: 10.17.0 Device: Pixel3(v10.0) emulator,

JSON Source