[fix] revert removing tap gestures to show menus

as the tap gesture on the upper part (mostly) of the screen is
a conventional design to show menus in almost all ereaders as well as
some mobile phone apps. While users not farmilar with the Android world
have no experience with swipe down to show menus that's why we need a
quick start guide for this feature. And experienced Koreader users
probably will turn pages by mistake each time they want to popup the menus.

The solution here is adding back the tap gestures as they were and keep
the new swipe to show menu feature as a supplementary function when
link's tap area blocks menu's tap area.
pull/832/merge
chrox 7 years ago committed by Frans de Jonge
parent 0a02b529ae
commit fef18ec73a

@ -53,6 +53,15 @@ function FileManagerMenu:initGesListener()
if not Device:isTouchDevice() then return end
self:registerTouchZones({
{
id = "filemanager_tap",
ges = "tap",
screen_zone = {
ratio_x = DTAP_ZONE_MENU.x, ratio_y = DTAP_ZONE_MENU.y,
ratio_w = DTAP_ZONE_MENU.w, ratio_h = DTAP_ZONE_MENU.h,
},
handler = function(ges) return self:onTapShowMenu(ges) end,
},
{
id = "filemanager_swipe",
ges = "swipe",
@ -370,6 +379,11 @@ function FileManagerMenu:onCloseFileManagerMenu()
return true
end
function FileManagerMenu:onTapShowMenu(ges)
self:onShowMenu()
return true
end
function FileManagerMenu:onSwipeShowMenu(ges)
if ges.direction == "south" then
self:onShowMenu()

@ -83,6 +83,15 @@ function ReaderMenu:onReaderReady()
if not Device:isTouchDevice() then return end
self.ui:registerTouchZones({
{
id = "readermenu_tap",
ges = "tap",
screen_zone = {
ratio_x = DTAP_ZONE_MENU.x, ratio_y = DTAP_ZONE_MENU.y,
ratio_w = DTAP_ZONE_MENU.w, ratio_h = DTAP_ZONE_MENU.h,
},
handler = function(ges) return self:onTapShowMenu(ges) end,
},
{
id = "readermenu_swipe",
ges = "swipe",
@ -285,6 +294,11 @@ function ReaderMenu:onSwipeShowMenu(ges)
end
end
function ReaderMenu:onTapShowMenu()
self.ui:handleEvent(Event:new("ShowConfigMenu"))
self.ui:handleEvent(Event:new("ShowReaderMenu"))
end
function ReaderMenu:onTapCloseMenu()
self.ui:handleEvent(Event:new("CloseReaderMenu"))
self.ui:handleEvent(Event:new("CloseConfigMenu"))

Loading…
Cancel
Save