Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Low
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Release 9.3.0
-
Component/s: Android
-
Labels:
-
Story Points:3
-
Sprint:2020 Sprint 19
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 |
});
|