titanium-sdk
titanium-sdk copied to clipboard
Android: calculate TabGroup bottom navigation height properly
I have searched and made sure there are no existing issues for the issue I am filing
- [X] I have searched the existing issues
Description
PR https://github.com/tidev/titanium-sdk/pull/13872 introduced the ability to toggle the visibility of the tab bar, but the height is manually set to 500. It would be nice to be able to programmatically determine the height.
Expected Behavior
Calculate the height instead of using a fixed height of 500.
Actual behavior
Uses a fixed height of 500 instead of the actual height.
Reproducible sample
const isAndroid = Ti.Platform.osname === 'android';
let tabGroup;
const window = Ti.UI.createWindow();
const btn = Ti.UI.createButton({
title: 'Show / hide tab group'
});
btn.addEventListener('click', () => {
tabGroup.tabBarVisible = !tabGroup.tabBarVisible;
});
window.add(btn);
tabGroup = Ti.UI.createTabGroup({
style: isAndroid ? Ti.UI.Android.TABS_STYLE_BOTTOM_NAVIGATION : undefined,
tabBarVisible: false, // NEW - will hide it at the beginning
tabs: [
Ti.UI.createTab({
window,
title: window.title
})
]
});
tabGroup.open();
Steps to reproduce
Build & run!
Platform
Android
SDK version you are using
12.3.0
Alloy version you are using
No response
@hansemannn @cb1kenobi @m1ga This PR fixes this issue.
PR https://github.com/tidev/titanium-sdk/pull/14173 was merged, so this issue can be closed.