[TIMOB-23451] Android: Window rect attribute return wrong device height and width value
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2018-12-11T08:39:16.000+0000 |
Affected Version/s | Release 5.2.2 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Sharif AbuDarda |
Assignee | Unknown |
Created | 2016-05-28T05:26:14.000+0000 |
Updated | 2018-12-11T08:39:16.000+0000 |
Description
Hello, Below is a test case which demonstrates the issue.
var window = Ti.UI.createWindow( {
'width' : '100%',
'height' : '100%'
} );
window.addEventListener( 'click', function ( event ) {
console.log( 'x: ' + Math.round( event.x ) );
console.log( 'y: ' + Math.round( event.y ) );
console.log( 'window width: ' + event.source.rect.width );
console.log( 'window height: ' + event.source.rect.height );
console.log( 'screen width: ' + Ti.Platform.displayCaps.platformWidth );
console.log( 'screen height: ' + Ti.Platform.displayCaps.platformHeight );
} );
window.open();
As the window width and height is 100% to the device screen, The value of
console.log( 'window width: ' + event.source.rect.width );
and
console.log( 'screen width: ' + Ti.Platform.displayCaps.platformWidth );
should be same. Also, same goes for height values.
Window's height is different than displayCaps height because of the title bar. As you can see, the window isn't exactly fullscreen. The width return are identical.