Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15580] Android: Add sub title property to the ActionBar

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-03-25T19:22:23.000+0000
Affected Version/sRelease 3.1.3
Fix Version/s2013 Sprint 25, 2013 Sprint 25 API, Release 3.2.3, Release 3.3.0
ComponentsAndroid
Labelsn/a
ReporterBetty Tran
AssigneeBiju pm
Created2013-10-25T12:04:13.000+0000
Updated2014-06-19T12:43:42.000+0000

Description

In native Android it is possible to add a subtitle to the ActionBar as follows:
ActionBar ab = getActionBar();
ab.setTitle("My Title");
ab.setSubtitle("sub-title");
This is not possible in Titanium, please implement the subtitle feature for Android action bars. Related Android Doc: http://developer.android.com/reference/android/app/ActionBar.html#setSubtitle(java.lang.CharSequence)

Attachments

FileDateSize
ActionBar.png2014-03-25T08:41:39.000+000045968

Comments

  1. Biju pm 2013-11-04

    Test case
        var win = Ti.UI.createWindow({
           title: "Old Title",
           navBarHidden: false
       }); 
       var actionBar;
       
       win.addEventListener("open", function() {
           if (Ti.Platform.osname === "android") {
               if (! win.activity) {
                   Ti.API.error("Can't access action bar on a lightweight window.");
               } else {
                   actionBar = win.activity.actionBar;
                   if (actionBar) {
                      
                      
                        actionBar.title = "New Title";
                        actionBar.subtitle = "New sub Title";
                       actionBar.onHomeIconItemSelected = function() {
                           Ti.API.info("Home icon clicked!");
                       };
                   }
               }
           }
       });
       
       win.open();
       
  2. Biju pm 2013-11-04

    PR: https://github.com/appcelerator/titanium_mobile/pull/4908
  3. Sabil Rahim 2014-03-24

    3_2_X Backport PR : https://github.com/appcelerator/titanium_mobile/pull/5515
  4. Neha Mittal 2014-03-25

    Verified not fix using code provided in the comments with below environment: Appc Studio: 3.2.3.201403190645 Sdk: 3.2.3.v20140324164913 acs: 1.0.14 npm: 1.3.2 alloy:1.3.1 titanium:3.2.1 titanium-code-processor:1.1.0 Xcode: 5.1 Osx: Maverick(10.9.2) Device: Nexus 7 (V 4.4.2) Not able to see subTitle “New sub Title” added to the ActionBar. However able to see title property.Got same result using Master's SDK:3.3.0 Refer to the attached screenshot "ActionBar.png" for further reference.
  5. Sabil Rahim 2014-03-25

    There was a error in the testcase (should be subtitle not subTitle). Please retest with the updated test above.
  6. Lokesh Choudhary 2014-03-26

    Verified the fix. We now see a sub title when subtitle property is used in actionbar. Closing. Environment: Appc Studio : 3.2.3.201403190645 Ti SDK : 3.2.3.v20140324114345 , 3.3.0.v20140324231714 Mac OSX : 10.8.5 Alloy : 1.3.1 CLI - sudo npm install -g git://github.com/appcelerator/titanium.git#3_2_X (3.2.3-dev) Samsung Galaxy S4 - Android 4.2.2

JSON Source