Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UX] Gesture manager: add diagonal two-finger swipes #4820

Merged
merged 2 commits into from Mar 29, 2019

Conversation

Projects
None yet
2 participants
@Frenzie
Copy link
Member

commented Mar 19, 2019

Follow-up to #4815. Pointed out as an easy target here by @poire-z. Diagonal two-finger swipes are currently unused.

@ersi Do you have any suggestions for defaults?

Screenshot_2019-03-19_20-34-25

PS Migrating up/down isn't self-evident because it does some fancy stuff with gesture length.

function ReaderFrontLight:onAdjust(arg, ges)
if not Device.hasFrontlight() then return true end
local powerd = Device:getPowerDevice()
logger.dbg("frontlight intensity", powerd:frontlightIntensity())
local step = math.ceil(#self.steps * ges.distance / self.gestureScale)
logger.dbg("step = ", step)
local delta_int = self.steps[step] or self.steps[#self.steps]
logger.dbg("delta_int = ", delta_int)
local new_intensity
if ges.direction == "north" then
new_intensity = powerd:frontlightIntensity() + delta_int
elseif ges.direction == "south" then
new_intensity = powerd:frontlightIntensity() - delta_int
end
if new_intensity == nil then return true end
-- when new_intensity <=0, toggle light off
if new_intensity <= 0 then
powerd:turnOffFrontlight()
else
powerd:setIntensity(new_intensity)
end
if self.view.footer_visible and self.view.footer.settings.frontlight then
self.view.footer:updateFooter()
end
return true
end

[UX] Gesture manager: add diagonal two-finger swipes
Follow-up to #4815. Pointed out as an easy target [here](#4815 (comment)) by @poire-z.

@Frenzie Frenzie added the UX label Mar 19, 2019

@Frenzie Frenzie added this to the 2019.04 milestone Mar 19, 2019

@Frenzie Frenzie merged commit db5bd88 into koreader:master Mar 29, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@Frenzie Frenzie deleted the Frenzie:diagonal-twofinger branch Mar 29, 2019

@poire-z

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2019

Could be nice if the 2-fingers menu would show the assigned action: ⬈ (action) , like the multiswipe menu does.

Totally unrelated, but I don't know where to mention that:
Twice since yesterday on the emulator after rebuilding, and this morning with today's nightly on Android, it happened that I couldn't show the top menu with tap: nothing happened - while tap on bottom showed the bottom menu.
Restarting koreader made this work again. Dunno yet if it can happen again, of it it's some one-off thing.
I don't see anything in the last 2-3 days commits that could cause this.

Frenzie added a commit to Frenzie/koreader that referenced this pull request Mar 30, 2019

Frenzie added a commit that referenced this pull request Mar 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.