Files
pebble-directions/src/progress_layer.h
T
dyedgreen 11fbc2b2e0 moved loading aim to layer
* TODO: display the list in a nice way
* TODO: fetch real data
2016-06-23 15:14:26 +02:00

31 lines
1.0 KiB
C

#pragma once
#include <pebble.h>
#define PROGRESS_BAR_WIDTH 80
#define PROGRESS_BAR_HEIGHT 6
#define PROGRESS_ANIM_DELTA 33
// For B/W Pebbels: bg white, bar white, fill black
#define COLOR_PROGRESS_BG GColorLightGray
#define COLOR_PROGRESS_BAR GColorBlack
#define COLOR_PROGRESS_FILL GColorWhite
typedef struct {
Layer *layer;
AppTimer *timer;
int16_t progress;
int16_t target;
bool present;
} ProgressLayer;
// Create the progress layer
ProgressLayer *progress_layer_create(GRect frame);
// Destroy the progress layer (call in window unload)
void progress_layer_destroy(ProgressLayer *progress_layer);
// Set the progress of the progress layer
void progress_layer_set_progress(ProgressLayer *progress_layer, int16_t progress, bool animated);
// This allows the set_progress function to start timers!
void progress_layer_present(Window *window, ProgressLayer *progress_layer);
// This call should always be called in the windows disappear! (will stop the timer)
void progress_layer_remove(ProgressLayer *progress_layer);