[UX] Add double finger up and down swipe gesture (#5183)

* Add double finger up and down swipe gesture
* Cleaning ReaderFrontLight
This commit is contained in:
Robert
2019-08-06 19:54:09 +02:00
committed by Frans de Jonge
parent dac2458427
commit aec112fa6b
2 changed files with 43 additions and 72 deletions

View File

@@ -203,6 +203,8 @@ function ReaderGesture:init()
two_finger_swipe_east = self.ges_mode == "gesture_reader" and "toc" or "ignore",
two_finger_swipe_west = self.ges_mode == "gesture_reader" and "bookmarks" or "folder_shortcuts",
two_finger_swipe_south = Device:hasFrontlight() and "decrease_frontlight" or "ignore",
two_finger_swipe_north = Device:hasFrontlight() and "increase_frontlight" or "ignore",
two_finger_swipe_northeast = "ignore",
two_finger_swipe_northwest = "ignore",
two_finger_swipe_southeast = "ignore",
@@ -589,6 +591,14 @@ Default value: %1]]), GestureDetector.SWIPE_INTERVAL/1000),
text_func = function() return twoFingerSwipeTextFunc("two_finger_swipe_west", "") end,
sub_item_table = self:buildMenu("two_finger_swipe_west", self.default_gesture["two_finger_swipe_west"]),
},
{
text_func = function() return twoFingerSwipeTextFunc("two_finger_swipe_south", "") end,
sub_item_table = self:buildMenu("two_finger_swipe_south", self.default_gesture["two_finger_swipe_south"]),
},
{
text_func = function() return twoFingerSwipeTextFunc("two_finger_swipe_north", "") end,
sub_item_table = self:buildMenu("two_finger_swipe_north", self.default_gesture["two_finger_swipe_north"]),
},
{
text_func = function() return twoFingerSwipeTextFunc("two_finger_swipe_northeast", "") end,
sub_item_table = self:buildMenu("two_finger_swipe_northeast", self.default_gesture["two_finger_swipe_northeast"]),
@@ -1048,6 +1058,14 @@ function ReaderGesture:setupGesture(ges, action)
ges_type = "two_finger_swipe"
zone = zone_fullscreen
direction = {east = true}
elseif ges == "two_finger_swipe_south" then
ges_type = "two_finger_swipe"
zone = zone_fullscreen
direction = {south = true}
elseif ges == "two_finger_swipe_north" then
ges_type = "two_finger_swipe"
zone = zone_fullscreen
direction = {north = true}
elseif ges == "two_finger_swipe_northwest" then
ges_type = "two_finger_swipe"
zone = zone_fullscreen