Problem
Modal window's "top" is positioned under the Android status bar.
Sample Code
See Dawson's comments.
Note from Customer
From a customer (sums it up perfectly):
"Hello, when opening a modal window for droid, it appears that
the 'top' coordinate for the new window is inconsistent when
compared to iphone. In the kitchen sink example (Windows Standalone
-> Traditional Modal) you can see that the vibrate button is
position with the top coordinate of 0 being the very top of the
screen. This means that if you set top to 0 the button will be
partially covered by the status bar. So you need to account for the
status bar width when positioning elements. This is not the case
for iphone as the top '0' coordinate actually references the
starting point directly below the navigation bar. Obviously the
work around is simple enough but I think this should probably be
considered a bug or feature request? Here's a simple example:"
Tested On
BROKEN on Titanium SDK version: 1.7.0 (05/26/11 19:05 70a26b8...)
Associated Helpdesk Ticket
http://appc.me/c/65951
I have duplicated this issue with the following code:
Note that if you move the "modal: true" out of the win.open call, and place it directly in the window properties, this bug will NOT be present. It is only when you have modal: true as an argument to win.open that this shows up.
Another Reproduction
See Diane Hackborn's comment in: http://groups.google.com/group/android-developers/browse_thread/thread/ef45de483407d5cd ... re fullscreen (no status bar) not working with translucency (our modal activity is translucent)
Pull request ready: https://github.com/appcelerator/titanium_mobile/pull/126 Problem was we were using a fullscreen translucent theme for the modal activity. Two problems with this: * Parity problem: our iOS implementation is not using a fullscreen window by default for modals - -not sure why we were. * The combo of fullscreen (no status bar) + translucency does not work in Android (see link in previous comment). Switched to Theme.Translucent (instead of Theme.Translucent.NoTitleBar.Fullscreen) and now respect the navBarHidden and fullscreen flags as well when used with modal flag.
if
modal
is present we always use the modal theme even when modal isfalse
. *app.js**test.js*
*test2.js*
tested fix on 2.2 device and behavior looks good. approve of accepting associated pull request
Merged to master.
Tested with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836
Fixing labels.