Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16888] Android: Add Actionbar.setHomeButtonEnabled functionality

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-05-21T20:04:12.000+0000
Affected Version/sRelease 3.2.2
Fix Version/s2014 Sprint 10, 2014 Sprint 10 SDK, Release 3.3.0, Release 3.4.0
ComponentsAndroid
Labelsmodule_actionbar, qe-testadded
ReporterMark Mokryn
AssigneeIngo Muschenetz
Created2014-04-26T18:18:56.000+0000
Updated2014-05-23T23:21:26.000+0000

Description

The home button is automatically enabled when the DISPLAY_HOME_AS_UP is enabled (natively by Android). However, the home button cannot be disabled later unless this method is exposed - thus its necessity.

Comments

  1. Mark Mokryn 2014-04-26

    Pull request adding this functionality: https://github.com/appcelerator/titanium_mobile/pull/5649 Test app:
       var win = Ti.UI.createWindow({});
       var actionBar, homeButtonEnabled = true;;
       
       var btn = Ti.UI.createButton({
       	title: 'Toggle homeButtonEnabled',
       	width: "90%",
       	height: "50dp"
       });
       btn.addEventListener('click', function() {
       	homeButtonEnabled = !homeButtonEnabled;
       	actionBar.setHomeButtonEnabled(homeButtonEnabled);
       });
       win.add(btn);
       
       win.addEventListener("open", function() {
           if (Ti.Platform.osname === "android") {
               actionBar = win.activity.actionBar;
               if (actionBar) {
                   actionBar.title = "New Title";
                   actionBar.onHomeIconItemSelected = function() {
                       alert("Home icon clicked!");
                   };
               }
           }
       });
       
       win.open();
       
  2. Ritu Agrawal 2014-04-28

    Moving this feature request to engineering for further evaluation and prioritization. Note that TIMOB-16212 is similar but not same.
  3. Mark Mokryn 2014-05-15

    Guys, this is a very small PR and can be easily reviewed, exposes yet more ActionBar functionality, and I can assure you it is working in my app in production. Please review and accept. Thanks.
  4. Vishal Duggal 2014-05-21

    PR's merged master - https://github.com/appcelerator/titanium_mobile/pull/5716 3_3_X - https://github.com/appcelerator/titanium_mobile/pull/5717
  5. Lokesh Choudhary 2014-05-23

    Verified , the Actionbar.setHomeButtonEnabled functionality works as expected. Closing. Environment: Appc Studio : 3.3.0.201405211748 Ti SDK : 3.3.0.v20140523143057 Mac OSX : 10.8.5 Alloy : 1.4.0-alpha4 CLI - 3.3.0-alpha5 Code Processor: 1.1.1 Samsung Galaxy S4 running android 4.2.2 Sony Xperia - android 2.3.7

JSON Source