[TIMOB-28084] Android: Modal/Translucent window ignores <navbar-hidden/> setting in "tiapp.xml"
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-11-25T14:59:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.3.0 |
Components | Android |
Labels | android, theme, translucent, window |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-08-15T00:49:29.000+0000 |
Updated | 2020-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
});
PR (9.3.x): https://github.com/appcelerator/titanium_mobile/pull/11921
FR Passed, waiting on Jenkins build.
*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