|
|
@ -1,10 +1,8 @@
|
|
|
|
local ConfigDialog = require("ui/widget/configdialog")
|
|
|
|
local ConfigDialog = require("ui/widget/configdialog")
|
|
|
|
local InputContainer = require("ui/widget/container/inputcontainer")
|
|
|
|
|
|
|
|
local Device = require("device")
|
|
|
|
local Device = require("device")
|
|
|
|
local GestureRange = require("ui/gesturerange")
|
|
|
|
|
|
|
|
local Geom = require("ui/geometry")
|
|
|
|
|
|
|
|
local Screen = require("device").screen
|
|
|
|
|
|
|
|
local Event = require("ui/event")
|
|
|
|
local Event = require("ui/event")
|
|
|
|
|
|
|
|
local Geom = require("ui/geometry")
|
|
|
|
|
|
|
|
local InputContainer = require("ui/widget/container/inputcontainer")
|
|
|
|
local UIManager = require("ui/uimanager")
|
|
|
|
local UIManager = require("ui/uimanager")
|
|
|
|
local _ = require("gettext")
|
|
|
|
local _ = require("gettext")
|
|
|
|
|
|
|
|
|
|
|
@ -25,19 +23,28 @@ function ReaderConfig:init()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderConfig:initGesListener()
|
|
|
|
function ReaderConfig:initGesListener()
|
|
|
|
self.ges_events = {
|
|
|
|
self.ui:registerTouchZones({
|
|
|
|
TapShowConfigMenu = {
|
|
|
|
{
|
|
|
|
GestureRange:new{
|
|
|
|
id = "readerconfigmenu_tap",
|
|
|
|
ges = "tap",
|
|
|
|
ges = "tap",
|
|
|
|
range = Geom:new{
|
|
|
|
screen_zone = {
|
|
|
|
x = Screen:getWidth()*DTAP_ZONE_CONFIG.x,
|
|
|
|
ratio_x = DTAP_ZONE_CONFIG.x, ratio_y = DTAP_ZONE_CONFIG.y,
|
|
|
|
y = Screen:getHeight()*DTAP_ZONE_CONFIG.y,
|
|
|
|
ratio_w = DTAP_ZONE_CONFIG.w, ratio_h = DTAP_ZONE_CONFIG.h,
|
|
|
|
w = Screen:getWidth()*DTAP_ZONE_CONFIG.w,
|
|
|
|
},
|
|
|
|
h = Screen:getHeight()*DTAP_ZONE_CONFIG.h,
|
|
|
|
overrides = { 'tap_forward', 'tap_backward', },
|
|
|
|
}
|
|
|
|
handler = function() return self:onTapShowConfigMenu() end,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
{
|
|
|
|
}
|
|
|
|
id = "readerconfigmenu_swipe",
|
|
|
|
|
|
|
|
ges = "swipe",
|
|
|
|
|
|
|
|
screen_zone = {
|
|
|
|
|
|
|
|
ratio_x = DTAP_ZONE_CONFIG.x, ratio_y = DTAP_ZONE_CONFIG.y,
|
|
|
|
|
|
|
|
ratio_w = DTAP_ZONE_CONFIG.w, ratio_h = DTAP_ZONE_CONFIG.h,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
overrides = { "rolling_swipe", "paging_swipe", },
|
|
|
|
|
|
|
|
handler = function(ges) return self:onSwipeShowConfigMenu(ges) end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderConfig:onShowConfigMenu()
|
|
|
|
function ReaderConfig:onShowConfigMenu()
|
|
|
@ -62,6 +69,13 @@ function ReaderConfig:onTapShowConfigMenu()
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderConfig:onSwipeShowConfigMenu(ges)
|
|
|
|
|
|
|
|
if ges.direction == "north" then
|
|
|
|
|
|
|
|
self:onShowConfigMenu()
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderConfig:onSetDimensions(dimen)
|
|
|
|
function ReaderConfig:onSetDimensions(dimen)
|
|
|
|
if Device:isTouchDevice() then
|
|
|
|
if Device:isTouchDevice() then
|
|
|
|
self:initGesListener()
|
|
|
|
self:initGesListener()
|
|
|
|