Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28084

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

    Details

    • 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:

      1. Copy the below "tiapp.xml" setting.
      2. Build and run the below code on Android.
      3. Notice that the 1st window does not show title bar. (This is good.)
      4. Tap on the "Show Translucent Window" button.
      5. 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
      });
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Samir Mohammed
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration