Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12734] Android: View.setLayout() does not change the view's layout property

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-08-17T00:23:50.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsAndroid
Labelsalloy, android, api, setlayout
ReporterVarun Joshi
AssigneeJoshua Quick
Created2013-02-01T20:20:14.000+0000
Updated2017-08-17T01:01:13.000+0000

Description

I've added an event to a button to change the layout property of a view. Each tap will turn the layout of this view to horizontal -> vertical -> composite then come back at horizontal, etc... In the iOS simulator everything works like expected, the children views are relocated as the layout of the parent changes. But it does not work in the Android simulator or Android device (HTC Sensation, Android 4.1) They stay at the same place. (The purpose of this app, was a simple test to understand the layout property.) Could this be a bug?

Attachments

FileDateSize
app.zip2013-02-05T09:51:04.000+00005768560
LayoutChange-Composite.png2017-08-16T18:39:42.000+000034515
LayoutChange-Horizontal.png2017-08-16T18:39:42.000+000034650
LayoutChangeTest.js2017-08-16T18:39:42.000+00001467
LayoutChange-Vertical.png2017-08-16T18:39:42.000+000034673

Comments

  1. Varun Joshi 2013-02-04

    Kevin, Please provide the sample test case that can reproduce the issue you are having. Thanks,
  2. Kevin Purnelle 2013-02-05

    Example app that can reproduce the problem You can have more details about how to test the issue in the readme file Edit: it's built with alloy
  3. Tony Lukasavage 2013-02-08

    Can you create the test case without Alloy? This doesn't sound Alloy-specific and is likely better suited for the Android platform team.
  4. Kevin Purnelle 2013-02-14

    Sorry , I don't know why but I don't get updates notifications anymore. Do I still need to provide a test app without Alloy. If it's API related it does not matter how the app was structured, or not?
  5. Tony Lukasavage 2013-02-14

    Kevin, it was essentially to determine whether I need to address this as an Alloy-specific issue, or if the platform team needs to address it at an API level. It sounds to me like you are pretty confident it's an API level issue. I'll move the ticket to TIMOB.
  6. ankur garha 2013-10-20

    Im also facing the same problem. Is there any temporary workaround for this issue as of now.
  7. Unknown 2014-04-21

    This issue was previously scheduled to be worked on in more than one sprint: * 'Release 3.1.2' (on board '3.1.X Triage') * 'Release 3.0.1/TS 3.0.2' (on board '3.1.0 Triage') Starting from JIRA Agile 6.3, an issue can only belong to a single future sprint. Read more about this change: http://docs.atlassian.com/agile/docs-0630/Sprint+Marker+Migration This issue is now scheduled for future sprint 'Release 3.1.2' (on board '3.1.X Triage'). If this is incorrect, please update the issue accordingly. This comment was automatically generated by JIRA. If it is no longer relevant, please feel free to delete it.
  8. Osian Evans 2015-01-14

    Also getting this issue without using Alloy. 3.4.0GA on device. Has this been re-scheduled?
  9. Carlos Henrique Zinato 2016-09-29

    Any news on that guys? This ticket is quite old =/
  10. Joshua Quick 2017-08-16

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9323 PR (6.2.x): https://github.com/appcelerator/titanium_mobile/pull/9324
  11. Joshua Quick 2017-08-16

    The attached [^LayoutChangeTest.js] file can be used to help test dynamic layout changes. Also see the attached "LayoutChange" screenshots for examples of the expected results when tapping each layout type button "Vertical", "Horizontal", and "Composite".
  12. Lokesh Choudhary 2017-08-17

    FR Passed for both master & 6.2.0 PR. Both PR's merged.
  13. Lokesh Choudhary 2017-08-17

    Verified the fix in SDK 6.2.0.v20170816173122. Closing. Studio Ver: 4.9.1.201707200100 SDK Ver: 6.2.0.v20170816173122 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.3 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.13 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Pixel --- Android 7.1.1 ⇨ google Nexus 5 --- Android 6.0.1

JSON Source