Details

      Description

      I found two issues with the latest ActionGroup code changes:

      1. Documentation: Ti.UI.TabGroup needs to reflect that you can get the "activity" property. I had to dig in the source to find out that TabGroupProxy extends WindowProxy under the covers to figure that out.

      2. "title" property for ActionBar does not do anything when the ActionBar is displayed with a TabGroup. Create a new project with the proper min-sdk setting, and use this code in app.js:

      var tabs = Ti.UI.createTabGroup();
      
      var win1 = Ti.UI.createWindow({
      	title:"Window 1",
      	backgroundColor:'#f00',
      });
      var tab1 = Ti.UI.createTab({
      	title:"Win 1",
      	window:win1,
      });
      
      tabs.addTab(tab1);
      
      var win2 = Ti.UI.createWindow({
      	title:"Window Dos",
      	backgroundColor:'#fff',
      });
      var tab2 = Ti.UI.createTab({
      	title:"Win 2",
      	window:win2,
      });
      
      tabs.addTab(tab2);
      
      tabs.addEventListener('focus', function(e) {
      	var actionBar = tabs.getActivity().actionBar; // "activity" is an undocumented Android property for TabGroup
      	if (actionBar) {
      		actionBar.setDisplayHomeAsUp(true); // works
      		actionBar.onHomeIconItemSelected = function() { // works
      			alert('actionBar hides for 5 seconds');
      			actionBar.hide(); // works
      			setTimeout(function(){
      				actionBar.show(); // works
      			},5000);
      		}
      //		actionBar.setTitle(e.tab.window.title); // title never appears
      		actionBar.setTitle('TEST'); // hard-coded text just to be sure
      	}
      });
      
      tabs.open();
      

        Issue Links

          Activity

          Hide
          Igor Santos added a comment -

          I have two questions from a newbie about this:

          1. Should I be able to get the activity using myTabGroup.activity? I can only access it through myTabGroup.getActivity()
          2. Would it be reasonable to ask for a title property for the TabGroup? It makes little sense for me to change the title of the TabGroup through the activity, while normal windows don't need it.

          Show
          Igor Santos added a comment - I have two questions from a newbie about this: 1. Should I be able to get the activity using myTabGroup.activity ? I can only access it through myTabGroup.getActivity() 2. Would it be reasonable to ask for a title property for the TabGroup? It makes little sense for me to change the title of the TabGroup through the activity, while normal windows don't need it.
          Hide
          Arthur Evans added a comment -

          Hi Igor,

          Unfortunately, the fix to expose TabGroup.activity has not been merged yet, so I think it's missed the cut for 3.0 GA but it should be in 3.0.1. So use getActivity for now.

          Be sure to watch the related ticket, TIMOB-11796, if you want to be updated when the fix gets in.

          Show
          Arthur Evans added a comment - Hi Igor, Unfortunately, the fix to expose TabGroup.activity has not been merged yet, so I think it's missed the cut for 3.0 GA but it should be in 3.0.1. So use getActivity for now. Be sure to watch the related ticket, TIMOB-11796 , if you want to be updated when the fix gets in.
          Hide
          Igor Santos added a comment -

          I'm watching it already, thanks!

          And how about the title issue?

          Would it be reasonable to ask for a title property for the TabGroup? It makes little sense for me to change the title of the TabGroup through the activity, while normal windows don't need it.

          Show
          Igor Santos added a comment - I'm watching it already, thanks! And how about the title issue? Would it be reasonable to ask for a title property for the TabGroup? It makes little sense for me to change the title of the TabGroup through the activity, while normal windows don't need it.
          Hide
          Arthur Evans added a comment -

          Hi Igor,

          Please open a feature request for the title property. I think there are two competing schools of though here (at least):

          1) We should expose a title on the tab group.
          2) The action bar title should take the title of the current tab's window.

          I've spent some time reviewing the Android docs, and it's not clear to me which of these is preferable.

          Show
          Arthur Evans added a comment - Hi Igor, Please open a feature request for the title property. I think there are two competing schools of though here (at least): 1) We should expose a title on the tab group. 2) The action bar title should take the title of the current tab's window. I've spent some time reviewing the Android docs, and it's not clear to me which of these is preferable.
          Hide
          Igor Santos added a comment -

          Thanks for the support, Arthur. The issue TC-1621 was created.

          Show
          Igor Santos added a comment - Thanks for the support, Arthur. The issue TC-1621 was created.

            People

            • Assignee:
              Allen Yeung
              Reporter:
              Shannon Hicks
            • Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development