-
-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(android): add collapseToolbar support (#1360)
- Loading branch information
Showing
5 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
Alloy/commands/compile/parsers/Ti.UI.Android.CollapseToolbar.ContentView.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,11 @@ | ||
exports.parse = function(node, state) { | ||
_.extend(state, { | ||
proxyPropertyDefinition: { | ||
parents: [ | ||
'Ti.UI.Android.CollapseToolbar', | ||
'Ti.UI.iPad.Popover' | ||
] | ||
} | ||
}); | ||
return require('./Ti.UI.Android.CollapseToolbar._ProxyProperty').parse(node, state); | ||
}; |
13 changes: 13 additions & 0 deletions
13
Alloy/commands/compile/parsers/Ti.UI.Android.CollapseToolbar._ProxyProperty.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,13 @@ | ||
const _ = require('lodash'); | ||
|
||
exports.parse = function(node, state) { | ||
_.extend(state, { | ||
proxyPropertyDefinition: { | ||
parents: [ | ||
'Ti.UI.Android.CollapseToolbar', | ||
'Ti.UI.iPad.Popover' | ||
] | ||
} | ||
}); | ||
return require('./Alloy.Abstract._ProxyProperty').parse(node, state); | ||
}; |
34 changes: 34 additions & 0 deletions
34
Alloy/commands/compile/parsers/Ti.UI.Android.CollapseToolbar.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,34 @@ | ||
const _ = require('lodash'), | ||
U = require('../../../utils'), | ||
MIN_VERSION = '12.1.0'; | ||
|
||
exports.parse = function(node, state) { | ||
return require('./base').parse(node, state, parse); | ||
}; | ||
|
||
function parse(node, state, args) { | ||
const tiappSdkVersion = tiapp.getSdkVersion(); | ||
if (tiapp.version.lt(tiappSdkVersion, MIN_VERSION)) { | ||
U.die(`Ti.UI.Android.CollapseToolbar requires Titanium SDK ${MIN_VERSION}+`); | ||
} | ||
|
||
var children = U.XML.getElementsFromNodes(node.childNodes), | ||
code = '', | ||
extras = [], | ||
proxyProperties = {}; | ||
|
||
// add all proxy properties at creation time | ||
_.each(proxyProperties, function(v, k) { | ||
extras.push([k, v]); | ||
}); | ||
|
||
// if we got any extras, add them to the state | ||
if (extras.length) { | ||
state.extraStyle = styler.createVariableStyle(extras); | ||
} | ||
|
||
viewState = require('./default').parse(node, state); | ||
viewState.code = code + viewState.code; | ||
|
||
return viewState; | ||
} |
1 change: 0 additions & 1 deletion
1
Alloy/commands/compile/parsers/Ti.UI.Android.DrawerLayout._ProxyProperty.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
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