InfiniTime/src/displayapp/screens/Modal.h

46 lines
1.2 KiB
C
Raw Normal View History

2020-02-26 19:49:26 +00:00
#pragma once
#include "Screen.h"
2020-11-15 15:49:36 +00:00
#include <lvgl/src/lv_core/lv_style.h>
#include <lvgl/src/lv_core/lv_obj.h>
#include <components/ble/NotificationManager.h>
#include <components/ble/AlertNotificationService.h>
2020-02-26 19:49:26 +00:00
namespace Pinetime {
namespace Applications {
namespace Screens {
class Modal : public Screen{
public:
Modal(DisplayApp* app);
~Modal() override;
void NewNotification(Pinetime::Controllers::NotificationManager &notificationManager, Pinetime::Controllers::AlertNotificationService* alertService);
void Show(const char* msg, const char *btns[]);
2020-02-26 19:49:26 +00:00
void Hide();
bool Refresh() override;
bool OnButtonPushed() override;
static void mbox_event_cb(lv_obj_t *obj, lv_event_t evt);
private:
void OnEvent(lv_obj_t *event_obj, lv_event_t evt);
Pinetime::Controllers::AlertNotificationService* alertNotificationService = nullptr;
std::string positiveButton;
std::string negativeButton;
2020-02-26 19:49:26 +00:00
lv_style_t modal_style;
lv_obj_t *obj;
lv_obj_t *mbox;
lv_obj_t *info;
bool running = true;
bool isVisible = false;
2020-02-26 19:49:26 +00:00
};
}
}
}