{ "id": "163593", "key": "TIMOB-23974", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-10-06T15:28:08.000+0000", "created": "2016-10-02T09:57:50.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "community", "notable", "property", "visible" ], "versions": [ { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-12-18T18:52:26.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": "On Android you can set 3 visible values: visible, invisible and gone. Currently gone is not supported in Titanum. With this setting you can free the space an object has when hiding it. \r\n\r\nThe screenshot shows two vertical layout views with the first three elements hidden. On the left side is the normal behaviour; on the right side I've used gone instead of invisible (the four bottom boxes move up).\r\n\r\nThe property is called `hiddenBehavior` and can control the behavior when hiding a view. When you set it to `true` and call `hide()` it will either release the space (new) or retain the space (default). Default value is still {{Ti.UI.VIEW_INVISIBLE}} so it behaves like normal when you don't change it.\r\nWhen you show the object again it will take up the previous space again\r\n\r\n*Current workaround to release the space:*\r\nHiding: save the current object height, hide the object, set the height to 0.\r\nShowing: show the object, set the height to the saved value.\r\n\r\n*Parity?*\r\nNot sure if this is possible on iOS. Perhaps someone else can add this part", "attachment": [ { "id": "60400", "filename": "Screenshot_2016-10-02-11-45-55.png", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-02T09:50:05.000+0000", "size": 25411, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Add property to release space when hiding an object", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "397840", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/8458\r\n\r\nin the documentation I've put 6.0.0. Not sure if its 6.1.0 already :)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-02T10:22:13.000+0000", "updated": "2016-10-02T10:22:13.000+0000" }, { "id": "397851", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Changed the property name to {{hiddenBehavior}} with two constants {{Ti.UI.HIDDEN_BEHAVIOR_INVISIBLE}} and {{Ti.UI.HIDDEN_BEHAVIOR_INVISIBLE}}\r\nUpdated example:\r\n\r\n{code:java}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar v1 = Ti.UI.createView({\r\n left: 0,\r\n width: \"50%\",\r\n height: Ti.UI.FILL,\r\n layout: \"vertical\"\r\n})\r\n\r\nvar v2 = Ti.UI.createView({\r\n right: 0,\r\n width: \"50%\",\r\n height: Ti.UI.FILL,\r\n layout: \"vertical\"\r\n});\r\n\r\nfor (var i = 0; i < 7; ++i) {\r\n var v = Ti.UI.createView({\r\n width: 50,\r\n height: 50,\r\n backgroundColor: \"#\" + i + \"\" + i + \"\" + i + \"\" + i + \"\" + i + \"\" + i,\r\n bottom: 10,\r\n hiddenBehavior: Ti.UI.HIDDEN_BEHAVIOR_INVISIBLE\r\n })\r\n v1.add(v);\r\n v.addEventListener(\"click\", onClick);\r\n}\r\nfor (var i = 0; i < 7; ++i) {\r\n var v = Ti.UI.createView({\r\n width: 50,\r\n height: 50,\r\n backgroundColor: \"#\" + i + \"\" + i + \"\" + i + \"\" + i + \"\" + i + \"\" + i,\r\n bottom: 10,\r\n hiddenBehavior: Ti.UI.HIDDEN_BEHAVIOR_GONE\r\n })\r\n v2.add(v);\r\n v.addEventListener(\"click\", onClick);\r\n}\r\n\r\nfunction onClick(e) {\r\n e.source.hide();\r\n}\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: \"Show all\",\r\n bottom: 0\r\n})\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n for (var i = 0; i < v1.children.length; ++i) {\r\n v1.children[i].show();\r\n v2.children[i].show();\r\n }\r\n});\r\n\r\nwin.add(v1);\r\nwin.add(v2);\r\nwin.add(btn);\r\nwin.open();\r\n\r\n{code}\r\n", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-02T16:29:59.000+0000", "updated": "2016-10-02T17:33:06.000+0000" }, { "id": "401641", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, {{hiddenBehavior: Ti.UI.HIDDEN_BEHAVIOR_INVISIBLE}} was able to hide the objects in the list of boxes without any of the boxes moving up. While {{Ti.UI.HIDDEN_BEHAVIOR_GONE}} was able to hide the objects and then the remaining boxes would move up.\r\n\r\n*Environment *\r\n{code:java}\r\nAppcelerator Command-Line Interface, version 6.0.0\r\nAndroid 7.0 (Google Nexus 6P)\r\nOperating System Name: Mac OS X El Capitan\r\nOperating System Version: 10.11.6\r\nNode.js Version: 4.6.0\r\nnpm: 4.2.8\r\nTitanium CLI Version: 5.0.10\r\nTitanium SDK Version: 6.1.0.v20161121091240\r\nXcode: 8.0\r\n4.8.0.201611121409\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-21T19:45:32.000+0000", "updated": "2016-11-21T19:46:35.000+0000" }, { "id": "432289", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Hi guys, is there parity for this functionality in iOS?\r\nThanks", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2017-12-18T12:18:00.000+0000", "updated": "2017-12-18T12:18:00.000+0000" }, { "id": "432303", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "If I remember correctly there was no equivalent on iOS to release hidden space, so you have to use the {{height:0}} workaround", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-12-18T18:52:26.000+0000", "updated": "2017-12-18T18:52:26.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }