mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[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.
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user