aboutsummaryrefslogtreecommitdiffstats
path: root/src/DisplayApp/Screens/DropDownDemo.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-08-20 21:09:45 +0200
committerJF <jf@codingfield.com>2020-08-20 21:09:45 +0200
commit7d3af600bd056e0f4be7d31122cc2dbb352cef70 (patch)
tree80d626e7e1a2bffe4915b1ac53aa10fcd82756b4 /src/DisplayApp/Screens/DropDownDemo.h
parente6a1aff6cee374d8888d89ec03e604f19a0a450d (diff)
Add TouchModes : in Gestures mode, only 1 event is processed for each touchevent. This allows to recognize gesture and handle them in Screens or in DisplayApp.
In Polling mode, X/Y positions are sent continuously to lvgl, allowing to scroll inside a dropdown menu for example.
Diffstat (limited to 'src/DisplayApp/Screens/DropDownDemo.h')
-rw-r--r--src/DisplayApp/Screens/DropDownDemo.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/DisplayApp/Screens/DropDownDemo.h b/src/DisplayApp/Screens/DropDownDemo.h
new file mode 100644
index 00000000..7c75efc0
--- /dev/null
+++ b/src/DisplayApp/Screens/DropDownDemo.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <cstdint>
+#include "Screen.h"
+#include <bits/unique_ptr.h>
+#include <libs/lvgl/src/lv_core/lv_style.h>
+#include <libs/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 OnButtonPushed() override;
+ bool OnTouchEvent(TouchEvents event) override;
+
+ private:
+ lv_obj_t * ddlist;
+ bool running = true;
+ bool isDropDownOpened = false;
+ };
+ }
+ }
+}