This commit is contained in:
tgc-dk 2024-10-10 19:23:54 +02:00 committed by GitHub
commit 61fb05409a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 284 additions and 31 deletions

View file

@ -402,6 +402,7 @@ list(APPEND SOURCE_FILES
displayapp/widgets/PageIndicator.cpp
displayapp/widgets/DotIndicator.cpp
displayapp/widgets/StatusIcons.cpp
displayapp/widgets/PopupMessage.cpp
## Settings
displayapp/screens/settings/QuickSettings.cpp

View file

@ -13,7 +13,14 @@ namespace Pinetime {
enum class WeatherFormat : uint8_t { Metric, Imperial };
enum class Notification : uint8_t { On, Off, Sleep };
enum class ChimesOption : uint8_t { None, Hours, HalfHours };
enum class WakeUpMode : uint8_t { SingleTap = 0, DoubleTap = 1, RaiseWrist = 2, Shake = 3, LowerWrist = 4 };
enum class WakeUpMode : uint8_t {
SingleTap = 0,
DoubleTap = 1,
RaiseWrist = 2,
Shake = 3,
LowerWrist = 4,
ButtonUnlocks = 5,
};
enum class Colors : uint8_t {
White,
Silver,
@ -260,7 +267,7 @@ namespace Pinetime {
}
};
std::bitset<5> getWakeUpModes() const {
std::bitset<6> getWakeUpModes() const {
return settings.wakeUpMode;
}
@ -321,7 +328,7 @@ namespace Pinetime {
WatchFaceInfineat watchFaceInfineat;
std::bitset<5> wakeUpMode {0};
std::bitset<6> wakeUpMode {0};
uint16_t shakeWakeThreshold = 150;
Controllers::BrightnessController::Levels brightLevel = Controllers::BrightnessController::Levels::Medium;

View file

@ -456,6 +456,12 @@ void DisplayApp::Refresh() {
case Messages::OnChargingEvent:
motorController.RunForDuration(15);
break;
case Messages::ShowIgnoreTouchPopup:
popupMessage.SetHidden(false);
break;
case Messages::HideIgnoreTouchPopup:
popupMessage.SetHidden(true);
break;
}
}
@ -579,7 +585,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
currentScreen = std::make_unique<Screens::SettingWeatherFormat>(settingsController);
break;
case Apps::SettingWakeUp:
currentScreen = std::make_unique<Screens::SettingWakeUp>(settingsController);
currentScreen = std::make_unique<Screens::SettingWakeUp>(this, settingsController);
break;
case Apps::SettingDisplay:
currentScreen = std::make_unique<Screens::SettingDisplay>(settingsController);

View file

@ -15,6 +15,7 @@
#include "components/timer/Timer.h"
#include "components/alarm/AlarmController.h"
#include "touchhandler/TouchHandler.h"
#include "displayapp/widgets/PopupMessage.h"
#include "displayapp/Messages.h"
#include "BootErrors.h"
@ -102,8 +103,10 @@ namespace Pinetime {
Pinetime::Controllers::FirmwareValidator validator;
Pinetime::Components::LittleVgl lvgl;
Pinetime::Controllers::Timer timer;
Pinetime::Applications::Widgets::PopupMessage popupMessage;
AppControllers controllers;
TaskHandle_t taskHandle;
States state = States::Running;

View file

@ -24,6 +24,8 @@ namespace Pinetime {
Chime,
BleRadioEnableToggle,
OnChargingEvent,
ShowIgnoreTouchPopup,
HideIgnoreTouchPopup
};
}
}

View file

@ -0,0 +1,29 @@
#pragma once
#include <cstdint>
#include <lvgl/lvgl.h>
#include "displayapp/screens/Screen.h"
#include "displayapp/widgets/PageIndicator.h"
namespace Pinetime {
namespace Applications {
namespace Screens {
class Page : public Screen {
public:
Page(uint8_t screenID, uint8_t numScreens, lv_obj_t* contentObj) : contentObj {contentObj}, pageIndicator(screenID, numScreens) {
pageIndicator.Create();
}
~Page() override {
lv_obj_clean(lv_scr_act());
}
private:
lv_obj_t* contentObj = nullptr;
Widgets::PageIndicator pageIndicator;
};
}
}
}

View file

@ -8,7 +8,17 @@
using namespace Pinetime::Applications::Screens;
constexpr std::array<SettingWakeUp::Option, 5> SettingWakeUp::options;
constexpr std::array<SettingWakeUp::Option, SettingWakeUp::numOptions> SettingWakeUp::options;
auto SettingWakeUp::CreateScreenList() {
std::array<std::function<std::unique_ptr<Screen>()>, nScreens> screens;
for (size_t i = 0; i < screens.size(); i++) {
screens[i] = [this, i]() -> std::unique_ptr<Screen> {
return CreateScreen(i);
};
}
return screens;
}
namespace {
void event_handler(lv_obj_t* obj, lv_event_t event) {
@ -19,7 +29,16 @@ namespace {
}
}
SettingWakeUp::SettingWakeUp(Pinetime::Controllers::Settings& settingsController) : settingsController {settingsController} {
SettingWakeUp::SettingWakeUp(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
: settingsController {settingsController}, screens {app, 0, CreateScreenList(), Screens::ScreenListModes::UpDown} {
}
SettingWakeUp::~SettingWakeUp() {
lv_obj_clean(lv_scr_act());
settingsController.SaveSettings();
}
std::unique_ptr<Screen> SettingWakeUp::CreateScreen(size_t screenNum) {
lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_bg_opa(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP);
@ -43,20 +62,29 @@ SettingWakeUp::SettingWakeUp(Pinetime::Controllers::Settings& settingsController
lv_label_set_align(icon, LV_LABEL_ALIGN_CENTER);
lv_obj_align(icon, title, LV_ALIGN_OUT_LEFT_MID, -10, 0);
for (unsigned int i = 0; i < options.size(); i++) {
// cleanup any old pointers
cbOption.fill(nullptr);
// only loop as far as the list size aĺlows
unsigned int loopMax = screenNum * optionsPerScreen + optionsPerScreen;
if (loopMax > options.size()) {
loopMax = options.size();
}
for (unsigned int i = screenNum * optionsPerScreen; i < loopMax; i++) {
cbOption[i] = lv_checkbox_create(container1, nullptr);
lv_checkbox_set_text(cbOption[i], options[i].name);
if (settingsController.isWakeUpModeOn(static_cast<Controllers::Settings::WakeUpMode>(i))) {
if (settingsController.isWakeUpModeOn(options[i].wakeUpMode)) {
lv_checkbox_set_checked(cbOption[i], true);
}
cbOption[i]->user_data = this;
lv_obj_set_event_cb(cbOption[i], event_handler);
}
return std::make_unique<Screens::Page>(screenNum, nScreens, container1);
}
SettingWakeUp::~SettingWakeUp() {
lv_obj_clean(lv_scr_act());
settingsController.SaveSettings();
bool SettingWakeUp::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
return screens.OnTouchEvent(event);
}
void SettingWakeUp::UpdateSelected(lv_obj_t* object) {
@ -74,6 +102,8 @@ void SettingWakeUp::UpdateSelected(lv_obj_t* object) {
// for example, when setting SingleTap, DoubleTap is unset and vice versa.
auto modes = settingsController.getWakeUpModes();
for (size_t i = 0; i < options.size(); ++i) {
if (cbOption[i]) {
lv_checkbox_set_checked(cbOption[i], modes[i]);
}
}
}

View file

@ -4,7 +4,10 @@
#include <cstdint>
#include <lvgl/lvgl.h>
#include "components/settings/Settings.h"
#include "displayapp/screens/Page.h"
#include "displayapp/screens/Screen.h"
#include "displayapp/screens/ScreenList.h"
#include "displayapp/widgets/PageIndicator.h"
namespace Pinetime {
@ -13,27 +16,40 @@ namespace Pinetime {
class SettingWakeUp : public Screen {
public:
SettingWakeUp(Pinetime::Controllers::Settings& settingsController);
SettingWakeUp(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
~SettingWakeUp() override;
void UpdateSelected(lv_obj_t* object);
bool OnTouchEvent(TouchEvents event) override;
private:
auto CreateScreenList();
std::unique_ptr<Screen> CreateScreen(size_t screenNum);
struct Option {
Controllers::Settings::WakeUpMode wakeUpMode;
const char* name;
};
static constexpr size_t numOptions = 6;
static constexpr size_t optionsPerScreen = 4;
static constexpr size_t nScreens = 2;
Controllers::Settings& settingsController;
static constexpr std::array<Option, 5> options = {{
ScreenList<nScreens> screens;
static constexpr std::array<Option, numOptions> options = {{
{Controllers::Settings::WakeUpMode::SingleTap, "Single Tap"},
{Controllers::Settings::WakeUpMode::DoubleTap, "Double Tap"},
{Controllers::Settings::WakeUpMode::RaiseWrist, "Raise Wrist"},
{Controllers::Settings::WakeUpMode::Shake, "Shake Wake"},
{Controllers::Settings::WakeUpMode::LowerWrist, "Lower Wrist"},
{Controllers::Settings::WakeUpMode::ButtonUnlocks, "Button Unlock"},
}};
lv_obj_t* cbOption[options.size()];
std::array<lv_obj_t*, numOptions> cbOption;
};
}
}

View file

@ -0,0 +1,56 @@
#include "displayapp/widgets/PopupMessage.h"
#include "displayapp/InfiniTimeTheme.h"
#include <libraries/log/nrf_log.h>
using namespace Pinetime::Applications::Widgets;
PopupMessage::PopupMessage() {
}
void PopupMessage::Create() {
popup = lv_obj_create(lv_scr_act(), nullptr);
lv_obj_set_size(popup, 90, 90);
lv_obj_align(popup, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
lv_obj_set_style_local_bg_color(popup, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, Colors::bg);
lv_obj_set_style_local_bg_opa(popup, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_60);
lv_obj_t* lockBody = lv_obj_create(popup, nullptr);
lv_obj_set_size(lockBody, 55, 50);
lv_obj_align(lockBody, popup, LV_ALIGN_CENTER, 0, 10);
lv_obj_set_style_local_bg_color(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_obj_set_style_local_bg_opa(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_0);
lv_obj_set_style_local_border_color(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_obj_set_style_local_border_width(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 22);
lv_obj_set_style_local_border_side(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_BORDER_SIDE_FULL);
lv_obj_set_style_local_border_opa(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_100);
lv_obj_t* lockTop = lv_obj_create(popup, nullptr);
lv_obj_set_size(lockTop, 30, 35);
lv_obj_align(lockTop, popup, LV_ALIGN_CENTER, 0, -20);
lv_obj_set_style_local_bg_color(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_obj_set_style_local_bg_opa(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_0);
lv_obj_set_style_local_border_color(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_obj_set_style_local_border_width(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 6);
lv_obj_set_style_local_border_side(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_BORDER_SIDE_FULL);
lv_obj_set_style_local_border_opa(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_100);
lv_obj_set_hidden(popup, isHidden);
}
void PopupMessage::SetHidden(bool hidden) {
if (isHidden == hidden) {
return;
}
isHidden = hidden;
// create/delete on demand
if (popup == nullptr && !isHidden) {
Create();
} else if (popup != nullptr) {
lv_obj_del(popup);
popup = nullptr;
}
}
bool PopupMessage::IsHidden() {
return isHidden;
}

View file

@ -0,0 +1,20 @@
#pragma once
#include <lvgl/lvgl.h>
namespace Pinetime {
namespace Applications {
namespace Widgets {
class PopupMessage {
public:
PopupMessage();
void Create();
void SetHidden(bool hidden);
bool IsHidden();
private:
lv_obj_t* popup = nullptr;
bool isHidden = true;
};
}
}
}

View file

@ -199,7 +199,11 @@ void SystemTask::Work() {
GoToRunning();
break;
case Messages::TouchWakeUp: {
if (touchHandler.ProcessTouchInfo(touchPanel.GetTouchInfo())) {
Pinetime::Controllers::TouchHandler::TouchProcessReply reply;
reply =
touchHandler.ProcessTouchInfo(touchPanel.GetTouchInfo(),
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::ButtonUnlocks));
if (reply == Pinetime::Controllers::TouchHandler::TouchProcessReply::TouchEvent) {
auto gesture = touchHandler.GestureGet();
if (settingsController.GetNotificationStatus() != Controllers::Settings::Notification::Sleep &&
gesture != Pinetime::Applications::TouchEvents::None &&
@ -207,6 +211,7 @@ void SystemTask::Work() {
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) ||
(gesture == Pinetime::Applications::TouchEvents::Tap &&
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::SingleTap)))) {
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::WakeUpAction, true);
GoToRunning();
}
}
@ -225,11 +230,13 @@ void SystemTask::Work() {
if (IsSleeping()) {
GoToRunning();
}
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::NewNotification);
}
break;
case Messages::SetOffAlarm:
GoToRunning();
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::AlarmTriggered);
break;
case Messages::BleConnected:
@ -240,6 +247,7 @@ void SystemTask::Work() {
case Messages::BleFirmwareUpdateStarted:
GoToRunning();
wakeLocksHeld++;
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::BleFirmwareUpdateStarted);
break;
case Messages::BleFirmwareUpdateFinished:
@ -252,6 +260,7 @@ void SystemTask::Work() {
NRF_LOG_INFO("[systemtask] FS Started");
GoToRunning();
wakeLocksHeld++;
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
// TODO add intent of fs access icon or something
break;
case Messages::StopFileTransfer:
@ -260,16 +269,30 @@ void SystemTask::Work() {
// TODO add intent of fs access icon or something
break;
case Messages::OnTouchEvent:
if (touchHandler.ProcessTouchInfo(touchPanel.GetTouchInfo())) {
Pinetime::Controllers::TouchHandler::TouchProcessReply reply;
reply =
touchHandler.ProcessTouchInfo(touchPanel.GetTouchInfo(),
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::ButtonUnlocks));
if (reply == Pinetime::Controllers::TouchHandler::TouchProcessReply::TouchEvent) {
displayApp.PushMessage(Pinetime::Applications::Display::Messages::TouchEvent);
} else if (reply == Pinetime::Controllers::TouchHandler::TouchProcessReply::IgnoreTouchPopup) {
displayApp.PushMessage(Pinetime::Applications::Display::Messages::ShowIgnoreTouchPopup);
touchHandler.SetIgnoreTouchPopupHidden(false);
}
break;
case Messages::HandleButtonEvent: {
// if the IgnoreTouchPopup is active the first button event unlocks the device
if (!touchHandler.IsIgnoreTouchPopupHidden()) {
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Button, false);
touchHandler.SetIgnoreTouchPopupHidden(true);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::HideIgnoreTouchPopup);
} else {
Controllers::ButtonActions action = Controllers::ButtonActions::None;
if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) {
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Release);
} else {
action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Press);
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Button, false);
// This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping
if (IsSleeping()) {
fastWakeUpDone = true;
@ -278,6 +301,7 @@ void SystemTask::Work() {
}
}
HandleButtonAction(action);
}
} break;
case Messages::HandleButtonTimerEvent: {
auto action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Timer);
@ -308,6 +332,8 @@ void SystemTask::Work() {
}
state = SystemTaskState::Sleeping;
// reset touch restrictions when going to sleep
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
break;
case Messages::OnNewDay:
// We might be sleeping (with TWI device disabled.
@ -319,6 +345,7 @@ void SystemTask::Work() {
if (settingsController.GetNotificationStatus() != Controllers::Settings::Notification::Sleep &&
settingsController.GetChimeOption() == Controllers::Settings::ChimesOption::Hours && !alarmController.IsAlerting()) {
GoToRunning();
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::Chime);
}
break;
@ -327,12 +354,14 @@ void SystemTask::Work() {
if (settingsController.GetNotificationStatus() != Controllers::Settings::Notification::Sleep &&
settingsController.GetChimeOption() == Controllers::Settings::ChimesOption::HalfHours && !alarmController.IsAlerting()) {
GoToRunning();
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::Chime);
}
break;
case Messages::OnChargingEvent:
batteryController.ReadPowerState();
GoToRunning();
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
displayApp.PushMessage(Applications::Display::Messages::OnChargingEvent);
break;
case Messages::MeasureBatteryTimerExpired:
@ -343,6 +372,7 @@ void SystemTask::Work() {
break;
case Messages::OnPairing:
GoToRunning();
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::Other, false);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::ShowPairingKey);
break;
case Messages::BleRadioEnableToggle:
@ -413,6 +443,8 @@ void SystemTask::GoToSleep() {
NRF_LOG_INFO("[systemtask] Going to sleep");
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToSleep);
heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep);
touchHandler.SetIgnoreTouchPopupHidden(true);
displayApp.PushMessage(Pinetime::Applications::Display::Messages::HideIgnoreTouchPopup);
state = SystemTaskState::GoingToSleep;
};
@ -438,6 +470,9 @@ void SystemTask::UpdateMotion() {
motionController.ShouldRaiseWake()) ||
(settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake) &&
motionController.ShouldShakeWake(settingsController.GetShakeThreshold()))) {
if (state == SystemTaskState::Sleeping) {
touchHandler.SetWokenBy(Pinetime::Controllers::TouchHandler::WokenBy::WakeUpAction, true);
}
GoToRunning();
}
}

View file

@ -53,6 +53,11 @@ namespace Pinetime {
class SystemTask {
public:
enum class SystemTaskState { Sleeping, Running, GoingToSleep };
// Enum describes how the watch was woken:
// * WakeUpAction: The actions selected in the wakeup settings, single/double tap, raise, shake
// * Button: The hardware button
// * Other: Other things that can wake the watch up, eg. apps and notifications.
enum class WokenBy { WakeUpAction, Button, Other };
SystemTask(Drivers::SpiMaster& spi,
Pinetime::Drivers::SpiNorFlash& spiNorFlash,
Drivers::TwiMaster& twiMaster,

View file

@ -33,9 +33,9 @@ Pinetime::Applications::TouchEvents TouchHandler::GestureGet() {
return returnGesture;
}
bool TouchHandler::ProcessTouchInfo(Drivers::Cst816S::TouchInfos info) {
TouchHandler::TouchProcessReply TouchHandler::ProcessTouchInfo(Drivers::Cst816S::TouchInfos info, bool buttonUnlocksOn) {
if (!info.isValid) {
return false;
return TouchHandler::TouchProcessReply::NoAction;
}
// Only a single gesture per touch
@ -62,5 +62,19 @@ bool TouchHandler::ProcessTouchInfo(Drivers::Cst816S::TouchInfos info) {
currentTouchPoint = {info.x, info.y, info.touching};
return true;
// if the watch was just woken by touch and button must be used to unlock, ignore the first touch event which
// is the touch event that woke the watch. Otherwise the lock-popup will be displayed
if (buttonUnlocksOn && ignoreNextTouchEvent) {
ignoreNextTouchEvent = false;
return TouchHandler::TouchProcessReply::NoAction;
} else if (!buttonUnlocksOn || wokenBy != WokenBy::WakeUpAction) {
// if we get to here TouchEvents is allowed and the "ButtonUnlocks" requirement can be overridden
wokenBy = WokenBy::Other;
return TouchHandler::TouchProcessReply::TouchEvent;
} else {
return TouchHandler::TouchProcessReply::IgnoreTouchPopup;
}
}

View file

@ -6,13 +6,25 @@ namespace Pinetime {
namespace Controllers {
class TouchHandler {
public:
// Enum describes how the watch was woken:
// * WakeUpAction: The actions selected in the wakeup settings, single/double tap, raise, shake
// * Button: The hardware button
// * Other: Other things that can wake the watch up, eg. apps and notifications.
enum class WokenBy { WakeUpAction, Button, Other };
// Enum describes how the reply from ProcessTouchInfo should be interpreted:
// * NoAction: Do nothing, ignore input.
// * TouchEvent: The input should be treated as a normal touch event.
// * IgnoreTouchPopup: Show the popup when ignoring touch input.
enum class TouchProcessReply { NoAction, TouchEvent, IgnoreTouchPopup };
struct TouchPoint {
int x;
int y;
bool touching;
};
bool ProcessTouchInfo(Drivers::Cst816S::TouchInfos info);
TouchProcessReply ProcessTouchInfo(Drivers::Cst816S::TouchInfos info, bool buttonUnlocksOn = false);
bool IsTouching() const {
return currentTouchPoint.touching;
@ -26,12 +38,29 @@ namespace Pinetime {
return currentTouchPoint.y;
}
void SetIgnoreTouchPopupHidden(bool hidden) {
ignoreTouchPopupHidden = hidden;
}
bool IsIgnoreTouchPopupHidden() {
return ignoreTouchPopupHidden;
}
void SetWokenBy(WokenBy woken, bool ifButtonUnlocksIgnoreTouch) {
wokenBy = woken;
ignoreNextTouchEvent = ifButtonUnlocksIgnoreTouch;
}
Pinetime::Applications::TouchEvents GestureGet();
private:
Pinetime::Applications::TouchEvents gesture;
TouchPoint currentTouchPoint = {};
bool gestureReleased = true;
WokenBy wokenBy;
bool ignoreNextTouchEvent = false;
bool ignoreTouchPopupHidden = true;
};
}
}