[TIMOB-10070] Android: Landscape Left/Right handling is backwards
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-15T00:10:54.000+0000 |
Affected Version/s | Release 2.1.1, Release 3.1.0 |
Fix Version/s | Release 7.0.0 |
Components | Android |
Labels | android, api, breaking-change, orientation, qe-and070112 |
Reporter | Neha Chhabra |
Assignee | Joshua Quick |
Created | 2012-07-23T00:06:10.000+0000 |
Updated | 2017-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
File | Date | Size |
---|---|---|
grouch.jpg | 2012-07-23T00:06:10.000+0000 | 52018 |
OrientationModeTest.js | 2017-11-06T19:00:07.000+0000 | 1077 |
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
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*
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
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.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9585
Attached [^OrientationModeTest.js] script to help test window orientation mode landscape left/right handling.
FR Passed. Waiting for merge to get enabled to merge.
PR merged.
Changes are seen in SDK 7.0.0.v20171114202841.