|
8 | 8 | #include "components/ble/BleController.h"
|
9 | 9 | #include "components/datetime/DateTimeController.h"
|
10 | 10 | #include "components/ble/NotificationManager.h"
|
| 11 | +#include "components/ble/MusicService.h" |
11 | 12 | #include "components/motion/MotionController.h"
|
12 | 13 | #include "components/motor/MotorController.h"
|
13 | 14 | #include "displayapp/screens/ApplicationList.h"
|
|
48 | 49 | #include "displayapp/screens/settings/SettingChimes.h"
|
49 | 50 | #include "displayapp/screens/settings/SettingShakeThreshold.h"
|
50 | 51 | #include "displayapp/screens/settings/SettingBluetooth.h"
|
| 52 | +#include "displayapp/screens/settings/SettingDoubleClick.h" |
51 | 53 |
|
52 | 54 | #include "libs/lv_conf.h"
|
53 | 55 | #include "UserApps.h"
|
@@ -360,9 +362,7 @@ void DisplayApp::Refresh() {
|
360 | 362 | LoadNewScreen(Apps::SysInfo, DisplayApp::FullRefreshDirections::Up);
|
361 | 363 | break;
|
362 | 364 | case Messages::ButtonDoubleClicked:
|
363 |
| - if (currentApp != Apps::Notifications && currentApp != Apps::NotificationsPreview) { |
364 |
| - LoadNewScreen(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); |
365 |
| - } |
| 365 | + HandleDoubleClick(); |
366 | 366 | break;
|
367 | 367 |
|
368 | 368 | case Messages::BleFirmwareUpdateStarted:
|
@@ -507,6 +507,9 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
|
507 | 507 | case Apps::SettingWakeUp:
|
508 | 508 | currentScreen = std::make_unique<Screens::SettingWakeUp>(settingsController);
|
509 | 509 | break;
|
| 510 | + case Apps::SettingDoubleClick: |
| 511 | + currentScreen = std::make_unique<Screens::SettingDoubleClick>(settingsController); |
| 512 | + break; |
510 | 513 | case Apps::SettingDisplay:
|
511 | 514 | currentScreen = std::make_unique<Screens::SettingDisplay>(this, settingsController);
|
512 | 515 | break;
|
@@ -632,3 +635,16 @@ void DisplayApp::ApplyBrightness() {
|
632 | 635 | }
|
633 | 636 | brightnessController.Set(brightness);
|
634 | 637 | }
|
| 638 | + |
| 639 | +void DisplayApp::HandleDoubleClick() { |
| 640 | + switch (settingsController.GetDoubleClickAction()) { |
| 641 | + case Controllers::Settings::DoubleClickAction::GoToNotifications: |
| 642 | + if (currentApp != Apps::Notifications && currentApp != Apps::NotificationsPreview) { |
| 643 | + LoadNewScreen(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); |
| 644 | + } |
| 645 | + break; |
| 646 | + case Controllers::Settings::DoubleClickAction::AudioNext: |
| 647 | + systemTask->nimble().music().event(Controllers::MusicService::EVENT_MUSIC_NEXT); |
| 648 | + break; |
| 649 | + } |
| 650 | +} |
0 commit comments