New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ALOY-1584] Android: Ti.UI.Toolbar has no click event #853
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7ed4f82
Extract ActionBar properties as constants.
ypbnv 35a0b4b
Fix typo in constant name.
ypbnv 0d4d08b
Add simple test.
ypbnv 7235963
Define CONST.
ypbnv a6c7399
Add Jake generated code.
ypbnv 247123b
Move files to the proper location.
ypbnv File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
test/apps/testing/ALOY-1584/_generated/android/alloy/controllers/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
function __processArg(obj, key) { | ||
var arg = null; | ||
if (obj) { | ||
arg = obj[key] || null; | ||
delete obj[key]; | ||
} | ||
return arg; | ||
} | ||
|
||
function Controller() { | ||
function __alloyId0() { | ||
$.__views.index.removeEventListener("open", __alloyId0); | ||
if ($.__views.index.activity) { | ||
$.__views.index.activity.setSupportActionBar($.__views.toolBarID); | ||
$.__views.index.activity.actionBar.displayHomeAsUp = true; | ||
$.__views.index.activity.actionBar.homeButtonEnabled = true; | ||
} else { | ||
Ti.API.warn("You attempted to access an Activity on a lightweight Window or other"); | ||
Ti.API.warn("UI component which does not have an Android activity. Android Activities"); | ||
Ti.API.warn("are valid with only windows in TabGroups or heavyweight Windows."); | ||
} | ||
} | ||
require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); | ||
this.__controllerPath = "index"; | ||
this.args = arguments[0] || {}; | ||
if (arguments[0]) { | ||
__processArg(arguments[0], "__parentSymbol"); | ||
__processArg(arguments[0], "$model"); | ||
__processArg(arguments[0], "__itemTemplate"); | ||
} | ||
var $ = this; | ||
var exports = {}; | ||
$.__views.index = Ti.UI.createWindow({ | ||
title: "My Test App", | ||
backgroundColor: "gray", | ||
customToolbar: "toolBarID", | ||
theme: "Theme.AppCompat.NoTitleBar", | ||
id: "index" | ||
}); | ||
$.__views.index && $.addTopLevelView($.__views.index); | ||
$.__views.toolBarID = Ti.UI.createToolbar({ | ||
id: "toolBarID", | ||
title: "MyMenu", | ||
subtitle: "Subtitle", | ||
width: Ti.UI.FILL, | ||
top: 0, | ||
homeButtonEnabled: true, | ||
displayHomeAsUp: true, | ||
onHomeIconItemSelected: "clickAlert", | ||
barColor: "#639851" | ||
}); | ||
$.__views.index.add($.__views.toolBarID); | ||
$.__views.index.addEventListener("open", __alloyId0); | ||
exports.destroy = function() {}; | ||
_.extend($, $.__views); | ||
$.index.open(); | ||
_.extend($, exports); | ||
} | ||
|
||
var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._; | ||
|
||
module.exports = Controller; |
62 changes: 62 additions & 0 deletions
62
test/apps/testing/ALOY-1584/_generated/ios/alloy/controllers/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
function __processArg(obj, key) { | ||
var arg = null; | ||
if (obj) { | ||
arg = obj[key] || null; | ||
delete obj[key]; | ||
} | ||
return arg; | ||
} | ||
|
||
function Controller() { | ||
function __alloyId0() { | ||
$.__views.index.removeEventListener("open", __alloyId0); | ||
if ($.__views.index.activity) { | ||
$.__views.index.activity.setSupportActionBar($.__views.toolBarID); | ||
$.__views.index.activity.actionBar.displayHomeAsUp = true; | ||
$.__views.index.activity.actionBar.homeButtonEnabled = true; | ||
} else { | ||
Ti.API.warn("You attempted to access an Activity on a lightweight Window or other"); | ||
Ti.API.warn("UI component which does not have an Android activity. Android Activities"); | ||
Ti.API.warn("are valid with only windows in TabGroups or heavyweight Windows."); | ||
} | ||
} | ||
require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); | ||
this.__controllerPath = "index"; | ||
this.args = arguments[0] || {}; | ||
if (arguments[0]) { | ||
__processArg(arguments[0], "__parentSymbol"); | ||
__processArg(arguments[0], "$model"); | ||
__processArg(arguments[0], "__itemTemplate"); | ||
} | ||
var $ = this; | ||
var exports = {}; | ||
$.__views.index = Ti.UI.createWindow({ | ||
title: "My Test App", | ||
backgroundColor: "gray", | ||
customToolbar: "toolBarID", | ||
theme: "Theme.AppCompat.NoTitleBar", | ||
id: "index" | ||
}); | ||
$.__views.index && $.addTopLevelView($.__views.index); | ||
$.__views.toolBarID = Ti.UI.createToolbar({ | ||
id: "toolBarID", | ||
title: "MyMenu", | ||
subtitle: "Subtitle", | ||
width: Ti.UI.FILL, | ||
top: 0, | ||
homeButtonEnabled: true, | ||
displayHomeAsUp: true, | ||
onHomeIconItemSelected: "clickAlert", | ||
barColor: "#639851" | ||
}); | ||
$.__views.index.add($.__views.toolBarID); | ||
$.__views.index.addEventListener("open", __alloyId0); | ||
exports.destroy = function() {}; | ||
_.extend($, $.__views); | ||
$.index.open(); | ||
_.extend($, exports); | ||
} | ||
|
||
var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._; | ||
|
||
module.exports = Controller; |
62 changes: 62 additions & 0 deletions
62
test/apps/testing/ALOY-1584/_generated/mobileweb/alloy/controllers/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
function __processArg(obj, key) { | ||
var arg = null; | ||
if (obj) { | ||
arg = obj[key] || null; | ||
delete obj[key]; | ||
} | ||
return arg; | ||
} | ||
|
||
function Controller() { | ||
function __alloyId0() { | ||
$.__views.index.removeEventListener("open", __alloyId0); | ||
if ($.__views.index.activity) { | ||
$.__views.index.activity.setSupportActionBar($.__views.toolBarID); | ||
$.__views.index.activity.actionBar.displayHomeAsUp = true; | ||
$.__views.index.activity.actionBar.homeButtonEnabled = true; | ||
} else { | ||
Ti.API.warn("You attempted to access an Activity on a lightweight Window or other"); | ||
Ti.API.warn("UI component which does not have an Android activity. Android Activities"); | ||
Ti.API.warn("are valid with only windows in TabGroups or heavyweight Windows."); | ||
} | ||
} | ||
require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); | ||
this.__controllerPath = "index"; | ||
this.args = arguments[0] || {}; | ||
if (arguments[0]) { | ||
__processArg(arguments[0], "__parentSymbol"); | ||
__processArg(arguments[0], "$model"); | ||
__processArg(arguments[0], "__itemTemplate"); | ||
} | ||
var $ = this; | ||
var exports = {}; | ||
$.__views.index = Ti.UI.createWindow({ | ||
title: "My Test App", | ||
backgroundColor: "gray", | ||
customToolbar: "toolBarID", | ||
theme: "Theme.AppCompat.NoTitleBar", | ||
id: "index" | ||
}); | ||
$.__views.index && $.addTopLevelView($.__views.index); | ||
$.__views.toolBarID = Ti.UI.createToolbar({ | ||
id: "toolBarID", | ||
title: "MyMenu", | ||
subtitle: "Subtitle", | ||
width: Ti.UI.FILL, | ||
top: 0, | ||
homeButtonEnabled: true, | ||
displayHomeAsUp: true, | ||
onHomeIconItemSelected: "clickAlert", | ||
barColor: "#639851" | ||
}); | ||
$.__views.index.add($.__views.toolBarID); | ||
$.__views.index.addEventListener("open", __alloyId0); | ||
exports.destroy = function() {}; | ||
_.extend($, $.__views); | ||
$.index.open(); | ||
_.extend($, exports); | ||
} | ||
|
||
var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._; | ||
|
||
module.exports = Controller; |
62 changes: 62 additions & 0 deletions
62
test/apps/testing/ALOY-1584/_generated/windows/alloy/controllers/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
function __processArg(obj, key) { | ||
var arg = null; | ||
if (obj) { | ||
arg = obj[key] || null; | ||
delete obj[key]; | ||
} | ||
return arg; | ||
} | ||
|
||
function Controller() { | ||
function __alloyId0() { | ||
$.__views.index.removeEventListener("open", __alloyId0); | ||
if ($.__views.index.activity) { | ||
$.__views.index.activity.setSupportActionBar($.__views.toolBarID); | ||
$.__views.index.activity.actionBar.displayHomeAsUp = true; | ||
$.__views.index.activity.actionBar.homeButtonEnabled = true; | ||
} else { | ||
Ti.API.warn("You attempted to access an Activity on a lightweight Window or other"); | ||
Ti.API.warn("UI component which does not have an Android activity. Android Activities"); | ||
Ti.API.warn("are valid with only windows in TabGroups or heavyweight Windows."); | ||
} | ||
} | ||
require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); | ||
this.__controllerPath = "index"; | ||
this.args = arguments[0] || {}; | ||
if (arguments[0]) { | ||
__processArg(arguments[0], "__parentSymbol"); | ||
__processArg(arguments[0], "$model"); | ||
__processArg(arguments[0], "__itemTemplate"); | ||
} | ||
var $ = this; | ||
var exports = {}; | ||
$.__views.index = Ti.UI.createWindow({ | ||
title: "My Test App", | ||
backgroundColor: "gray", | ||
customToolbar: "toolBarID", | ||
theme: "Theme.AppCompat.NoTitleBar", | ||
id: "index" | ||
}); | ||
$.__views.index && $.addTopLevelView($.__views.index); | ||
$.__views.toolBarID = Ti.UI.createToolbar({ | ||
id: "toolBarID", | ||
title: "MyMenu", | ||
subtitle: "Subtitle", | ||
width: Ti.UI.FILL, | ||
top: 0, | ||
homeButtonEnabled: true, | ||
displayHomeAsUp: true, | ||
onHomeIconItemSelected: "clickAlert", | ||
barColor: "#639851" | ||
}); | ||
$.__views.index.add($.__views.toolBarID); | ||
$.__views.index.addEventListener("open", __alloyId0); | ||
exports.destroy = function() {}; | ||
_.extend($, $.__views); | ||
$.index.open(); | ||
_.extend($, exports); | ||
} | ||
|
||
var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._; | ||
|
||
module.exports = Controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function clickAlert() { | ||
alert('Alert!'); | ||
} | ||
|
||
$.index.open(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Alloy> | ||
<Window title="My Test App" backgroundColor="gray" customToolbar="toolBarID" theme="Theme.AppCompat.NoTitleBar"> | ||
<Toolbar | ||
id="toolBarID" | ||
title="MyMenu" | ||
subtitle="Subtitle" | ||
width="Ti.UI.FILL" | ||
top="0" | ||
homeButtonEnabled = "true" | ||
displayHomeAsUp = "true" | ||
onHomeIconItemSelected = "clickAlert" | ||
barColor="#639851" | ||
/> | ||
</Window> | ||
</Alloy> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define
CONST
.