diff options
author | Reinhold Gschweicher <pyro4hell@gmail.com> | 2022-02-16 22:33:59 +0100 |
---|---|---|
committer | JF <JF002@users.noreply.github.com> | 2022-02-19 13:17:45 +0100 |
commit | f829427c4186ec003d51c689c6831d076f3b0b69 (patch) | |
tree | a1e8f1ae6dcd05adb3f55e3a1153173d735223d0 /src/displayapp/screens | |
parent | b857fdb9f438cd9a3440c82face944323301cfad (diff) |
Remove unused and not compiling DropDownDemo
For ease of use the simulator uses a globbing expression to get all
screens source files. This one was picked up as well and lead to a
compilation error.
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r-- | src/displayapp/screens/DropDownDemo.cpp | 57 | ||||
-rw-r--r-- | src/displayapp/screens/DropDownDemo.h | 27 |
2 files changed, 0 insertions, 84 deletions
diff --git a/src/displayapp/screens/DropDownDemo.cpp b/src/displayapp/screens/DropDownDemo.cpp deleted file mode 100644 index cf239a2f..00000000 --- a/src/displayapp/screens/DropDownDemo.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "displayapp/screens/DropDownDemo.h" -#include <lvgl/lvgl.h> -#include <libraries/log/nrf_log.h> -#include "displayapp/DisplayApp.h" - -using namespace Pinetime::Applications::Screens; - -DropDownDemo::DropDownDemo(Pinetime::Applications::DisplayApp* app) : Screen(app) { - // Create the dropdown object, with many item, and fix its height - ddlist = lv_ddlist_create(lv_scr_act(), nullptr); - lv_ddlist_set_options(ddlist, - "Apple\n" - "Banana\n" - "Orange\n" - "Melon\n" - "Grape\n" - "Raspberry\n" - "A\n" - "B\n" - "C\n" - "D\n" - "E"); - lv_ddlist_set_fix_width(ddlist, 150); - lv_ddlist_set_draw_arrow(ddlist, true); - lv_ddlist_set_fix_height(ddlist, 150); - lv_obj_align(ddlist, nullptr, LV_ALIGN_IN_TOP_MID, 0, 20); -} - -DropDownDemo::~DropDownDemo() { - // Reset the touchmode - app->SetTouchMode(DisplayApp::TouchModes::Gestures); - lv_obj_clean(lv_scr_act()); -} - -bool DropDownDemo::Refresh() { - auto* list = static_cast<lv_ddlist_ext_t*>(ddlist->ext_attr); - - // Switch touchmode to Polling if the dropdown is opened. This will allow to scroll inside the - // dropdown while it is opened. - // Disable the polling mode when the dropdown is closed to be able to handle the gestures. - if (list->opened) - app->SetTouchMode(DisplayApp::TouchModes::Polling); - else - app->SetTouchMode(DisplayApp::TouchModes::Gestures); - return running; -} - -bool DropDownDemo::OnTouchEvent(Pinetime::Applications::TouchEvents event) { - // If the dropdown is opened, notify Display app that it doesn't need to handle the event - // (this will prevent displayApp from going back to the menu or clock scree). - auto* list = static_cast<lv_ddlist_ext_t*>(ddlist->ext_attr); - if (list->opened) { - return true; - } else { - return false; - } -} diff --git a/src/displayapp/screens/DropDownDemo.h b/src/displayapp/screens/DropDownDemo.h deleted file mode 100644 index bcf0f45c..00000000 --- a/src/displayapp/screens/DropDownDemo.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include <cstdint> -#include "displayapp/screens/Screen.h" -#include <lvgl/src/lv_core/lv_obj.h> - -namespace Pinetime { - namespace Applications { - namespace Screens { - - class DropDownDemo : public Screen { - public: - DropDownDemo(DisplayApp* app); - ~DropDownDemo() override; - - bool Refresh() override; - - bool OnTouchEvent(TouchEvents event) override; - - private: - lv_obj_t* ddlist; - - bool isDropDownOpened = false; - }; - } - } -} |