Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26889] Android: Cannot dynamically change TabGroup "title" property as of 8.0.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-04-29T21:34:26.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.1
ComponentsAndroid
LabelsTabGroup, android, engSchedule, regression, title
ReporterAndreas Pingas
AssigneeYordan Banev
Created2019-02-25T12:34:30.000+0000
Updated2019-04-29T21:34:29.000+0000

Description

At android devices when a Window has its own title in a tabGroup the title never appears. In order for the title to appear the focus has to be lost from tabGroup and return. If that does not happen, the title appears to be the name of the app or the title of tabGroup if that is set.
var window1 = Titanium.UI.createWindow({
	title:'Tab 1'
});

var window2 = Titanium.UI.createWindow({
	title:'Tab 2'
});

var window3 = Titanium.UI.createWindow({
	title:'Tab 3'
});

var tab1 = Ti.UI.createTab({
	title:'Tab 1',
	window:window1
});

var tab2 = Ti.UI.createTab({
	title:'Tab 2',
	window:window2
});

var tab3 = Ti.UI.createTab({
	title:'Tab 3',
	window:window3
});

tab1.addEventListener('selected', function() {
	tabGroup.title = 'Tab 1';
});

tab2.addEventListener('selected', function() {
	tabGroup.title = 'Tab 2';
});

tab3.addEventListener('selected', function() {
	tabGroup.title = 'Tab 3';
});

var tabGroup = Titanium.UI.createTabGroup({
	tabs:[tab1, tab2, tab3],
	swipeable:true,
	exitOnClose:false,
	style:Titanium.UI.Android.TABS_STYLE_BOTTOM_NAVIGATION,
	shiftMode:false
});

tabGroup.open();

Comments

  1. Yordan Banev 2019-03-08

    I was able to reproduce it. It is caused by the new way the TabGroup is implemented. It now has no direct connection with the ActionBar. A workaround for this would be to manually set the title when switching tabs.
  2. Yordan Banev 2019-03-14

    PR: https://github.com/appcelerator/titanium_mobile/pull/10778 PR (8_0_X): https://github.com/appcelerator/titanium_mobile/pull/10779
  3. Samir Mohammed 2019-03-22

    FR Passed, waiting on Jenkins builds.
  4. Samir Mohammed 2019-03-26

    *Closing ticket.* Fix verified in SDK version 8.0.1.v20190325125116} and SDK Version 8.1.0.v20190325115012 Test and other information can be found at: PR: https://github.com/appcelerator/titanium_mobile/pull/10778 PR (8_0_X): https://github.com/appcelerator/titanium_mobile/pull/10779

JSON Source