Commit 00e9a958 authored by Zachary Seguin's avatar Zachary Seguin

Merge branch 'rewrite'

parents a597a0cd 2ccc524d
{
"uuid": "b6206a52-7eef-40a2-a225-e5797785b2b2",
"uuid": "e0d05eee-c0e5-4131-895b-5ef6cb8211b6",
"shortName": "Zachary Seguin",
"longName": "Zachary Seguin - Watchface",
"companyName": "Zachary Seguin",
"versionCode": 2,
"versionLabel": "2.0.0",
"versionCode": 3,
"versionLabel": "3.0.0",
"watchapp": {
"watchface": true
},
"appKeys": {
"weather_icon": 0,
"weather_conditions": 1,
"temperature": 2,
"information": 3
"icon": 0,
"temperature": 1,
"conditions": 2,
"message": 3
},
"capabilities" : [ "location" ],
"resources": {
......@@ -24,7 +24,7 @@
},
{
"type" : "font",
"name" : "WEATHER_22",
"name" : "WEATHER_ICONS_22",
"file" : "fonts/weathericons-regular-webfont.ttf"
}
]
......
all:
all:
pebble build
build:
pebble build
install:
pebble install --phone 10.0.1.6 --logs
pebble install --phone 10.0.1.4 --logs
#pebble logs --phone 10.0.1.6
clean:
pebble clean
\ No newline at end of file
pebble clean
This diff is collapsed.
/*
COPYRIGHT © 2013 - Zachary Seguin
All Rights Reserved.
www.zacharyseguin.ca
contact@zacharyseguin.c
*/
#include <pebble.h>
#include "icons.h"
#define CLOCK_TIME_PLACEHOLDER "00:00"
#define CLOCK_DATE_PLACEHOLDER "Xxx., Xxx. ##, ####"
#define CLOCK_TIME_FORMAT_24HR "%R"
#define CLOCK_TIME_FORMAT_12HR "%I:%M"
#define CLOCK_DATE_FORMAT "%a., %b. %e, %Y"
static void display_clock(struct tm *tick_time, TimeUnits units_changed, TextLayer *time_layer, TextLayer *date_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Displaying time...");
// Minute changed
// NOTE: This will also handle the hour changing
if (units_changed & MINUTE_UNIT)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Minute units have changed");
// Declare variables
static char time_text[] = CLOCK_TIME_PLACEHOLDER;
char *time_format;
// Format the time
if (clock_is_24h_style())
time_format = CLOCK_TIME_FORMAT_24HR;
else
time_format = CLOCK_TIME_FORMAT_12HR;
strftime(time_text, sizeof(time_text), time_format, tick_time);
// Shift everything over if there is a 0 as the leading digit
if (!clock_is_24h_style() && (time_text[0] == '0'))
memmove(time_text, &time_text[1], sizeof(time_text) - 1);
text_layer_set_text(time_layer, time_text);
}// End of if
// Date changed
// NOTE: This will also handle the hour changing
if (units_changed & DAY_UNIT)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Date units have changed");
// Declare variables
static char date_text[] = CLOCK_DATE_PLACEHOLDER;
strftime(date_text, sizeof(date_text), CLOCK_DATE_FORMAT, tick_time);
text_layer_set_text(date_layer, date_text);
}// End of if
APP_LOG(APP_LOG_LEVEL_DEBUG, "Done displaying time");
}// End of display_time method
static void display_battery(BatteryChargeState battery, TextLayer *battery_icon_layer, TextLayer *battery_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating battery state...");
static char battery_icon_string[] = ICON_SWITCH;
if (battery.is_charging)
snprintf(battery_icon_string, sizeof(battery_icon_string), ICON_LIGHTNING);
else if (battery.is_plugged)
snprintf(battery_icon_string, sizeof(battery_icon_string), ICON_POWER_CORD);
else
snprintf(battery_icon_string, sizeof(battery_icon_string), ICON_SWITCH);
static char battery_string[4];
snprintf(battery_string, sizeof(battery_string), "%d%%", battery.charge_percent);
text_layer_set_text(battery_icon_layer, battery_icon_string);
text_layer_set_text(battery_layer, battery_string);
}// End of display_battery method
static void display_bluetooth(bool connected, TextLayer *bluetooth_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating bluetooth connection state...");
static char bluetooth_string[] = ICON_PHONE_HANG_UP;
snprintf(bluetooth_string, sizeof(bluetooth_string), (connected) ? ICON_PHONE : ICON_PHONE_HANG_UP);
text_layer_set_text(bluetooth_layer, bluetooth_string);
}// End of display_bluetooth method
static void display_weather(const char *icon, const char *conditions, const int temperature, TextLayer *weather_icon_layer, TextLayer *weather_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating weather...");
static char weather_icon[] = DEFAULT_WEATHER_ICON;
snprintf(weather_icon, sizeof(weather_icon), icon);
text_layer_set_text(weather_icon_layer, weather_icon);
static char weather_string[40];
int result = strncmp(icon, DEFAULT_WEATHER_ICON, sizeof(icon));
if (result == 0)
snprintf(weather_string, sizeof(weather_string), "%s", conditions);
else
snprintf(weather_string, sizeof(weather_string), "%d\u00B0\n%s", temperature, conditions);
text_layer_set_text(weather_layer, weather_string);
}// End of display_weather method
static void display_information(char *information, TextLayer *information_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating information...");
static char information_string[40];
snprintf(information_string, sizeof(information_string), information);
text_layer_set_text(information_layer, information_string);
}// End of display_information method
\ No newline at end of file
......@@ -3,7 +3,10 @@
All Rights Reserved.
www.zacharyseguin.ca
contact@zacharyseguin.c
contact@zacharyseguin.ca
*/
#include "display.h"
#include "icons.h"
#define BACKGROUND_COLOUR GColorBlack
#define FOREGROUND_COLOUR GColorWhite
\ No newline at end of file
/*
COPYRIGHT © 2013 - Zachary Seguin
All Rights Reserved.
www.zacharyseguin.ca
contact@zacharyseguin.ca
*/
// Available variables:
// bounds: The bounds of the window layer.
// Battery State
#define BATTERY_STATUS_SIZE_WIDTH 12
#define BATTERY_STATUS_SIZE_HEIGHT 25
#define BATTERY_STATUS_SIZE BATTERY_STATUS_SIZE_WIDTH, BATTERY_STATUS_SIZE_HEIGHT
#define BATTERY_STATUS_ORIGIN_X 4
#define BATTERY_STATUS_ORIGIN_Y 4
#define BATTERY_STATUS_ORIGIN BATTERY_STATUS_ORIGIN_X, BATTERY_STATUS_ORIGIN_Y
#define BATTERY_STATUS_BACKGROUND_COLOUR background_colour
#define BATTERY_STATUS_FOREGROUND_COLOUR foreground_colour
#define BATTERY_STATUS_TEXT ICON_SWITCH
#define BATTERY_STATUS_FONT icons_font
#define BATTERY_STATUS_ALIGNMENT GTextAlignmentLeft
// Battery Charge Percentage
#define BATTERY_PERCENTAGE_SIZE_WIDTH 35
#define BATTERY_PERCENTAGE_SIZE_HEIGHT 25
#define BATTERY_PERCENTAGE_SIZE BATTERY_PERCENTAGE_SIZE_WIDTH, BATTERY_PERCENTAGE_SIZE_HEIGHT
#define BATTERY_PERCENTAGE_ORIGIN_X BATTERY_STATUS_SIZE_WIDTH
#define BATTERY_PERCENTAGE_ORIGIN_Y 2
#define BATTERY_PERCENTAGE_ORIGIN BATTERY_PERCENTAGE_ORIGIN_X, BATTERY_PERCENTAGE_ORIGIN_Y
#define BATTERY_PERCENTAGE_BACKGROUND_COLOUR background_colour
#define BATTERY_PERCENTAGE_FOREGROUND_COLOUR foreground_colour
#define BATTERY_PERCENTAGE_TEXT "---%"
#define BATTERY_PERCENTAGE_FONT fonts_get_system_font(FONT_KEY_GOTHIC_14)
#define BATTERY_PERCENTAGE_ALIGNMENT GTextAlignmentLeft
// Bluetooth Status
#define BLUETOOTH_STATUS_SIZE_WIDTH 13
#define BLUETOOTH_STATUS_SIZE_HEIGHT 25
#define BLUETOOTH_STATUS_SIZE BLUETOOTH_STATUS_SIZE_WIDTH, BLUETOOTH_STATUS_SIZE_HEIGHT
#define BLUETOOTH_STATUS_ORIGIN_X bounds.size.w - BLUETOOTH_STATUS_SIZE_WIDTH
#define BLUETOOTH_STATUS_ORIGIN_Y 4
#define BLUETOOTH_STATUS_ORIGIN BLUETOOTH_STATUS_ORIGIN_X, BLUETOOTH_STATUS_ORIGIN_Y
#define BLUETOOTH_STATUS_BACKGROUND_COLOUR background_colour
#define BLUETOOTH_STATUS_FOREGROUND_COLOUR foreground_colour
#define BLUETOOTH_STATUS_TEXT ICON_PHONE_HANG_UP
#define BLUETOOTH_STATUS_FONT icons_font
#define BLUETOOTH_STATUS_ALIGNMENT GTextAlignmentRight
// Time
#define TIME_TEXT_SIZE_X bounds.size.w
#define TIME_TEXT_SIZE_Y 55
#define TIME_TEXT_SIZE TIME_TEXT_SIZE_X, TIME_TEXT_SIZE_Y
#define TIME_TEXT_ORIGIN_X 0
#define TIME_TEXT_ORIGIN_Y 25
#define TIME_TEXT_ORIGIN TIME_TEXT_ORIGIN_X, TIME_TEXT_ORIGIN_Y
#define TIME_TEXT_BACKGROUND_COLOUR foreground_colour
#define TIME_TEXT_FOREGROUND_COLOUR background_colour
#define TIME_TEXT_TEXT time_text
#define TIME_TEXT_FONT fonts_get_system_font(FONT_KEY_BITHAM_42_MEDIUM_NUMBERS)
#define TIME_TEXT_ALIGNMENT GTextAlignmentCenter
// Date
#define DATE_TEXT_SIZE_X bounds.size.w
#define DATE_TEXT_SIZE_Y 35
#define DATE_TEXT_SIZE DATE_TEXT_SIZE_X, DATE_TEXT_SIZE_Y
#define DATE_TEXT_ORIGIN_X 0
#define DATE_TEXT_ORIGIN_Y 70
#define DATE_TEXT_ORIGIN DATE_TEXT_ORIGIN_X, DATE_TEXT_ORIGIN_Y
#define DATE_TEXT_BACKGROUND_COLOUR foreground_colour
#define DATE_TEXT_FOREGROUND_COLOUR background_colour
#define DATE_TEXT_TEXT date_text
#define DATE_TEXT_FONT fonts_get_system_font(FONT_KEY_GOTHIC_24)
#define DATE_TEXT_ALIGNMENT GTextAlignmentCenter
// Weather Icon
#define WEATHER_ICON_SIZE_X 32
#define WEATHER_ICON_SIZE_Y 50
#define WEATHER_ICON_SIZE WEATHER_ICON_SIZE_X, WEATHER_ICON_SIZE_Y
#define WEATHER_ICON_ORIGIN_X 4
#define WEATHER_ICON_ORIGIN_Y 112
#define WEATHER_ICON_ORIGIN WEATHER_ICON_ORIGIN_X, WEATHER_ICON_ORIGIN_Y
#define WEATHER_ICON_BACKGROUND_COLOUR background_colour
#define WEATHER_ICON_FOREGROUND_COLOUR foreground_colour
#define WEATHER_ICON_TEXT weather_icon_text
#define WEATHER_ICON_FONT weather_icons_font
#define WEATHER_ICON_ALIGNMENT GTextAlignmentCenter
// Weather
#define WEATHER_SIZE_X bounds.size.w - WEATHER_ICON_SIZE_X - 14
#define WEATHER_SIZE_Y 50
#define WEATHER_SIZE WEATHER_SIZE_X, WEATHER_SIZE_Y
#define WEATHER_ORIGIN_X WEATHER_ICON_SIZE_X + 10
#define WEATHER_ORIGIN_Y 110
#define WEATHER_ORIGIN WEATHER_ORIGIN_X, WEATHER_ORIGIN_Y
#define WEATHER_BACKGROUND_COLOUR background_colour
#define WEATHER_FOREGROUND_COLOUR foreground_colour
#define WEATHER_TEXT weather_text
#define WEATHER_FONT fonts_get_system_font(FONT_KEY_GOTHIC_14)
#define WEATHER_ALIGNMENT GTextAlignmentLeft
// Message
#define MESSAGE_SIZE_X bounds.size.w
#define MESSAGE_SIZE_Y 22
#define MESSAGE_SIZE MESSAGE_SIZE_X, MESSAGE_SIZE_Y
#define MESSAGE_ORIGIN_X 4
#define MESSAGE_ORIGIN_Y 145
#define MESSAGE_ORIGIN MESSAGE_ORIGIN_X, MESSAGE_ORIGIN_Y
#define MESSAGE_BACKGROUND_COLOUR background_colour
#define MESSAGE_FOREGROUND_COLOUR foreground_colour
#define MESSAGE_TEXT message_text
#define MESSAGE_FONT fonts_get_system_font(FONT_KEY_GOTHIC_14)
#define MESSAGE_ALIGNMENT GTextAlignmentLeft
\ No newline at end of file
......@@ -6,6 +6,7 @@
contact@zacharyseguin.ca
*/
/* ICONMOON */
#define ICON_DROPLET "\ue600"
#define ICON_PHONE "\ue601"
#define ICON_PHONE_HANG_UP "\ue602"
......@@ -24,4 +25,76 @@
#define ICON_HALF_BRIGHTNESS "\ue60f"
#define ICON_TWO_DOTS "\ue610"
#define DEFAULT_WEATHER_ICON "\uf055"
\ No newline at end of file
/* WEATHER ICONS */
// http://erikflowers.github.io/weather-icons/cheatsheet/
#define WEATHER_ICON_DAY_CLOUDY_GUSTS "\uf000"
#define WEATHER_ICON_DAY_CLOUDY_WINDOW "\uf001"
#define WEATHER_ICON_DAY_CLOUDY "\uf002"
#define WEATHER_ICON_DAY_FOG "\uf003"
#define WEATHER_ICON_DAY_HAIL "\uf004"
#define WEATHER_ICON_DAY_LIGHTNING "\uf005"
#define WEATHER_ICON_DAY_RAIN_MIX "\uf006"
#define WEATHER_ICON_DAY_RAIN_WIND "\uf007"
#define WEATHER_ICON_DAY_RAIN "\uf008"
#define WEATHER_ICON_DAY_SHOWERS "\uf009"
#define WEATHER_ICON_DAY_SPRINKLE "\uf00b"
#define WEATHER_ICON_DAY_SNOW "\uf00a"
#define WEATHER_ICON_DAY_SUNNY_OVERCAST "\uf00c"
#define WEATHER_ICON_DAY_SUNNY "\uf00d"
#define WEATHER_ICON_DAY_STORM_SHOWERS "\uf00e"
#define WEATHER_ICON_DAY_THUNDERSTORM "\uf010"
#define WEATHER_ICON_CLOUDY_GUSTS "\uf011"
#define WEATHER_ICON_CLOUDY_WINDY "\uf012"
#define WEATHER_ICON_CLOUDY "\uf013"
#define WEATHER_ICON_FOG "\uf014"
#define WEATHER_ICON_HAIL "\uf015"
#define WEATHER_ICON_LIGHTNING "\uf016"
#define WEATHER_ICON_RAIN_MIX "\uf017"
#define WEATHER_ICON_RAIN_WIND "\uf018"
#define WEATHER_ICON_RAIN "\uf019"
#define WEATHER_ICON_SHOWERS "\uf01a"
#define WEATHER_ICON_SPRINKLE "\uf01c"
#define WEATHER_ICON_SNOW "\uf01b"
#define WEATHER_ICON_STORM_SHOWERS "\uf01d"
#define WEATHER_ICON_THUNDERSTORM "\uf01e"
#define WEATHER_ICON_NIGHT_CLOUDY_GUSTS "\uf022"
#define WEATHER_ICON_NIGHT_CLOUDY_WIND "\uf023"
#define WEATHER_ICON_NIGHT_FOG "\uf04a"
#define WEATHER_ICON_NIGHT_HAIL "\uf024"
#define WEATHER_ICON_NIGHT_LIGHTNING "\uf025"
#define WEATHER_ICON_NIGHT_RAIN_MIX "\uf026"
#define WEATHER_ICON_NIGHT_RAIN_WIND "\uf027"
#define WEATHER_ICON_NIGHT_RAIN "\uf028"
#define WEATHER_ICON_NIGHT_SHOWERS "\uf029"
#define WEATHER_ICON_NIGHT_SPRINKLE "\uf02b"
#define WEATHER_ICON_NIGHT_SNOW "\uf02a"
#define WEATHER_ICON_NIGHT_STORM_SHOWERS "\uf02c"
#define WEATHER_ICON_NIGHT_THUNDERSTORM "\uf02d"
#define WEATHER_ICON_NIGHT_CLEAR "\uf02e"
#define WEATHER_ICON_THERMOMETER "\uf055"
#define DEFAULT_WEATHER_ICON WEATHER_ICON_THERMOMETER
\ No newline at end of file
......@@ -15,59 +15,7 @@ function getPosition(success_callback, error_callback) {
});
}// End of getPosition function
// Loads weather for a given set of coordinates
function loadWeather(coordinates, success_callback, error_callback) {
var http = new XMLHttpRequest();
console.log("Weather URL: http://api.worldweatheronline.com/free/v1/weather.ashx?q=" + coordinates.latitude + "," + coordinates.longitude + "&format=json&num_of_days=0&key=p42vw9n4zrzcymdqzxsswxyu");
http.open('GET', "http://api.worldweatheronline.com/free/v1/weather.ashx?q=" + coordinates.latitude + "," + coordinates.longitude + "&format=json&num_of_days=0&key=p42vw9n4zrzcymdqzxsswxyu", true);
http.onload = function(event) {
if (http.readyState == 4 && http.status == 200) {
var response = JSON.parse(http.responseText);
success_callback(response);
} else if (http.readyState == 4) {
error_callback({ http_error_code: http.status });
}
};// End of onload function
http.onerror = function(error) {
error_callback(error);
}; // End of onerror method
http.ontimeout = function(error) {
error_callback(error);
}// End of ontimeout method
http.send(null);
}// End of loadWeather function
// Loads information
function loadInformation(success_callback, error_callback) {
var http = new XMLHttpRequest();
console.log("Information URL: " + "https://zacharyseguin.ca/pebble/information-message/");
http.open('GET', "https://zacharyseguin.ca/pebble/information-message/", true);
http.onload = function(event) {
if (http.readyState == 4 && http.status == 200) {
var response = JSON.parse(http.responseText);
success_callback(response);
} else if (http.readyState == 4) {
error_callback({ http_error_code: http.status });
}
};// End of onload function
http.onerror = function(error) {
error_callback(error);
}; // End of onerror method
http.ontimeout = function(error) {
error_callback(error);
}// End of ontimeout method
http.send(null);
}// End of loadInformation function
function selectWeatherIcon(code) {
function selectWeatherIcon(code) {
switch(code) {
case 113: // Sunny
return '\uf00d';
......@@ -79,6 +27,7 @@ function selectWeatherIcon(code) {
case 119: // Cloudy
return '\uf013';
break;
case 122: // Overcast
return '\uf00c';
......@@ -97,7 +46,8 @@ function selectWeatherIcon(code) {
case 266: // Light drizzle
case 281: // Freezing drizzle
case 284: // Heavy freezing drizzle
return '\uf00b'
return '\uf00b';
break;
case 293: // Patch light rain
case 296: // Light rain
......@@ -150,97 +100,57 @@ function selectWeatherIcon(code) {
case 377: // Moderate or heavy showers of ice pellets
return '\uf004';
break;
default:
return '\uf055';
}
}// End of switch
}// End of selectWeatherIcon method
function errorCallback(error) {
var data = {};
data.icon = '\uf055';
data.temperature = 0;
data.conditions = "Weather Unavailable";
data.message = "";
sendData(data)
}// End of errorCallback method
function sendUpdate() {
getPosition(function(position) {
console.log("Position Received");
loadWeather(position.coords, function(weather) {
console.log("Weather Received");
loadInformation(function(information) {
console.log("Information Received");
var icon = selectWeatherIcon(parseInt(weather['data']['current_condition'][0]['weatherCode']));
console.log(icon);
var data = {
weather_icon : icon,
weather_conditions : weather['data']['current_condition'][0]['weatherDesc'][0]['value'],
temperature: parseInt(weather['data']['current_condition'][0]['temp_C']),
information : information.information
};
sendData(data);
}, function(error) {
console.log("Failed to load information...");
var http = new XMLHttpRequest();
http.open('POST', "https://zacharyseguin.ca/pebble/watchface-data/", true);
http.onload = function(event) {
if (http.readyState == 4 && http.status == 200) {
var response = JSON.parse(http.responseText);
var data = {};
var icon = selectWeatherIcon(parseInt(weather['data']['current_condition'][0]['weatherCode']));
console.log(icon);
var data = {
weather_icon : icon,
weather_conditions : weather['data']['current_condition'][0]['weatherDesc'][0]['value'],
temperature: parseInt(weather['data']['current_condition'][0]['temp_C']),
information : ''
};
data.icon = selectWeatherIcon(response.icon);
data.temperature = response.temperature;
data.conditions = response.conditions;
data.message = response.message;
sendData(data);
});
}, function(error) {
console.log("Failed to load weather... Loading information...");
loadInformation(function(information) {
console.log('Got information.');
var data = {
weather_icon : '\uf055',
weather_conditions : 'Location Unavailable',
temperature : 0,
information : information.information
}
sendData(data);
}, function(error) {
console.log('Failed to laod information...');
var data = {
weather_icon : '\uf055',
weather_conditions : 'Weather Unavailable',
temperature : 0,
information : ''
}
sendData(data);
});
});
}, function(error) {
console.log('Failed to get position... Loading information...') ;
loadInformation(function(information) {
console.log('Got information.');
var data = {
weather_icon : '\uf055',
weather_conditions : 'Location Unavailable',
temperature : 0,
information : information.information
}
sendData(data);
}, function(error) {
console.log('Failed to laod information...');
var data = {
weather_icon : '\uf055',
weather_conditions : 'Location Unavailable',
temperature : 0,
information : ''
} else if (http.readyState == 4) {
errorCallback({ http_error_code: http.status });
}
sendData(data);
});
});
}
};// End of onload function
http.onerror = function(error) {
errorCallback(error);
}; // End of onerror method
http.ontimeout = function(error) {
errorCallback(error);
}// End of ontimeout method
http.send(position.coords.latitude + "," + position.coords.longitude);
}, errorCallback);
}// End of sendUpdate method
function sendData(data) {
console.log("Sending data to Pebble...");
......@@ -262,22 +172,22 @@ Pebble.addEventListener("appmessage", function(e) {
sendUpdate();
});
Pebble.addEventListener("ready", function(e) {
console.log("JavaScript application ready.");
Pebble.addEventListener('ready', function(event) {
console.log("JavaScript application ready");
//window.localStorage.removeItem('data');
if (window.localStorage["lastUpdate"]) {
var last = new Date(window.localStorage['lastUpdate']);
var now = new Date();
//window.localStorage.removeItem('data');
if (window.localStorage["lastUpdate"]) {
var last = new Date(window.localStorage['lastUpdate']);
var now = new Date();
var difference = Math.round((now - last) / 10000 / 60);
var difference = Math.round((now - last) / 10000 / 60);
if (difference >= 10)
sendUpdate();
else if (window.localStorage["data"])
sendData(JSON.parse(window.localStorage["data"]));
else
sendUpdate();
} else
sendUpdate();
if (difference >= 10)
sendUpdate();
else if (window.localStorage["data"])
sendData(JSON.parse(window.localStorage["data"]));
else
sendUpdate();
} else
sendUpdate();
});
\ No newline at end of file
/*
COPYRIGHT © 2013 - Zachary Seguin
All Rights Reserved.
www.zacharyseguin.ca
contact@zacharyseguin.c
*/
#include "utilities.h"
TextLayer* zs_create_text_layer(const GRect rect, const char *text, const GFont font, const GTextAlignment textAlignment, const GColor backgroundColour, const GColor foregroundColour, Layer *add_to_layer)
{
TextLayer *text_layer = text_layer_create(rect);
// Configure the text layer
text_layer_set_font(text_layer, font);
text_layer_set_text_alignment(text_layer, textAlignment);
text_layer_set_background_color(text_layer, backgroundColour);
text_layer_set_text_color(text_layer, foregroundColour);
text_layer_set_text(text_layer, text);
layer_add_child(add_to_layer, text_layer_get_layer(text_layer));
return text_layer;
}// End of zs_create_text_layer method
\ No newline at end of file
/*
COPYRIGHT © 2013 - Zachary Seguin
All Rights Reserved.
www.zacharyseguin.ca
contact@zacharyseguin.c
*/
#include <pebble.h>