Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19695] Android: TabGroup cannot use "NoTitleBar" themes

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-01-11T01:31:34.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.0.0
ComponentsAndroid
LabelsActionBar, TabGroup, android, tabs, theme, titlebar
ReporterFokke Zandbergen
AssigneeYordan Banev
Created2015-10-09T09:22:42.000+0000
Updated2019-01-11T01:31:41.000+0000

Description

When you use a NoTitleBar theme for the application, it is impossible to use a TabGroup anywhere in the application, because it requires an ActionBar: 1. Create default classic project (which has a TabGroup) 2. In tiapp.xml select a NoTitleBar theme:
	<android xmlns:android="http://schemas.android.com/apk/res/android">
		<manifest>
			<application theme="@style/Theme.AppCompat.NoTitleBar" />
		</manifest>
	</android>
3. Run the project and see that the screen is empty (as in screenshot) and logs show:
[ERROR] TabGroupProxy: (main) [362,362] ActionBar not available for TabGroup

Solution

We should support the theme property we have for [Ti.UI.Window](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Window-property-theme) so you can select a theme that *has* a TitleBar when you create a TabGroup in an application that uses a NoTitleBar theme.

Workaround

On all other windows, use the theme property to select a NoTitleBar theme.

Attachments

FileDateSize
android_20151009-111248.png2015-10-09T09:22:36.000+000026617
android_20151009-111406.png2015-10-09T09:22:37.000+000046600

Comments

  1. Muhammad Afzal 2015-10-12

    $.tabGroup.addEventListener('focus', function(e) { var actionBar = $.tabGroup.getActivity().actionBar; if (actionBar) { actionBar.setDisplayShowTitleEnabled(false);// works } });
  2. Fokke Zandbergen 2015-10-12

    [~m.afzal.786.220] that's to hide the action bar, the ticket is about setting a specific theme, like you can do when you create a window.
  3. saamy 2015-10-15

    I have same issue. If we are developing new Application then we can consider this solution/workaround.But when we are upgrading (Ti SDK) our existing app then we need to do these changes in many file, This is increasing both developing and testing effort. Hope this issue will be resolved soon.
  4. Joshua Quick 2019-01-11

    TabGroup was refactored in Titanium 8.0.0 so that tabs are no longer implemented via the ActionBar. This means that the ActionBar can now be removed via a theme (such as "Theme.AppCompat.NoTitleBar") without issue. See ticket [TIMOB-26354] for more details.

JSON Source