We have a full-screen view that contains a 5x2 grid of Images with two pages.
I have discovered that I can reliably crash the toolkit on an LG TV by paging the grid between the two pages. It malfunctions even when the images have been shrunk to postage stamps (56x47).
And by "crash the toolkit" I mean the widgets disappear and I have to press the purple button and wait for it to scan for updates before the snippets appear again.
Is it related to lines of the following form that appear when I run the app in the simulator?
CODE
SB 00:03:05:051: [T:20423] SurfaceBook: curr = 18.034MB (113) : peak = 29.760MB (212)
SB 00:03:13:231: [T:20423] SurfaceBook: curr = 19.852MB (120) : peak = 29.760MB (212)
SB 00:03:18:681: [T:20423] SurfaceBook: curr = 21.711MB (131) : peak = 29.760MB (212)
SB 00:03:26:032: [T:20423] SurfaceBook: curr = 23.529MB (138) : peak = 29.760MB (212)
SB 00:03:41:872: [T:20423] SurfaceBook: curr = 11.174MB (93) : peak = 29.760MB (212)
I have tried code like this in the cellUpdater of the grid:
CODE
if (false) {
cell.content.setSource(dataItem.imageURL);
} else {
if (cell.content != null) {
cell.removeChild(cell.content);
cell.content = null;
}
var image = new KONtx.element.Image({
missingSrc: "image/blankMovie.png",
loadingSrc: "image/loadingMovie.png",
src: dataItem.imageURL,
remoteAsync: true,
styles: {
height: cell.height - 5,
width: cell.width - 5,
vOffset: 0
//hAlign: 'center',
//vAlign: 'bottom'
}
});
cell.content = image.appendTo(cell);
var fitImageCallback = function() {
return;
OSUtils.centerImageInRectangle(cell.content, {
x: 2,
y: 2,
width: cell.width-4,
height: cell.height-4
})
};
// make sure that we resize the image correctly once we know its dimensions
fitImageCallback.subscribeTo(cell.content, 'onLoaded', cell.content);
}
You can spot several variations we have tried and disabled.
What tactics should we use to prevent crashes in image-intensive views?