mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 02:22:18 +02:00
Add on layout change initial support
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user