mirror of
https://github.com/UberGuidoZ/Flipper.git
synced 2026-09-18 20:51:29 +00:00
Removing FAP files (use FlipC or Official store!)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#include "../pomodoro_timer.h"
|
||||
#include "pomodoro_10.h"
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <gui/elements.h>
|
||||
#include <notification/notification_messages.h>
|
||||
|
||||
static void pomodoro_10_draw_callback(Canvas* canvas, void* context) {
|
||||
int max_seconds = 60 * 10;
|
||||
int max_seconds_rest = 60 * 2;
|
||||
pomodoro_draw_callback(canvas, context, max_seconds, max_seconds_rest);
|
||||
}
|
||||
|
||||
static bool pomodoro_10_input_callback(InputEvent* event, void* context) {
|
||||
furi_assert(context);
|
||||
PomodoroTimer* pomodoro_10 = context;
|
||||
|
||||
if(event->type == InputTypeLong && event->key == InputKeyBack) {
|
||||
return false;
|
||||
} else {
|
||||
pomodoro_timer_process(pomodoro_10, event);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
PomodoroTimer* pomodoro_10_alloc() {
|
||||
PomodoroTimer* pomodoro_10 = malloc(sizeof(PomodoroTimer));
|
||||
pomodoro_10->view = view_alloc();
|
||||
view_set_context(pomodoro_10->view, pomodoro_10);
|
||||
view_allocate_model(pomodoro_10->view, ViewModelTypeLocking, sizeof(PomodoroTimerModel));
|
||||
view_set_draw_callback(pomodoro_10->view, pomodoro_10_draw_callback);
|
||||
view_set_input_callback(pomodoro_10->view, pomodoro_10_input_callback);
|
||||
|
||||
return pomodoro_10;
|
||||
}
|
||||
|
||||
void pomodoro_10_free(PomodoroTimer* pomodoro_10) {
|
||||
furi_assert(pomodoro_10);
|
||||
view_free(pomodoro_10->view);
|
||||
free(pomodoro_10);
|
||||
}
|
||||
|
||||
View* pomodoro_10_get_view(PomodoroTimer* pomodoro_10) {
|
||||
furi_assert(pomodoro_10);
|
||||
return pomodoro_10->view;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <gui/view.h>
|
||||
#include "../pomodoro_timer.h"
|
||||
|
||||
PomodoroTimer* pomodoro_10_alloc();
|
||||
|
||||
void pomodoro_10_free(PomodoroTimer* pomodoro_10);
|
||||
|
||||
View* pomodoro_10_get_view(PomodoroTimer* pomodoro_10);
|
||||
@@ -0,0 +1,46 @@
|
||||
#include "../pomodoro_timer.h"
|
||||
#include "pomodoro_25.h"
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <gui/elements.h>
|
||||
#include <notification/notification_messages.h>
|
||||
|
||||
static void pomodoro_25_draw_callback(Canvas* canvas, void* context) {
|
||||
int max_seconds = 60 * 25;
|
||||
int max_seconds_rest = 60 * 5;
|
||||
pomodoro_draw_callback(canvas, context, max_seconds, max_seconds_rest);
|
||||
}
|
||||
|
||||
static bool pomodoro_25_input_callback(InputEvent* event, void* context) {
|
||||
furi_assert(context);
|
||||
PomodoroTimer* pomodoro_25 = context;
|
||||
|
||||
if(event->type == InputTypeLong && event->key == InputKeyBack) {
|
||||
return false;
|
||||
} else {
|
||||
pomodoro_timer_process(pomodoro_25, event);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
PomodoroTimer* pomodoro_25_alloc() {
|
||||
PomodoroTimer* pomodoro_25 = malloc(sizeof(PomodoroTimer));
|
||||
pomodoro_25->view = view_alloc();
|
||||
view_set_context(pomodoro_25->view, pomodoro_25);
|
||||
view_allocate_model(pomodoro_25->view, ViewModelTypeLocking, sizeof(PomodoroTimerModel));
|
||||
view_set_draw_callback(pomodoro_25->view, pomodoro_25_draw_callback);
|
||||
view_set_input_callback(pomodoro_25->view, pomodoro_25_input_callback);
|
||||
|
||||
return pomodoro_25;
|
||||
}
|
||||
|
||||
void pomodoro_25_free(PomodoroTimer* pomodoro_25) {
|
||||
furi_assert(pomodoro_25);
|
||||
view_free(pomodoro_25->view);
|
||||
free(pomodoro_25);
|
||||
}
|
||||
|
||||
View* pomodoro_25_get_view(PomodoroTimer* pomodoro_25) {
|
||||
furi_assert(pomodoro_25);
|
||||
return pomodoro_25->view;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <gui/view.h>
|
||||
#include "../pomodoro_timer.h"
|
||||
|
||||
PomodoroTimer* pomodoro_25_alloc();
|
||||
|
||||
void pomodoro_25_free(PomodoroTimer* pomodoro_25);
|
||||
|
||||
View* pomodoro_25_get_view(PomodoroTimer* pomodoro_25);
|
||||
@@ -0,0 +1,46 @@
|
||||
#include "../pomodoro_timer.h"
|
||||
#include "pomodoro_50.h"
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <gui/elements.h>
|
||||
#include <notification/notification_messages.h>
|
||||
|
||||
static void pomodoro_50_draw_callback(Canvas* canvas, void* context) {
|
||||
int max_seconds = 60 * 50;
|
||||
int max_seconds_rest = 60 * 10;
|
||||
pomodoro_draw_callback(canvas, context, max_seconds, max_seconds_rest);
|
||||
}
|
||||
|
||||
static bool pomodoro_50_input_callback(InputEvent* event, void* context) {
|
||||
furi_assert(context);
|
||||
PomodoroTimer* pomodoro_50 = context;
|
||||
|
||||
if(event->type == InputTypeLong && event->key == InputKeyBack) {
|
||||
return false;
|
||||
} else {
|
||||
pomodoro_timer_process(pomodoro_50, event);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
PomodoroTimer* pomodoro_50_alloc() {
|
||||
PomodoroTimer* pomodoro_50 = malloc(sizeof(PomodoroTimer));
|
||||
pomodoro_50->view = view_alloc();
|
||||
view_set_context(pomodoro_50->view, pomodoro_50);
|
||||
view_allocate_model(pomodoro_50->view, ViewModelTypeLocking, sizeof(PomodoroTimerModel));
|
||||
view_set_draw_callback(pomodoro_50->view, pomodoro_50_draw_callback);
|
||||
view_set_input_callback(pomodoro_50->view, pomodoro_50_input_callback);
|
||||
|
||||
return pomodoro_50;
|
||||
}
|
||||
|
||||
void pomodoro_50_free(PomodoroTimer* pomodoro_50) {
|
||||
furi_assert(pomodoro_50);
|
||||
view_free(pomodoro_50->view);
|
||||
free(pomodoro_50);
|
||||
}
|
||||
|
||||
View* pomodoro_50_get_view(PomodoroTimer* pomodoro_50) {
|
||||
furi_assert(pomodoro_50);
|
||||
return pomodoro_50->view;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <gui/view.h>
|
||||
#include "../pomodoro_timer.h"
|
||||
|
||||
PomodoroTimer* pomodoro_50_alloc();
|
||||
|
||||
void pomodoro_50_free(PomodoroTimer* pomodoro_50);
|
||||
|
||||
View* pomodoro_50_get_view(PomodoroTimer* pomodoro_50);
|
||||
Reference in New Issue
Block a user