Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26990] Android: Add tabMode (fixed, scrollabl) to TabGroup

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsandroid, tabgroup
ReporterMichael Gangolf
AssigneeEric Merriman
Created2019-04-19T11:10:07.000+0000
Updated2019-04-22T22:46:49.000+0000

Description

Adding the possibility to change the tabMode of a TabGroup. Currently it will default to a fixed mode (showing all tabs but cutting of labels to do so). The PR will add a scrollable tabMode (https://developer.android.com/reference/android/support/design/widget/TabLayout#mode_scrollable)
var win = Ti.UI.createWindow({

});
var btn1 = Ti.UI.createButton({
	title: "fixed",
	top: 5
});
var btn2 = Ti.UI.createButton({
	title: "scrollable",
	top: 60
});
win.add([btn1, btn2]);
btn1.addEventListener("click", function() {
	openTabGroup(Ti.UI.Android.TAB_MODE_FIXED);
})
btn2.addEventListener("click", function() {
	openTabGroup(Ti.UI.Android.TAB_MODE_SCROLLABLE);
})
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);
	}

	tabGroup = Ti.UI.createTabGroup({
		tabs: tabs,
		tabMode: tabModeValue
	});
	tabGroup.open();
}

Comments

  1. Michael Gangolf 2019-04-19

    PR: https://github.com/appcelerator/titanium_mobile/pull/10856
  2. Sharif AbuDarda 2019-04-22

    Hello [~michael], Thanks for the PR. I will forward this to the engineering for marge. Thanks.

JSON Source