Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28084] Android: Modal/Translucent window ignores <navbar-hidden/> setting in "tiapp.xml"

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2020-11-25T14:59:07.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.3.0
ComponentsAndroid
Labelsandroid, theme, translucent, window
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-08-15T00:49:29.000+0000
Updated2020-11-25T14:59:07.000+0000

Description

*Summary:* If "tiapp.xml" has <navbar-hidden/> set to true, then it is ignored by windows which... * Have "modal" set to true * Have an "opacity" less than 1.0 * Have an RGBA background color with a transparent alpha * Have a "translucent" theme *Note:* If a custom theme is applied to the <application/> element in the "AndroidManifest.xml", then the <navbar-hidden/> setting should be ignored. This is because the custom theme takes priority and must hide the top ActionBar/TitleBar instead. *Steps to reproduce:*

Copy the below "tiapp.xml" setting.

Build and run the below code on Android.

Notice that the 1st window does not show title bar. _(This is good.)_

Tap on the "Show Translucent Window" button.

Notice that shown window has a tile bar. _(This is the bug.)_

tiapp.xml
<ti:app>
	<navbar-hidden>true</navbar-hidden>
</ti:app>
app.js
var parentWindow = Ti.UI.createWindow({
	title: "Parent Window",
	backgroundColor: "white",
});
var openButton = Ti.UI.createButton({
	title: "Show Translucent Window",
	bottom: "15dp",
});
openButton.addEventListener("click", function() {
	var childWindow = Ti.UI.createWindow({
		title: "Translucent Window",
		backgroundColor: "black",
		opacity: 0.5,
	});
	childWindow.add(Ti.UI.createLabel({
		text: "This is the translucent window.",
		color: "white",
	}));
	childWindow.addEventListener("open", function() {
		setTimeout(function() {
			childWindow.close();
		}, 1500);
	});
	childWindow.addEventListener("androidback", function() {
		childWindow.close();
		parentWindow.close();
	});
	childWindow.open();
});
parentWindow.add(openButton);
parentWindow.open();
*Work-Around:* Use the "Theme.AppCompat.Translucent.NoTitleBar" theme.
var childWindow = Ti.UI.createWindow({
	title: "Translucent Window",
	backgroundColor: "black",
	opacity: 0.5,
	theme: "Theme.AppCompat.Translucent.NoTitleBar", // <- Add this
});

Comments

  1. Joshua Quick 2020-08-18

    PR (9.3.x): https://github.com/appcelerator/titanium_mobile/pull/11921
  2. Samir Mohammed 2020-09-28

    FR Passed, waiting on Jenkins build.
  3. Samir Mohammed 2020-11-25

    *Closing ticket*. bug fix verified in SDK version 9.3.0.v20201125050632. *Test and other information can be found at: *https://github.com/appcelerator/titanium_mobile/pull/11921

JSON Source