Add simple swipe component

This commit is contained in:
Insality
2020-04-17 20:04:45 +03:00
parent 14a70964c8
commit 3339b00071
8 changed files with 172 additions and 6 deletions

View File

@@ -33,8 +33,8 @@ nodes {
w: 1.0
}
size {
x: 1.0
y: 1.0
x: 600.0
y: 900.0
z: 0.0
w: 1.0
}
@@ -65,7 +65,7 @@ nodes {
clipping_inverted: false
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_AUTO
size_mode: SIZE_MODE_MANUAL
}
nodes {
position {

View File

@@ -39,11 +39,24 @@ local function init_top_panel(self)
end
local function init_swipe_control(self)
self.druid:new_swipe("root", function(_, side)
if side == "left" then
on_control_button(self, 1)
end
if side == "right" then
on_control_button(self, -1)
end
end)
end
function init(self)
druid.set_default_style(default_style)
self.druid = druid.new(self)
init_top_panel(self)
init_swipe_control(self)
self.page = 1
main_page.setup_page(self)
text_page.setup_page(self)

View File

@@ -106,7 +106,6 @@ local function setup_back_handler(self)
end
function M.setup_page(self)
setup_texts(self)