[TIMOB-26698] Android: Launching TabGroup in landscape and then rotating to portrait won't resize tabs as of 8.0.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-03-26T13:29:14.000+0000 |
Affected Version/s | Release 8.0.0 |
Fix Version/s | Release 8.0.1 |
Components | Android |
Labels | TabGroup, android, engSchedule, landscape, portrait, regression, tabs |
Reporter | Joshua Quick |
Assignee | Yordan Banev |
Created | 2019-01-07T23:36:39.000+0000 |
Updated | 2019-03-26T13:29:14.000+0000 |
Description
*Summary:*
On Android, tabs are supposed to be sized as follows depending on the orientation...
* Portrait: Stretched horizontally to fill the window.
* Landscape: Sized to just fit the tab text.
When launching a
TabGroup
in "landscape" orientation, the tabs are sized correctly. However, when rotating to "portrait" afterwards, the tabs won't resize to fill the window. They are still sized to fit the tab text which is not the native behavior.
Note that this is not an issue when launching a TabGroup
in "portrait" form. The tabs resize correctly when rotating to landscape and back to portrait. This is only an issue when launching in "landscape". This is also a regression as of Titanium 8.0.0 and was not an issue in prior Titanium versions.
*Steps to reproduce:*
Set up the project's "app.js" with the below code.
Hold the Android device landscape.
Build and run the app on the device while held landscape.
Rotate to portrait.
Notice that the top tabs do not fill the window horizontally when portrait.
function createTab(title) {
var window = Ti.UI.createWindow({ title: title });
window.add(Ti.UI.createLabel({ text: title + " View" }));
var tab = Ti.UI.createTab({
title: title,
window: window,
});
return tab;
}
var tabGroup = Ti.UI.createTabGroup({
tabs: [createTab("Tab 1"), createTab("Tab 2")],
});
tabGroup.open();
*Result:*
!TabGroup-landscape-good.png|thumbnail! !TabGroup-portrait-bad.png|thumbnail!
*Expected Result:*
!TabGroup-landscape-good.png|thumbnail! !TabGroup-portrait-good.png|thumbnail!
Attachments
File | Date | Size |
---|---|---|
TabGroup-landscape-good.png | 2019-01-07T23:30:45.000+0000 | 48403 |
TabGroup-portrait-bad.png | 2019-01-07T23:30:45.000+0000 | 45201 |
TabGroup-portrait-good.png | 2019-01-07T23:30:45.000+0000 | 44155 |
PR: https://github.com/appcelerator/titanium_mobile/pull/10687
FR Passed. Waiting on Jenkins build.
Merged to master, cherry-picked to 8_0_X
*Closing ticket.* Fix verified in SDK version
8.0.1.v20190325125116
and SDK Version8.1.0.v20190325115012
Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10687