Details

      Description

      3.0 has added support for adding action items to the action bar, and displaying tabs on the action bar. However, we don't expose any direct way to interact with the action bar, the way the android.app.ActionBar class does.

      In particular, ActionBar allows you to:

      • Change the background drawable for an action bar.
      • Show and hide the action bar.
      • Set the title and subtitle of an action bar.
      • Change the app icon/app logo.
      • Display the "Up" affordance on the app icon/app logo.
      • Register for click events when the user clicks the app icon/app logo.
      • Change the display options (show or hide title, subtitle, icon/logo).

      We may need to break this out into separate subtasks, but I think we should support all of these.

      Some of these things could possibly be exposed thought existing APIs (such as navBarHidden to show/hide the action bar). However, there are enough specific things here that it probably makes sense to expose ActionBar directly.

        Issue Links

          Activity

          Hide
          Igor Santos added a comment -

          As with the Holo UI the behavior of tabs has changed, the documentation of it should be edited too. The windows opened inside a tab are not heavyweight anymore, and share the same activity.

          I'm trying to work on a workaround to have different menus for each tab, but it's kinda hacky... but my interface needs this for now.

          Show
          Igor Santos added a comment - As with the Holo UI the behavior of tabs has changed, the documentation of it should be edited too. The windows opened inside a tab are not heavyweight anymore, and share the same activity. I'm trying to work on a workaround to have different menus for each tab, but it's kinda hacky... but my interface needs this for now.
          Hide
          Igor Santos added a comment -

          The workaround is done, but it only works for menus. You can see in those three files what I did.
          Looks like the main reason for this to not work with the ActionBar buttons is onPrepareOptionsMenu not being fired when the tab changes - it does happen with normal menus.

          I gave up on tabs, I'm going to rethink my UI and remove them. But I think this difference should be noted in some place in the documentation, and maybe could be useful for you too.

          Show
          Igor Santos added a comment - The workaround is done, but it only works for menus. You can see in those three files what I did. Looks like the main reason for this to not work with the ActionBar buttons is onPrepareOptionsMenu not being fired when the tab changes - it does happen with normal menus. I gave up on tabs, I'm going to rethink my UI and remove them. But I think this difference should be noted in some place in the documentation, and maybe could be useful for you too.
          Hide
          Martin Guillon added a comment -

          Ok so first i must apologize for not knowing about target-sdk :s
          I think i lost a few working around it (at least now i know themes and titanium actvities like the back of my hand!)

          @Arthur yes i think it would be great to be able to set those properties upon window creation. On simple reason for this is that you dont have to "write code" to enable those features. If you were using titanium redux for example, you could do it in a rjss file.
          That s also why in my implementation of the "home button" event, it wasn't a event listener but just a property "home button goes back"
          why? to mimick in a way a simple implementation of the ios part.

          I will submit a PL for backgroundColor as soon as i have the time.

          Thanks

          Show
          Martin Guillon added a comment - Ok so first i must apologize for not knowing about target-sdk :s I think i lost a few working around it (at least now i know themes and titanium actvities like the back of my hand!) @Arthur yes i think it would be great to be able to set those properties upon window creation. On simple reason for this is that you dont have to "write code" to enable those features. If you were using titanium redux for example, you could do it in a rjss file. That s also why in my implementation of the "home button" event, it wasn't a event listener but just a property "home button goes back" why? to mimick in a way a simple implementation of the ios part. I will submit a PL for backgroundColor as soon as i have the time. Thanks
          Hide
          Igor Santos added a comment -

          Sorry for the flood, but I'm quite new here and I'm afraid of opening new issues for now.

          I'm working with the ActionBar buttons, and I notice two strange things:

          1. I'm using another method to simplify adding items to menu, and thus the Ti.Android.SHOW_AS_ACTION_X constants are being evaluated before getting into the menu.add() argument. This is making the property not being set. The only way to change the Action state of a menu item is using the constant directly. You can understand better how my code works seeing the helper and a sample window.

          2. I'm not able to add items directly to the Action Overflow menu (that "three dots" button); I was thinking that SHOW_AS_ACTION_NEVER would do this, but it place the items in the old menu, and SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW does nothing that I've noticed. My targetSdk is 14. Also, add many buttons with SHOW_AS_ACTION_IF_ROOM simply place the overflown items back in the old menu. Reading the Android docs I've noticed that this is, actually, the right behavior when there's a hardware menu button.

          Show
          Igor Santos added a comment - Sorry for the flood, but I'm quite new here and I'm afraid of opening new issues for now. I'm working with the ActionBar buttons, and I notice two strange things: 1. I'm using another method to simplify adding items to menu, and thus the Ti.Android.SHOW_AS_ACTION_X constants are being evaluated before getting into the menu.add() argument. This is making the property not being set. The only way to change the Action state of a menu item is using the constant directly. You can understand better how my code works seeing the helper and a sample window . 2. I'm not able to add items directly to the Action Overflow menu (that "three dots" button); I was thinking that SHOW_AS_ACTION_NEVER would do this, but it place the items in the old menu, and SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW does nothing that I've noticed. My targetSdk is 14. Also, add many buttons with SHOW_AS_ACTION_IF_ROOM simply place the overflown items back in the old menu. Reading the Android docs I've noticed that this is, actually, the right behavior when there's a hardware menu button.
          Hide
          Paras Mishra added a comment -

          Verified and closed all functionality mentioned in all sub task. Hence Closing the bug.

          Show
          Paras Mishra added a comment - Verified and closed all functionality mentioned in all sub task. Hence Closing the bug.

            People

            • Assignee:
              Allen Yeung
              Reporter:
              Arthur Evans
            • Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: