Skip to content

Commit 2b94d6a

Browse files
committed
watchapp kill self and update text
1 parent 2b2a279 commit 2b94d6a

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ proguard/
2626
.DS_Store
2727
# Pebble build files
2828
Libraries/PebbleKit/build/
29+
Pebble/resources/images/Thumbs.db
-7.87 KB
Binary file not shown.

Android/src/main/assets/Tower.pbw

8.63 KB
Binary file not shown.

Android/src/main/java/org/droidplanner/pebble/OfflineWatchappInstallUtil.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public static boolean manualWatchappInstall(Context context) {
2929
InputStream in = null;
3030
OutputStream out = null;
3131
try {
32-
in = context.getAssets().open("DroidPlanner.pbw");
32+
in = context.getAssets().open("Tower.pbw");
3333
File outFile = new File(Environment.getExternalStorageDirectory().getPath(),
34-
"DroidPlanner.pbw");
34+
"Tower.pbw");
3535
out = new FileOutputStream(outFile);
3636
byte[] buffer = new byte[1024];
3737
int read;

Pebble/src/main.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ enum {
1616
KEY_FOLLOW_TYPE = 1,
1717
KEY_TELEM = 2,
1818
KEY_APP_VERSION=3,
19+
KEY_KILL_SELF=4,
1920
KEY_PEBBLE_REQUEST = 100,
2021
KEY_REQUEST_MODE_FOLLOW = 101,
2122
KEY_REQUEST_CYCLE_FOLLOW_TYPE=102,
@@ -154,6 +155,10 @@ static void buttons_draw(Layer *layer, GContext *ctx) {
154155
request_new_app_version();
155156
return;
156157
}
158+
case KEY_KILL_SELF:
159+
if(strcmp(data,"true")!=0){
160+
deinit();
161+
}
157162
}
158163
}
159164
}
@@ -194,9 +199,9 @@ static void window_load(Window *window) {
194199
text_layer_set_font(follow_type_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
195200
layer_add_child(window_layer, text_layer_get_layer(follow_type_layer));
196201

197-
telem_layer = text_layer_create((GRect) { .origin = { 10, 60 }, .size = { bounds.size.w-60, bounds.size.h-50 } });
202+
telem_layer = text_layer_create((GRect) { .origin = { 5, 60 }, .size = { bounds.size.w-60+5, bounds.size.h-50 } });
198203
text_layer_set_overflow_mode(telem_layer, GTextOverflowModeWordWrap);
199-
text_layer_set_text(telem_layer, "Click any button to retry");
204+
text_layer_set_text(telem_layer, "Not working? Run Tower-Pebble");
200205
text_layer_set_text_alignment(telem_layer, GTextAlignmentLeft);
201206
text_layer_set_font(telem_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24));
202207
layer_add_child(window_layer, text_layer_get_layer(telem_layer));
@@ -227,13 +232,13 @@ static void init(void) {
227232
const uint32_t outbound_size = 16;
228233
app_message_open(inbound_size, outbound_size);
229234
app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
230-
send_mode_change_request(KEY_REQUEST_CONNECT);
231235
}
232236

233237
static void deinit(void) {
238+
app_comm_set_sniff_interval(SNIFF_INTERVAL_NORMAL);
234239
send_mode_change_request(KEY_REQUEST_DISCONNECT);
240+
psleep(750);
235241
window_destroy(window);
236-
app_comm_set_sniff_interval(SNIFF_INTERVAL_NORMAL);
237242
}
238243

239244
int main(void) {

0 commit comments

Comments
 (0)