Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1486] iOS, Android: Global styles is not overridden by local styles for orientationModes.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-04-12T03:57:49.000+0000
Affected Version/sRelease 5.2.0, Release 5.2.1
Fix Version/sRelease 5.4.0, alloy 1.8.5
ComponentsTitanium SDK
LabelsStyles, orientation, qe-5.4.0
ReporterMotiur Rahman
AssigneeFeon Sua Xin Miao
Created2016-04-01T19:10:17.000+0000
Updated2016-07-26T22:00:37.000+0000

Description

Description

If we set orientationModes on window in app.tss file portrait, landscape both and any individual tss file only portrait then portrait mode does not work for individual tss.

Steps to reproduce

1. Just create an alloy project. 2. Replace this app.tss and index.tss file, 3. Run this code in device or emulator. 4. Rotate device. 5. It does not stop.

actual behaviour

If device rotate, the app orientation change.

Expected behaviour

Since orientation Modes "PORTRAIT" for the index.tss file so it should be always portrait.
"Window": {
  orientationModes: [Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT],
  backgroundColor: "red"
}
"Window": {
	orientationModes: [Titanium.UI.PORTRAIT],
	backgroundColor: "blue"
}

Comments

  1. Chee Kiat Ng 2016-04-04

    Feon hasn't look into this yet but, 1. There's a workaround here right? that is to NOT set the global style, and just use individual styles for all views. 2. I don't think it's good mobile practice to have different forms of orientation in a single app. it should be consistent throughout. So this issue might be invalid, as i don't think orientationModes is supposed to be used this way. [~fmiao] right?
  2. Feon Sua Xin Miao 2016-04-11

    PR: https://github.com/appcelerator/alloy/pull/781
  3. Chee Kiat Ng 2016-04-12

    PR approved and merged.
  4. Josh Longton 2016-07-26

    Verified as fixed. Local styles now override global styles. Tested on:
       iPhone 6s (9.3.1) 
       iOS simulator (9.3)
       
Mac OSX El Capitan 10.11.6
       Studio: 4.7.0.201607130543
       
Ti SDK: 5.4.0.v20160725003348
       
Xcode: 7.3.1 
       
Appc NPM: 4.2.7
       Appc CLI: 5.4.0-35
       Alloy: 1.9.1
       Node: v4.4.4
       
    *Closing ticket*

JSON Source