Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): add tabMode to TabGroup #13877

Merged
merged 2 commits into from
Jul 18, 2023
Merged

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jun 28, 2023

my old PR from 2019, just removed the history so merging will be easier.
More infos in #10856

var win = Ti.UI.createWindow();
var btn1 = Ti.UI.createButton({
	title: "fixed",
	top: 5
});
var btn2 = Ti.UI.createButton({
	title: "scrollable",
	top: 60
});
var btn3 = Ti.UI.createButton({
	title: "default",
	top: 120
});
win.add([btn1, btn2, btn3]);
btn1.addEventListener("click", function() {
	openTabGroup(Ti.UI.Android.TAB_MODE_FIXED);
})
btn2.addEventListener("click", function() {
	openTabGroup(Ti.UI.Android.TAB_MODE_SCROLLABLE);
})
btn3.addEventListener("click", function() {
	openTabGroup();
})
win.open();

function openTabGroup(tabModeValue) {

	var tabs = [];

	for (var i = 0; i < 10; ++i) {
		var w = Ti.UI.createWindow({});
		var t = Ti.UI.createTab({
			window: w,
			title: 'win'
		});
		tabs.push(t);
	}

	if (tabModeValue) {
		tabGroup = Ti.UI.createTabGroup({
			tabs: tabs,
			tabMode: tabModeValue
		});
	} else {
		tabGroup = Ti.UI.createTabGroup({
			tabs: tabs
		});
	}
	tabGroup.open();
}
screencapture-2022-03-27_16.53.40.mp4

@m1ga
Copy link
Contributor Author

m1ga commented Jul 18, 2023

latest test with 12.2.0:

simplescreenrecorder-2023-07-18_10.01.29.mp4

Kitchensink and my app still look fine, so nothing changes in existing apps

@hansemannn hansemannn merged commit 322b78d into master Jul 18, 2023
7 checks passed
@m1ga m1ga deleted the 230628_android_tabmode branch September 23, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants