mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add swipe rolling for crereader
This commit is contained in:
@@ -88,7 +88,17 @@ function ReaderRolling:initGesListener()
|
||||
h = 5*Screen:getHeight()/8,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Swipe = {
|
||||
GestureRange:new{
|
||||
ges = "swipe",
|
||||
range = Geom:new{
|
||||
x = 0, y = 0,
|
||||
w = Screen:getWidth(),
|
||||
h = Screen:getHeight(),
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
@@ -149,6 +159,15 @@ function ReaderRolling:onTapBackward()
|
||||
return true
|
||||
end
|
||||
|
||||
function ReaderRolling:onSwipe(arg, ges)
|
||||
if ges.direction == "west" or ges.direction == "north" then
|
||||
self:onGotoViewRel(1)
|
||||
elseif ges.direction == "east" or ges.direction == "south" then
|
||||
self:onGotoViewRel(-1)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function ReaderRolling:onPosUpdate(new_pos)
|
||||
self.current_pos = new_pos
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user