Skip to content

Commit

Permalink
v1.2 - Added colour support
Browse files Browse the repository at this point in the history
  • Loading branch information
kinncj committed Aug 25, 2015
1 parent fc83354 commit 9faba92
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion appinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"shortName": "PebbleTO",
"uuid": "23210387-3f98-41e2-a9eb-7c99ac792e96",
"versionCode": 1,
"versionLabel": "1.0",
"versionLabel": "1.2",
"watchapp": {
"watchface": false
}
Expand Down
34 changes: 26 additions & 8 deletions src/event.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var UI = require('ui');
var UI = require('ui'),
Vector2 = require('vector2');

function Event (event) {
this.name = event.name;
Expand All @@ -9,23 +10,37 @@ function Event (event) {

Event.prototype.init = function() {
var card = new UI.Card({action: {
select: 'images/icon-walk.png'
}});
select: 'images/icon-walk.png'
}}),
windowSize = new Vector2(144, 168);

card.style("small");
card.subtitle(this.name);
card.scrollable(true);
card.body(this.description);
card.on('click', function(){
var window = new UI.Window(),
image = new UI.Image();
var window = new UI.Window({
fullscreen: true,
backgroundColor: 'black',
}),
image = new UI.Image(),
text = new UI.Text({
position: new Vector2(0, 134),
size: new Vector2(windowSize.x, 20),
font: 'gothic-18-bold',
color: 'white',
});

// image.position(new Vector2((windowSize.x - 25) / 2, 90));
image.size(new Vector2(144, 168));
image.compositing('set');
image.image("http://pebbleto.kinncj.com.br/avatar/index.php/?p="+this.rsvps[this.currentRsvp].avatar);
text.text(this.rsvps[this.currentRsvp].name);
window.on('click', function(event){
if(this.currentRsvp < 0) {
this.currentRsvp = 1;
}

if(this.currentRsvp > this.rsvps.length) {
this.currentRsvp = this.rsvps.lentgh - 2;
}
Expand All @@ -35,23 +50,26 @@ Event.prototype.init = function() {

if (currentRsvp) {
this.currentRsvp = this.currentRsvp - 1;
text.text(currentRsvp.name);
image.image("http://pebbleto.kinncj.com.br/avatar/index.php/?p="+currentRsvp.avatar);
}
} else {
var currentRsvp = this.rsvps[this.currentRsvp + 1];

if (currentRsvp) {
this.currentRsvp = this.currentRsvp + 1;
text.text(currentRsvp.name);
image.image("http://pebbleto.kinncj.com.br/avatar/index.php/?p="+currentRsvp.avatar);
}
}
}.bind(this));

window.add(image);
window.show();
window.add(text);
window.show();
}.bind(this));

card.show();
};

module.exports = Event;
module.exports = Event;

0 comments on commit 9faba92

Please sign in to comment.