Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23271

Android: ActionBar not available for TabGroup

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Duplicate
    • Affects Version/s: Release 5.2.0, Release 5.2.2
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
      None
    • Story Points:
      5
    • Sprint:
      2019 Sprint 1

      Description

      I tried to hide the action bar by following the doc here:
      http://docs.appcelerator.com/platform/latest/#%21/guide/Android_Action_Bar-section-36735509_AndroidActionBar-HidingtheActionBar

      As the doc says: To automatically hide the action bar when opening a window or tab group, you need to modify the theme to hide the action bar.

      But modifying the theme when opening a tabgroup results following error:
      [ERROR] : TabGroupProxy: (main) [315,315] ActionBar not available for TabGroup

      Reproduction:
      1. Create a classic app and replace app.js with the sample code
      2. Add custom theme and modify tiapp.xml
      3. Run the app

      Expected: No action bar should be visible
      Actual: [ERROR] : TabGroupProxy: (main) [315,315] ActionBar not available for TabGroup

      Test Case:
      app.js

      // this sets the background color of the master UIView (when there are no windows/tab groups on it)
      Titanium.UI.setBackgroundColor('#000');
       
      // create tab group
      var tabGroup = Titanium.UI.createTabGroup();
      //
      // create base UI tab and root window
      //
      var win1 = Titanium.UI.createWindow({  
          title:'Tab 1',
          backgroundColor:'#fff'
      });
      var tab1 = Titanium.UI.createTab({  
          icon:'KS_nav_views.png',
          title:'Tab 1',
          window:win1
      });
       
      var label1 = Titanium.UI.createLabel({
      	color:'#999',
      	text:'I am Window 1',
      	font:{fontSize:20,fontFamily:'Helvetica Neue'},
      	textAlign:'center',
      	width:'auto'
      });
       
      win1.add(label1);
       
      //
      // create controls tab and root window
      //
      var win2 = Titanium.UI.createWindow({  
          title:'Tab 2',
          backgroundColor:'#fff'
      });
      var tab2 = Titanium.UI.createTab({  
          icon:'KS_nav_ui.png',
          title:'Tab 2',
          window:win2
      });
       
      var label2 = Titanium.UI.createLabel({
      	color:'#999',
      	text:'I am Window 2',
      	font:{fontSize:20,fontFamily:'Helvetica Neue'},
      	textAlign:'center',
      	width:'auto'
      });
       
      win2.add(label2);
      tabGroup.addTab(tab1);  
      tabGroup.addTab(tab2);  
      // open tab group
      tabGroup.open();
      

      tiapp.xml

      <android xmlns:android="http://schemas.android.com/apk/res/android">
      <manifest>
      <application android:theme="@style/Theme.NoActionBar"/>
      </manifest>
      </android>
      

      custom_theme.xml

      <?xml version="1.0" encoding="utf-8"?>
      <resources>
      <style name="Theme.NoActionBar" parent="@style/Theme.AppCompat">
      <item name="android:windowActionBar">false</item>
      <item name="android:windowNoTitle">true</item>
      <!-- AppCompat Compatibility -->
      <item name="windowActionBar">false</item>
      <item name="windowNoTitle">true</item>
      </style>
      </resources>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ybanev Yordan Banev
                Reporter:
                jnaher Jebun Naher
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-9679
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code