Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from appcelerator/ALOY-612
[ALOY-612] Make styles available at runtime
- Loading branch information
Showing
10 changed files
with
153 additions
and
13 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$.index.open(); | ||
|
||
var style = require('alloy/styles/index'); | ||
var i, len; | ||
for (i = 0, len = $.index.children.length; i < len; i++) { | ||
var child = $.index.children[i]; | ||
child.addEventListener('click', function(e) { | ||
var id = e.source.id; | ||
_.each(style, function(o) { | ||
if (o.key === id && o.isId) { | ||
// print each style that applies by ID to the source | ||
Ti.API.info(JSON.stringify(o)); | ||
} | ||
}); | ||
}); | ||
} |
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,14 @@ | ||
"Window": { | ||
backgroundColor: '#fff', | ||
fullscreen: false | ||
} | ||
|
||
"Label": { | ||
color: '#000', | ||
height: Ti.UI.SIZE, | ||
width: Ti.UI.SIZE | ||
} | ||
|
||
"Button": { | ||
color: '#500' | ||
} |
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,41 @@ | ||
"Button": { | ||
top: '15dp' | ||
} | ||
|
||
"#index": { | ||
layout: 'vertical' | ||
} | ||
|
||
"#index[platform=android]": { | ||
exitOnClose: true | ||
} | ||
|
||
"#info": { | ||
top: '15dp', | ||
textAlign: 'center', | ||
width: '250dp', | ||
font: { | ||
fontSize: '18dp', | ||
fontWeight: 'normal' | ||
} | ||
} | ||
|
||
"#button1": { | ||
height: '70dp', | ||
width: '250dp', | ||
borderRadius: 8, | ||
borderWidth: 2, | ||
borderColor: '#500' | ||
} | ||
|
||
"#button2": { | ||
width: '100dp' | ||
} | ||
|
||
"#button3": { | ||
height: '40dp', | ||
width: '200dp', | ||
borderRadius: 32, | ||
borderWidth: 1, | ||
borderColor: '#0f0' | ||
} |
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,8 @@ | ||
<Alloy> | ||
<Window> | ||
<Label id="info">Click anything to see its ID style entry</Label> | ||
<Button id="button1">button1</Button> | ||
<Button id="button2">button2</Button> | ||
<Button id="button3">button3</Button> | ||
</Window> | ||
</Alloy> |
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