{ "id": "127101", "key": "TIMOB-16550", "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": "16270", "description": "2014 Sprint 10", "name": "2014 Sprint 10", "archived": true, "released": true, "releaseDate": "2014-05-22" }, { "id": "16271", "description": "2014 Sprint 10 SDK", "name": "2014 Sprint 10 SDK", "archived": true, "released": true, "releaseDate": "2014-05-22" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2014-05-22T05:35:29.000+0000", "created": "2014-03-04T17:59:02.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "supportTeam" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" }, { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-29T01:00:49.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": "h3. Issue\r\n\r\nCustomer is using textfields and a button to create a simple form in their project and after they focus on any of the textfield elements the button shifts the title align from center to left.\r\n\r\nTested and reproduce by customer in HTC Ruby with Android 4.0.3 and \r\n\r\nh3. Testing\r\n\r\nAfter testing we have found this behavior appears to be be present on Android versions under 4.3\r\n\r\nTest and reproduced by support at:\r\n\r\nSony LT 22i\r\nAndroid 4.1.2\r\n\r\nWhile testing this issue is not reproducible with devices:\r\n\r\nSamsung Galaxy S4\r\nAndroid 4.3\r\n\r\nNexus 7\r\nAndroid 4.4\r\n\r\nh3. Sample Code\r\n\r\n{code}\r\nvar OF = {};\r\nOF.apply = function(ro, so, defaults){\r\n if(defaults){\r\n OF.apply(ro, defaults);\r\n }\r\n if(ro && so && typeof so == 'object'){\r\n for(var i in so){\r\n ro[i] = so[i];\r\n }\r\n }\r\n return ro;\r\n};\r\nOF.combine = function(obj, props){\r\n var newObj = {};\r\n OF.apply(newObj, obj);\r\n return OF.apply(newObj, props);\r\n};\r\nvar TEXT_FIELD_HEIGHT = 50,\r\n FONT_FAMILY = 'Roboto-Regular',\r\n $ = {horizontalSpacing : 10},\r\n $$ = {\r\n bgColor : '#E9E9E9',\r\n horizontalSpacing : $.horizontalSpacing,\r\n actionBtn : {\r\n backgroundImage : \"/images/action_button_slice.png\",\r\n title : 'Action',\r\n font : {\r\n fontFamily : FONT_FAMILY,\r\n fontSize : 20,\r\n fontWeight : 'bold',\r\n verticalAlign : 'center',\r\n color : 'black'\r\n },\r\n textAlign : 'center',\r\n color : 'black',\r\n top : $.horizontalSpacing,\r\n width: 294,\r\n height : 57\r\n }\r\n };\r\n\r\nvar create_login_window = function(window){\r\n\r\nvar popupView = Ti.UI.createView({\r\n backgroundImage: '/images/loginBG_bottom.png',\r\n opacity : 1.0,\r\n top : 0, bottom : 0,\r\n left : 0, right : 0,\r\n layout : 'vertical'\r\n});\r\nvar scrollView = Titanium.UI.createScrollView({\r\n backgroundColor : $$.bgColor,\r\n backgroundImage : '/images/loginBG_bottom.png',\r\n top:0, bottom : 0,\r\n showVerticalScrollIndicator:false,\r\n showHorizontalScrollIndicator:false\r\n});\r\n\r\nscrollView.add(popupView);\r\nwindow.add(scrollView);\r\n\r\nvar popupViewTop = Titanium.UI.createView({\r\n backgroundImage: null,\r\n backgroundColor : 'white',\r\n opacity : 1.0,\r\n top : 0,\r\n height : 175,\r\n width : Ti.UI.FILL\r\n});\r\npopupView.add(popupViewTop);\r\n\r\nvar logoImageView = Ti.UI.createImageView({\r\n image : '/images/login_logo.png',\r\n width : 269,\r\n height : 104,\r\n});\r\npopupViewTop.add(logoImageView);\r\n\r\n\r\nvar popupViewBottom = Titanium.UI.createView({\r\n backgroundImage: '/images/android_login_bottom_slice.9.png',\r\n opacity : 1.0,\r\n top : 0,\r\n height : Ti.UI.FILL,\r\n width : Ti.UI.FILL,\r\n layout : 'vertical'\r\n});\r\npopupView.add(popupViewBottom);\r\n\r\nvar usernameText = Ti.UI.createTextField({\r\n autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,\r\n borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,\r\n font:{\r\n fontFamily : FONT_FAMILY,\r\n fontSize : 14\r\n },\r\n color : '#808080',\r\n borderWidth : 1,\r\n borderRadius : 5,\r\n bubbleParent : false,\r\n hintText : 'Enter username',\r\n value : '',\r\n autocorrect : false,\r\n clearOnEdit : false,\r\n returnKeyType: Titanium.UI.RETURNKEY_DONE,\r\n top : 0,\r\n left : $$.horizontalSpacing,\r\n right : $$.horizontalSpacing,\r\n height : TEXT_FIELD_HEIGHT\r\n});\r\npopupViewBottom.add(usernameText);\r\n\r\nvar passwordText = Ti.UI.createTextField({\r\n autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,\r\n borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,\r\n font:{\r\n fontFamily : FONT_FAMILY,\r\n fontSize : 14\r\n },\r\n color : '#808080',\r\n borderWidth : 1,\r\n bubbleParent : false,\r\n borderRadius : 5,\r\n hintText : 'Enter password',\r\n value : '',\r\n clearOnEdit : true,\r\n top : $$.horizontalSpacing/2,\r\n left : $$.horizontalSpacing,\r\n right : $$.horizontalSpacing,\r\n returnKeyType : Titanium.UI.RETURNKEY_DONE,\r\n height : TEXT_FIELD_HEIGHT,\r\n passwordMask : false\r\n});\r\npopupViewBottom.add(passwordText);\r\n\r\nvar server = Ti.UI.createTextField({\r\n autocapitalization:Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,\r\n borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,\r\n font : {\r\n fontFamily : FONT_FAMILY,\r\n fontSize : 14\r\n },\r\n color : '#808080',\r\n borderWidth: 1,\r\n bubbleParent : false,\r\n borderRadius: 5,\r\n hintText : 'Enter servername',\r\n value:'',\r\n clearOnEdit: false,\r\n top : 0,\r\n left : $$.horizontalSpacing,\r\n right : $$.horizontalSpacing,\r\n autocorrect : false,\r\n returnKeyType: Titanium.UI.RETURNKEY_DONE,\r\n height : TEXT_FIELD_HEIGHT\r\n});\r\npopupViewBottom.add(server);\r\n\r\n\r\npasswordText.addEventListener('focus', function() {\r\n passwordText.passwordMask = true; \r\n});\r\n\r\nvar loginButton = Ti.UI.createButton(OF.combine($$.actionBtn, {\r\n backgroundImage : null,\r\n title : 'Sign In',\r\n left : $$.horizontalSpacing,\r\n right : $$.horizontalSpacing,\r\n width : null,\r\n textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n top : 10\r\n}));\r\n\r\npopupViewBottom.add(loginButton);\r\n};\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : '#fff',\r\n title :'test'\r\n});\r\ncreate_login_window(win);\r\nwin.open();\r\n{code}\r\n\r\nh3. Steps to repro\r\n\r\n1. Run the test case\r\n2. Focus on a textfield\r\n3. Close the keyboard\r\n\r\nAfter this the button title will be aligned to the left.\r\n\r\n", "attachment": [ { "id": "46334", "filename": "2014-02-24_19-32-14.png", "author": { "name": "mcota", "key": "mcota", "displayName": "Marco Cota", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-04T17:59:02.000+0000", "size": 42574, "mimeType": "image/png" }, { "id": "46335", "filename": "2014-02-24_19-32-20.png", "author": { "name": "mcota", "key": "mcota", "displayName": "Marco Cota", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-04T17:59:02.000+0000", "size": 69284, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Button title shifts to the left when Texfield is focus", "creator": { "name": "mcota", "key": "mcota", "displayName": "Marco Cota", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mcota", "key": "mcota", "displayName": "Marco Cota", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Product: Titanium SDK\r\nTitanium SDK: Mobile 3.2GA\r\nPlatform OS: Android\r\nPlatform OS Version: 4.0", "closedSprints": [ { "id": 50, "state": "closed", "name": "2014 Sprint 09 Tooling", "startDate": "2014-04-28T15:43:24.381Z", "endDate": "2014-05-10T03:44:00.000Z", "completeDate": "2014-05-12T13:36:16.254Z", "originBoardId": 113 }, { "id": 104, "state": "closed", "name": "2014 Sprint 10 SDK", "startDate": "2014-05-12T16:00:00.000Z", "endDate": "2014-05-24T00:00:00.000Z", "completeDate": "2014-05-27T18:11:47.424Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "306038", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Seems to be a layout issue where implicit FILL behavior is causing issues on some devices. Might very well be a device specific issue. \r\nThe workaround posted below worked for me on HTC EVO running 4.0.3 (Using Explicit FILL behavior for WIDTH and HEIGHT on Button)\r\n\r\n{code}\r\nvar btnWrapper = Ti.UI.createView({\r\n\tleft: $$.horizontalSpacing,\r\n\tright: $$.horizontalSpacing,\r\n\ttop: 10,\r\n\theight :$$.actionBtn.height\r\n});\r\n \r\nvar loginButton = Ti.UI.createButton(OF.combine($$.actionBtn, {\r\n backgroundImage : null,\r\n title : 'Sign In',\r\n top:0,\r\n width : Ti.UI.FILL,\r\n height: Ti.UI.FILL,\r\n textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n}));\r\n\r\nbtnWrapper.add(loginButton);\r\n \r\npopupViewBottom.add(btnWrapper);\r\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-22T05:23:52.000+0000", "updated": "2014-05-22T05:23:52.000+0000" }, { "id": "306043", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "We do not control the rendering of the button. The fact that the title is not center aligned after a **postlayout** seems to be a native platform issue on certain devices. We actually layout the button correctly based on the positioning parameters.\r\n\r\nResolving this as NOT OUR BUG.\r\n\r\nPossible JS workaround in comments ", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-22T05:35:29.000+0000", "updated": "2014-05-22T05:35:29.000+0000" }, { "id": "416106", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue here is not our bug.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-29T01:00:49.000+0000", "updated": "2017-03-29T01:00:49.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }