Add on layout change initial support

This commit is contained in:
Insality
2020-09-08 23:40:05 +03:00
parent 40b2837608
commit 04c39f1ce2
8 changed files with 46 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ local helper = require("druid.helper")
local const = require("druid.const")
local component = require("druid.component")
local M = component.create("slider", { const.ON_INPUT_HIGH })
local M = component.create("slider", { const.ON_INPUT_HIGH, const.ON_LAYOUT_CHANGE })
local function on_change_value(self)
@@ -59,6 +59,11 @@ function M.init(self, node, end_pos, callback)
end
function M.on_layout_change(self)
self:set(self.value, true)
end
function M.on_input(self, action_id, action)
if action_id ~= const.ACTION_TOUCH then
return false