Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15550] Android Maps V2: Map is placed in a view hierarchy can sometimes be placed below all views

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2013-10-25T00:40:27.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 23, 2013 Sprint 23 API
ComponentsAndroid
Labelsn/a
ReporterAllen Yeung
AssigneeIngo Muschenetz
Created2013-10-21T23:37:50.000+0000
Updated2017-03-03T21:48:21.000+0000

Description

Problem

When the map is placed in a view hierarchy it can sometimes be placed below all views (even below the window background color). This happens for example when you animate the parent view position. But when placed in a quite large view hierarchy I've noted that it randomly can behave the same as described above. Run the code on 4.2.x device with Google Play installed.

Test case

var win = Ti.UI.createWindow({
   backgroundColor : 'transparent',
   orientationModes : [Titanium.UI.PORTRAIT],
   exitOnClose : true,
   navBarHidden : true
});
win.open();
 
var view2 = Ti.UI.createView({
    width : Ti.UI.FILL,
    height : Ti.UI.FILL,
    backgroundColor : 'transparent'
});
 
var view3 = Ti.UI.createView({
    top : 0,
    left : 0,
    width : 500,
    height : 200,
    backgroundColor : 'yellow'
});
var label = Ti.UI.createLabel({
    color:'black',
    text: "You should not see me if zOrderOnTop is set to true",
    textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
    font: { fontSize: 30 },
    top: 0,
    left : 0
});
view3.add(label);
 
var MapModule = require('ti.map');
var mapview = MapModule.createView({
    mapType:MapModule.NORMAL_TYPE,
    //zOrderOnTop: true
});
view2.add(mapview);
view2.add(view3);
win.add(view2);
 
1. Run the above code, you should see yellow label on top 2. Uncomment zOrderOnTop property, run it again, you should NOT see yellow label. Depending on device, you may see the yellow label flashing for a little bit, as Android relayout its children. But once re-layout is done, you should NOT see the yellow label. Fail case: yellow label on top of map Expected case: should not see yellow label. This only happens on the first launch of the app on certain devices (listed in environment).

Comments

  1. Hieu Pham 2013-10-25

    The test case above isn't the original test case. It is my test case in an attempt to create a consistent use case for zOrderOnTop. The original fail case can no longer be reproduced with the current map version. I'm closing this issue since it's not really a bug.
  2. Lee Morris 2017-03-03

    Closing as invalid.

JSON Source