{ "id": "114282", "key": "TIMOB-13841", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15564", "description": "2013 Sprint 15 API", "name": "2013 Sprint 15 API", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "id": "15567", "description": "2013 Sprint 15", "name": "2013 Sprint 15", "archived": true, "released": true, "releaseDate": "2013-07-29" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-07-22T18:37:06.000+0000", "created": "2013-05-13T11:39:57.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "triage" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T21:35:43.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Problem*\r\nSometimes, when a new activity is launched, a black screen is displayed shortly before the content of the new activity is displayed. This flickering is disturbing to the user experience.\r\n\r\n*Steps to reproduce*\r\n1. Launch the app with the code below.\r\n2. Scroll to the end of the table.\r\n3. Scroll a little further so that the blue fading edge at the bottom appears and then within about max. 1 second tap on a list item.\r\n4. The screen will go black quickly before the content of the new activity (blue background color) appears\r\n5. If one waits a bit after scrolling and before tapping the item, this behavior does not appear\r\n\r\nThis is just one possibility of triggering this problem. The problem occurs with other user interactions as well, but I assume the reason for the problem is probably the same.\r\n\r\n*Test case*\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'red'\r\n});\r\n\r\nvar items = [];\r\nfor (var i = 0; i < 40; i++) {\r\n\titems.push({\r\n\t\tproperties : {\r\n\t\t\ttitle : 'Item' + i,\r\n\t\t\timage : 'https://raw.github.com/appcelerator/titanium_mobile/master/android/templates/app/default/Resources/android/appicon.png'\r\n\t\t}\r\n\t});\r\n}\r\n\r\nvar section = Ti.UI.createListSection({\r\n\titems : items\r\n});\r\n\r\nvar listView = Ti.UI.createListView({\r\n\tsections : [section]\r\n});\r\n\r\nlistView.addEventListener('itemclick', function(evt) {\r\n\tvar win2 = Ti.UI.createWindow({\r\n\t\tbackgroundColor : 'blue',\r\n\t\tmodal : 'false'\r\n\t});\r\n\r\n\twin2.open({\r\n\t\tanimated : false // disable animations between activities so the effect is better visible\r\n\t});\r\n});\r\n\r\nwin.add(listView);\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Black screen is displayed shortly when launching new activity", "creator": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium SDK 3.2.0 (HEAD)\r\nAndroid 4.2.1\r\nNexus S\r\n", "comment": { "comments": [ { "id": "251576", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed with Nexus 7 Android 4.2, Ti SDK 3.1 GA and latest 3.2 CI.\n\nCannot reproduce with Samsung Galaxy S2 Android 2.3.6 - although the ListView is much faster on that device.\n\nIt's very subtle though - speaking in terms of priority, it's a very minor issue.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-13T18:25:18.000+0000", "updated": "2013-05-13T18:25:18.000+0000" }, { "id": "251932", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "I have been trying to reproduce this, and i can't reproduce it on:\r\nSamsung Galaxy S2 Android 4.2.2 and latest 3.2.0\r\n\r\nI should mention that i am trying to reproduce it with a tableview. Philippe, can you reproduce it with a tableview?\r\n\r\nThough i have already seen that behavior. Will try and insist on this one", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-05-14T22:44:02.000+0000", "updated": "2013-05-14T22:44:02.000+0000" }, { "id": "252004", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "body": "It seems that this problem is not occuring on all devices.\r\n\r\nTo answer your question Martin: Yes, I have also seen this behavior with a TableView. I can also reproduce this behavior with only a window without a ListView or TableView, altough this may be a bit of a special/edge case: Have a window open a new activity with a click event listener. Double tap on the window and the flickering will appear when the two new activities are opened.\r\n\r\nAll in all, I don't think the issue is related to the ListView directly. It seems to me, that there is something which is delaying the layouting (onLayout method in TiCompositeLayout.java) on the new activity in some cases (e.g. when overscrolling in a ListView shortly before) which leads to a black screen being displayed shortly.\r\n\r\nIn my opinion, this is not a minor issue. It can be very disturbing within an actual app, when this happens about 50% of the time on launching new activities.", "updateAuthor": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-05-15T09:27:08.000+0000", "updated": "2013-05-15T09:27:08.000+0000" }, { "id": "255395", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "body": "I did some testing and noticed that the behavior is triggered when it takes too long after starting a new activity before the properties of the new window are applied.\r\n\r\nI looked at the timespan between sending the message \"MSG_MODEL_PROCESS_PROPERTIES\" in KrollProxy setModelListener and actually processing the properties in TiUIActivityWindow processProperties.\r\n\r\nThis timespan is around 40ms when no black screen is shown and there is a nice transition between the old and the new activity. When a black screen is shown during the transition, this timespan is always above around 120ms.\r\n\r\nBy changing the line \r\n{code}\r\ngetMainHandler().sendEmptyMessage(MSG_MODEL_PROCESS_PROPERTIES);\r\n{code}\r\nto\r\n{code}\r\nMessage msg = getMainHandler().obtainMessage(MSG_MODEL_PROCESS_PROPERTIES);\r\ngetMainHandler().sendMessageAtFrontOfQueue(msg);\r\n{code}\r\nin KrollProxy setModelListener, the properties are always applied fast enough, so that no black screen appears anymore and there is always a nice transition.\r\n\r\nI can't judge if this change has any unwanted side effects, but I have not noticed anything in a rather complex application which I tested this change with.\r\n", "updateAuthor": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-01T13:21:29.000+0000", "updated": "2013-06-01T13:21:29.000+0000" }, { "id": "255396", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pull request for the change mentioned in the last comment:\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4348", "updateAuthor": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-01T13:36:01.000+0000", "updated": "2013-06-01T13:36:01.000+0000" }, { "id": "262690", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce with the latest master. Probably fixed by TIMOB-13796.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-22T18:36:39.000+0000", "updated": "2013-07-22T18:36:39.000+0000" }, { "id": "414471", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced and due to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:35:43.000+0000", "updated": "2017-03-21T21:35:43.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }