page links for crereader and pdfreader

Swipe right will return to previous page or position.
This commit is contained in:
chrox
2014-01-18 15:04:24 +08:00
parent f6cf3aa497
commit 34e28d28e6
4 changed files with 97 additions and 25 deletions

View File

@@ -183,16 +183,10 @@ function ReaderRolling:onTapBackward()
end
function ReaderRolling:onSwipe(arg, ges)
if ges.direction == "north" then
if ges.direction == "west" or ges.direction == "north" then
self:onGotoViewRel(1)
elseif ges.direction == "south" then
elseif ges.direction == "east" or ges.direction == "south" then
self:onGotoViewRel(-1)
elseif ges.direction == "west" then
self.ui.document:goForward()
self:onUpdateXPointer()
elseif ges.direction == "east" then
self.ui.document:goBack()
self:onUpdateXPointer()
end
return true
end