{ "id": "104042", "key": "TIMOB-11597", "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": "14169", "description": "2012 Sprint 22 Core", "name": "2012 Sprint 22 Core", "archived": true, "released": true, "releaseDate": "2012-11-05" }, { "id": "14274", "description": "2012 Sprint 22", "name": "2012 Sprint 22", "archived": true, "released": true, "releaseDate": "2012-11-05" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-10-31T23:41:04.000+0000", "created": "2012-10-29T17:40:39.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "22341", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "103647", "key": "TIMOB-11539", "fields": { "summary": "Android: Action bar logo changes when action item is expanded", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T20:52:51.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": "The Action bar doesn't appear to handle orientation changes correctly. For example, if I specify an action item (menu item) with an icon and\r\n\r\n{code}\r\nshowAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS|Ti.Android.SHOW_AS_ACTION_WITH_TEXT,\r\n{code}\r\n\r\nThe text shows up only if the app is launched in landscape orientation, and doesn't go away if the app is rotated into portrait orientation. On the other hand, if I launch the app in portrait, only the icon is displayed, even when I rotate into landscape.\r\n\r\nOn a related topic, the app icon is displayed larger when I launch in landscape mode. It appears that we use two different sizes, one for the stacked action bar and one for the ordinary portrait-mode action bar. I'm not sure if this behavior is correct in the first place--I can't see a reference to it in the Android docs. However, both versions seem to be scaled differently based on whether it's launched in portrait or landscape, which is definitely wrong.\r\n", "attachment": [], "flagged": false, "summary": "Android: Action bar displays differently based on launch orientation", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "225455", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "body": "The behavior of the title showing or not when in portrait seems to be a proper behavior. From http://developer.android.com/guide/topics/ui/actionbar.html :\r\n\r\n{quote}Note: The \"withText\" value is a hint to the action bar that the text title should appear. The action bar will show the title when possible, but might not if an icon is available and the action bar is constrained for space.{quote}", "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2012-10-29T23:18:18.000+0000", "updated": "2012-10-29T23:18:18.000+0000" }, { "id": "225463", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, that behavior is correct--what's not correct is that it's not updating correctly when orientation changes. If you launch in landscape, you ALWAYS have the text, if you launch in portrait, you NEVER have the text. So it seems like there's something that we need to refresh when we change orientations (or else this is a bug in Android).\n\nTesting the built-in Google apps, NONE of them seem to follow the documented behavior. Settings, Notes, Gmail--wherever they use text with action items, they seem to use it consistently in both landscape and portrait. Maybe it'd be different on a different device, but it doesn't seem like they're following their own design guidelines.", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-30T00:02:01.000+0000", "updated": "2012-10-30T00:02:01.000+0000" }, { "id": "225476", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "body": "I was testing on my Galaxy Nexus running 4.1. I just took the tabbed application template project, and added the menu from the ActionBar JIRA ticket. Then I added an icon, and tweaked from there.", "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2012-10-30T02:02:16.000+0000", "updated": "2012-10-30T02:02:16.000+0000" }, { "id": "225758", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "On Titanium, the property android:configChanges is set to \"keyboardHidden|orientation|screenSize\" by default for targetSdkVersion >= 13. Based on the Android [doc|http://developer.android.com/guide/topics/resources/runtime-changes.html]:\n{quote}\nBeginning with Android 3.2 (API level 13), the \"screen size\" also changes when the device switches between portrait and landscape orientation. Thus, if you want to prevent runtime restarts due to orientation change when developing for API level 13 or higher (as declared by the minSdkVersion and targetSdkVersion attributes), you must include the \"screenSize\" value in addition to the \"orientation\" value.\n{quote}\nthis setting makes the app not to re-layout when orientation is changed. If we want the app to re-layout when changing the orientation, we can set\n{code}\n\n{code}\nin tiapp.xml.\nI also tested with a native Android project. The behavior is the same as described above. Mark the ticket as invalid.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-31T23:40:14.000+0000", "updated": "2012-10-31T23:40:14.000+0000" }, { "id": "225760", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "body": "Thanks for digging into this one!", "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2012-10-31T23:49:58.000+0000", "updated": "2012-10-31T23:49:58.000+0000" }, { "id": "225802", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Ping,\n\nThis is not working for me. When I build my project, the generated AndroidManfiest.xml shows:\n\n{code}\n\n{code}\nto the tiapp.xml.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-01T18:01:25.000+0000", "updated": "2012-11-01T18:01:25.000+0000" }, { "id": "225935", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "OK, so for those viewers playing at home, here's the lowdown. The switching DOES work, in the following cases:\n\nBoth the element and the launcher activity have to be declared with an action bar theme, such as \"@android:style/Theme.Holo\".\n\nTiActivity (and possibly also TiTranslucentActivity) need to be set to *not* handle the screenSize config change, like so:\n\n{code}\n\n{code}\n\nThis results in Android restarting the activity on orientation change. The bad news: this results in the original window being torn down and recreated, with a noticeable pause during which you can see whatever was under the current window (the desktop, another app, etc). I don't think we can recommend this course of action to users; it's a terrible user experience, and it occurs whether the app is native or Titanium.\n\nSo I'm going to create a new doc ticket recommending that users do *not* use SHOW_AS_ACTION_WITH_TEXT, but instead create an actionView if they want to display both text and icon. \n\nIf the application is inherently portrait-only or landscape-only, they can safely use SHOW_AS_ACTION_WITH_TEXT -- but otherwise the user experience is unacceptable.\n\nThe interesting thing is that showAsAction: SHOW_AS_ACTION_IF_ROOM is recalculated on reorientation--that is, the number of action items shown changes when moving from portrait to landscape and back.\n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-02T00:43:04.000+0000", "updated": "2012-11-02T00:43:04.000+0000" }, { "id": "414929", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T20:52:51.000+0000", "updated": "2017-03-22T20:52:51.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }