{ "id": "85041", "key": "TIMOB-7259", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13401", "description": "Sprint 2012-09 Core", "name": "Sprint 2012-09 Core", "archived": true, "released": true, "releaseDate": "2012-05-06" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-05-02T10:22:03.000+0000", "created": "2012-01-17T10:58:26.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "core", "module_gesture", "parity", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-06T16:37:12.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": "h2. Problem\r\n\r\nIf initial orientation of the emulator is landscape, two orientationchange events are fired when re-orienting to portrait. Thereafter, it works as expected.\r\n\r\nThe same does not happen when initial orientation is portrait.\r\n\r\nh2. Test case\r\n\r\n* set emulator to landscape (CTRL+F11)\r\n* launch app with code below\r\n\r\n{code:lang=javascript|title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n title: 'Rotate device to test',\r\n backgroundColor: 'white',\r\n orientationModes: [ Titanium.UI.PORTRAIT, Titanium.UI.UPSIDE_PORTRAIT, Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT ],\r\n fullscreen: false, // same results regardless of whether its a heavyweight window\r\n exitOnClose: true\r\n});\r\n\r\nTi.Gesture.addEventListener('orientationchange',function(e){\r\n Titanium.API.info(\"orientation changed = \" + Ti.Gesture.orientation + \", is portrait? \" + e.source.isPortrait() + \", is landscape? \" + e.source.isLandscape());\r\n});\r\nwin.open();\r\n{code}\r\n\r\nh2. Logs\r\n\r\n{code:lang=none}\r\n 421 AndroidRuntime D >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<\r\n 421 AndroidRuntime D CheckJNI is ON\r\n 422 TiApplication I (main) [0,0] checkpoint, app created.\r\n 421 AndroidRuntime D --- registering native functions ---\r\n 422 TiApplication I (main) [399,399] Titanium 2.0.0 (2012/03/01 14:01 0ccdf63)\r\n 422 TiFastDev D (main) [276,675] Enabling Fastdev on port 46158\r\n 422 TiFastDev D (main) [21,696] sent tokens successfully\r\n 422 TiFastDev D (main) [1,697] Fastdev session handshake succesful.\r\n 422 TiApplication I (main) [24,721] Titanium Javascript runtime: v8\r\n 422 TiRootActivity I (main) [0,0] checkpoint, on root activity create, savedInstanceState: Bundle[mParcelledData.dataSize=204]\r\n 61 ActivityManager I Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.appcelerator.testing10/.Testing10Activity }\r\n 421 AndroidRuntime D Shutting down VM\r\n 421 AndroidRuntime I NOTE: attach of thread 'Binder Thread #3' failed\r\n 422 TiApplication E (KrollRuntimeThread) [1126,1126] APP PROXY: ti.modules.titanium.app.AppModule@44fc8058\r\n 422 TiAssetHelper D Fetching \"app.js\" with Fastdev...\r\n 61 ActivityManager I Starting activity: Intent { cmp=com.appcelerator.testing10/org.appcelerator.titanium.TiActivity (has extras) }\r\n 422 TiRootActivity I (main) [0,0] checkpoint, on root activity resume. activity = com.appcelerator.testing10.Testing10Activity@44f60a88\r\n 422 TiUIView D (main) [440,440] Nativeview is null\r\n 422 TiUIView D (main) [44,484] Nativeview is null\r\n 61 InputManagerService W Got RemoteException sending setActive(false) notification to pid 401 uid 10040\r\n 61 NotificationService W Object died trying to hide notification android.app.ITransientNotification$Stub$Proxy@4509fef8 in package com.appcelerator.testing10\r\n 61 ActivityManager W setProcessForeground called on unknown pid: 401\r\n 61 ActivityManager I Displayed activity com.appcelerator.testing10/.Testing10Activity: 14070 ms (total 3531 ms)\r\n 61 ActivityManager I Displayed activity com.appcelerator.testing10/org.appcelerator.titanium.TiActivity: 701 ms (total 701 ms)\r\n 61 ActivityManager I Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=27}\r\n 422 TiAPI I orientation changed = 2, is portrait? false, is landscape? true\r\n 61 WindowManager I Setting rotation to 0, animFlags=0\r\n 61 ActivityManager I Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=28}\r\n 422 TiAPI I orientation changed = 1, is portrait? true, is landscape? false\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Gesture - orientation change fires on app start when initial orientation is landscape", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": "* Titanium 1.9.0 (2012/01/16 11:16 366b32d), 2.0.0 (2012/03/01 14:01 0ccdf63)\r\n* v8 runtime\r\n* Android 2.2\r\n* emulator\r\n* Ubuntu 10.04\r\n* Studio 1.0.8.201201091758", "comment": { "comments": [ { "id": "193159", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR pending https://github.com/appcelerator/titanium_mobile/pull/2105", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-30T10:55:21.000+0000", "updated": "2012-04-30T10:55:21.000+0000" }, { "id": "193345", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The primary cause of the issue is that Android OS reports onConfigurationChanged twice when activity starts in landscape mode. The solution is to remember correct current orientation on activity start.", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-01T15:32:51.000+0000", "updated": "2012-05-01T15:32:51.000+0000" }, { "id": "199929", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix with \r\nTitanium Studio, build: 2.1.0.201206221045\r\nTitanium SDK: 2.1.0.v20120622174154\r\nDevice: Nexus S 4.0.4\r\n", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-23T14:35:09.000+0000", "updated": "2012-06-23T14:35:09.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }