titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

Android: calculate TabGroup bottom navigation height properly

Open cb1kenobi opened this issue 2 years ago • 1 comments

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

cb1kenobi avatar Aug 19 '23 14:08 cb1kenobi

@hansemannn @cb1kenobi @m1ga This PR fixes this issue.

prashantsaini1 avatar Mar 18 '25 21:03 prashantsaini1

PR https://github.com/tidev/titanium-sdk/pull/14173 was merged, so this issue can be closed.

hbugdoll avatar Nov 04 '25 20:11 hbugdoll