|
|
|
@ -11,8 +11,8 @@ local _ = require("gettext")
|
|
|
|
|
|
|
|
|
|
local ReaderFrontLight = InputContainer:new{
|
|
|
|
|
steps = {0,1,1,1,1,2,2,2,3,4,5,6,7,8,9,10},
|
|
|
|
|
gestureScale = Screen:getWidth() * FRONTLIGHT_SENSITIVITY_DECREASE,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ReaderFrontLight:init()
|
|
|
|
|
if Device:isTouchDevice() then
|
|
|
|
|
self.ges_events = {
|
|
|
|
@ -42,7 +42,7 @@ function ReaderFrontLight:onAdjust(arg, ges)
|
|
|
|
|
local powerd = Device:getPowerDevice()
|
|
|
|
|
if powerd.flIntensity ~= nil then
|
|
|
|
|
DEBUG("frontlight intensity", powerd.flIntensity)
|
|
|
|
|
local step = math.ceil(#self.steps * ges.distance / Screen:getWidth())
|
|
|
|
|
local step = math.ceil(#self.steps * ges.distance / self.gestureScale)
|
|
|
|
|
DEBUG("step = ", step)
|
|
|
|
|
local delta_int = self.steps[step] or self.steps[#self.steps]
|
|
|
|
|
DEBUG("delta_int = ", delta_int)
|
|
|
|
|