[TIMOB-26990] Android: Add tabMode (fixed, scrollabl) to TabGroup
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | android, tabgroup |
Reporter | Michael Gangolf |
Assignee | Eric Merriman |
Created | 2019-04-19T11:10:07.000+0000 |
Updated | 2019-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();
}
PR: https://github.com/appcelerator/titanium_mobile/pull/10856
Hello [~michael], Thanks for the PR. I will forward this to the engineering for marge. Thanks.