Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25223] Android: ListView in front of other views (wrong z-order)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-09-07T01:22:20.000+0000
Affected Version/sRelease 6.2.0
Fix Version/sRelease 6.2.0
Componentsn/a
Labelsandroid, automated, listview, regression
ReporterMichael Gangolf
AssigneeGary Mathews
Created2017-09-01T15:56:27.000+0000
Updated2017-09-15T23:15:40.000+0000

Description

*Summary:* When creating a ListView and adding a loading indicator (view + ActivitiyIndicator) after the ListView, the loading indicator is not visible with 6.2.0.RC *Code:*
var win = Ti.UI.createWindow({
		backgroundColor: 'gray'
	}),
	list = Ti.UI.createListView({
		separatorColor: "transparent",
		templates: {
			template: {
				childTemplates: [{
					type: 'Ti.UI.View',
					bindId: 'item',
					properties: {
						top: '5dp',
						bottom: '5dp',
						width: '200dp',
						height: '50dp',
						borderWidth: '8dp',
						backgroundColor: 'green'
					}
				}]
			}
		},
		defaultItemTemplate: 'template'
	}),
	section = Ti.UI.createListSection(),
	items = [];

for (var i = 0; i < 24; i++) {
	var colour = i % 2 ? 'green' : 'yellow';
	items.push({
		item: {
			backgroundColor: colour,
			borderColor: colour
		}
	});
}

section.setItems(items);
list.setSections([section]);
win.add(list);

var fgview = Ti.UI.createView({
	width: Ti.UI.FILL,
	height: Ti.UI.FILL,
	backgroundColor: "rgba(0,0,0,0.5)"
});
var act = Ti.UI.createActivityIndicator({});

fgview.add(act);
win.add(fgview);
act.show();
win.open();
*Results:* 6.1.2.GA: Black View + ActivityIndicator shown in front of the ListView 6.2.0.RC: ListView stays in front; black view + ActivityIndicator not visible

Comments

  1. Gary Mathews 2017-09-04

    It's not just related to ActivityIndicator, it's related to the height of the view. It seems Ti.UI.FILL is not being calculated correctly? *TEST CASE*
       var win = Ti.UI.createWindow({
       		backgroundColor: 'gray'
       	}),
       	list = Ti.UI.createListView(),
       	section = Ti.UI.createListSection({
       		items: [
       			{properties: {title: 'Square'}},
       			{properties: {title: 'Circle'}},
       			{properties: {title: 'Triangle'}}
       		]
       	}),
       	view = Ti.UI.createView({
       		width: Ti.UI.FILL,
       		height: 200, //Ti.UI.FILL,
       		backgroundColor: 'red'
       	});
       
       list.setSections([section]);
       win.add([list, view]);
       
       win.open();
       
  2. Gary Mathews 2017-09-04

  3. Gary Mathews 2017-09-04

    -master-: https://github.com/appcelerator/titanium_mobile/pull/9397 -6_2_X-: https://github.com/appcelerator/titanium_mobile/pull/9396
  4. Gary Mathews 2017-09-06

    Continued by: master: https://github.com/appcelerator/titanium_mobile/pull/9403 6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9404
  5. Lokesh Choudhary 2017-09-07

    FR Passed. PR's merged.
  6. Lokesh Choudhary 2017-09-07

    Verified the fix in SDK 6.2.0.v20170907070223 & 7.0.0.v20170907070720. Closing. Studio Ver: 4.9.1.201707200100 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.4-9 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.13 Node Ver: 6.11.2 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 — Android 6.0.1 ⇨ google Pixel — Android 7.1.1

JSON Source