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

fix(android): make tabBarVisible work at creation #13872

Merged
merged 5 commits into from
Aug 19, 2023

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jun 27, 2023

You can set tabBarVisible:false on creation now to hide it by default:

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();

At that time I can't get the height of the bar yet. The default height is 147dp. Moving it 500dp down should work on all devices.

@hansemannn
Copy link
Collaborator

It's a quite hacky fix (I would have preferred to calculate the height automatically), but we can work with this for now.

Copy link
Contributor

@cb1kenobi cb1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVED!

Copy link
Contributor

@cb1kenobi cb1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@cb1kenobi cb1kenobi merged commit d8b8d88 into master Aug 19, 2023
6 checks passed
@m1ga m1ga deleted the 2306237_android_tabBarVisible branch September 23, 2023 16:24
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.

3 participants