Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10070] Android: Landscape Left/Right handling is backwards

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-11-15T00:10:54.000+0000
Affected Version/sRelease 2.1.1, Release 3.1.0
Fix Version/sRelease 7.0.0
ComponentsAndroid
Labelsandroid, api, breaking-change, orientation, qe-and070112
ReporterNeha Chhabra
AssigneeJoshua Quick
Created2012-07-23T00:06:10.000+0000
Updated2017-11-15T06:22:26.000+0000

Description

On Android platform, setting up the orientation as landscape left/landscape right only doesn't show the correct behaviour. This is not a regression.This issue occurs as far back as 2.0.2 Steps to reproduce: 1. Install the app.js and launch it in portrait mode. 2) Hold device so top is pointing left Actual result: After Step 1) Image appears in landscape left mode After Step 2) Image appears in landscape left mode Expected Result: After Step 1) Image appears in landscape right mode After Step 2) Image appears in landscape right mode app.js
var win = Ti.UI.createWindow({
	backgroundColor:'white'
});

var img = Ti.UI.createImageView({image:'grouch.jpg'});

win.add(img);

win.orientationModes = [
    Ti.UI.LANDSCAPE_RIGHT
];

win.open();

Attachments

FileDateSize
grouch.jpg2012-07-23T00:06:10.000+000052018
OrientationModeTest.js2017-11-06T19:00:07.000+00001077

Comments

  1. jithinpv 2013-02-26

    Issue reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 iOS iPhone Simulator: iOS SDK version: 6.0
  2. Olga Romero 2013-02-27

    Issue does exist. Tested with: Titanium Studio, build: 3.0.2.201302191606 Titanium SDK, build: 3.0.2.GA Devices: Android 2.2 Emulator Nexus 7 Android version 4.2 GalaxyS3 Android version 4.0.4 NOte: *iOS works properly*
  3. Paras Mishra 2014-04-02

    Issue is reproducible. Environment used: Device : Google Nexus 5, Android Version: 4.4.2 SDK: 3.2.3.v20140401134117 CLI version : 3.2.3-alpha2 OS : MAC OSX 10.9.2 Alloy: 1.3.1 ACS: 1.0.14 npm:1.3.2 Appcelerator Studio, build: 3.2.3.201403271839 titanium-code-processor: 1.1.1-alpha XCode : 5.1
  4. Joshua Quick 2017-10-31

    To be clear, the issue here is that Android's LANDSCAPE_LEFT and LANDSCAPE_RIGHT handling does not match the documentation. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI-property-LANDSCAPE_LEFT http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI-property-LANDSCAPE_RIGHT For a phone, LANDSCAPE_LEFT is when the bottom of the device is on the left side and LANDSCAPE_RIGHT is when the bottom of the device is on the right side. This is how it works on an iOS device. Android does the opposite of this and this is what needs to be corrected. *Side Note:* For large Android tablets whose upright orientation is landscape, the notion of landscape left/right is meaningless (there is no iOS equivalent for this case). Currently, the upright orientation is LANDSCAPE_LEFT. However, I think it should be LANDSCAPE_RIGHT instead since that is the most commonly used landscape position.
  5. Joshua Quick 2017-11-04

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9585
  6. Joshua Quick 2017-11-06

    Attached [^OrientationModeTest.js] script to help test window orientation mode landscape left/right handling.
  7. Lokesh Choudhary 2017-11-07

    FR Passed. Waiting for merge to get enabled to merge.
  8. Abir Mukherjee 2017-11-15

    PR merged.
  9. Abir Mukherjee 2017-11-15

    Changes are seen in SDK 7.0.0.v20171114202841.

JSON Source