Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26698] Android: Launching TabGroup in landscape and then rotating to portrait won't resize tabs as of 8.0.0

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2019-03-26T13:29:14.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.1
ComponentsAndroid
LabelsTabGroup, android, engSchedule, landscape, portrait, regression, tabs
ReporterJoshua Quick
AssigneeYordan Banev
Created2019-01-07T23:36:39.000+0000
Updated2019-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

FileDateSize
TabGroup-landscape-good.png2019-01-07T23:30:45.000+000048403
TabGroup-portrait-bad.png2019-01-07T23:30:45.000+000045201
TabGroup-portrait-good.png2019-01-07T23:30:45.000+000044155

Comments

  1. Yordan Banev 2019-02-08

    PR: https://github.com/appcelerator/titanium_mobile/pull/10687
  2. Satyam Sekhri 2019-02-27

    FR Passed. Waiting on Jenkins build.
  3. Christopher Williams 2019-03-25

    Merged to master, cherry-picked to 8_0_X
  4. Samir Mohammed 2019-03-26

    *Closing ticket.* Fix verified in SDK version 8.0.1.v20190325125116 and SDK Version 8.1.0.v20190325115012 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10687

JSON Source