mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Page turn animations
Kindle PW5 (MTK) with hardware support Currently only in Crengine
This commit is contained in:
2
base
2
base
Submodule base updated: 1e3f3a42fd...095b0281cc
@@ -1006,6 +1006,9 @@ function ReaderRolling:_gotoPos(new_pos, do_dim_area)
|
||||
else
|
||||
self.view.dim_area:clear()
|
||||
end
|
||||
if self.current_pos and not UIManager.currently_scrolling then
|
||||
self.ui:handleEvent(Event:new("PageChangeAnimation", new_pos > self.current_pos))
|
||||
end
|
||||
self.ui.document:gotoPos(new_pos)
|
||||
-- The current page we get in scroll mode may be a bit innacurate,
|
||||
-- but we give it anyway to onPosUpdate so footer and statistics can
|
||||
@@ -1038,6 +1041,9 @@ function ReaderRolling:_gotoPage(new_page, free_first_page, internal)
|
||||
end
|
||||
end
|
||||
end
|
||||
if self.current_page then
|
||||
self.ui:handleEvent(Event:new("PageChangeAnimation", new_page > self.current_page))
|
||||
end
|
||||
self.ui.document:gotoPage(new_page, internal)
|
||||
if self.view.view_mode == "page" then
|
||||
self.ui:handleEvent(Event:new("PageUpdate", self.ui.document:getCurrentPage()))
|
||||
|
||||
@@ -889,6 +889,14 @@ function ReaderView:onRotationUpdate(rotation)
|
||||
self:recalculate()
|
||||
end
|
||||
|
||||
function ReaderView:onPageChangeAnimation(forward)
|
||||
if Device:canDoSwipeAnimation() and G_reader_settings:isTrue("swipe_animations") then
|
||||
if self.inverse_reading_order then forward = not forward end
|
||||
Screen:setSwipeAnimations(true)
|
||||
Screen:setSwipeDirection(forward)
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderView:onReaderFooterVisibilityChange()
|
||||
-- Don't bother ReaderRolling with this nonsense, the footer's height is NOT handled via visible_area there ;)
|
||||
if self.ui.paging and self.state.page then
|
||||
|
||||
@@ -54,6 +54,7 @@ local Device = {
|
||||
hasExternalSD = no, -- or other storage volume that cannot be accessed using the File Manager
|
||||
canHWDither = no,
|
||||
canHWInvert = no,
|
||||
canDoSwipeAnimation = no,
|
||||
canModifyFBInfo = no, -- some NTX boards do wonky things with the rotate flag after a FBIOPUT_VSCREENINFO ioctl
|
||||
canUseCBB = yes, -- The C BB maintains a 1:1 feature parity with the Lua BB, except that is has NO support for BB4, and limited support for BBRGB24
|
||||
hasColorScreen = no,
|
||||
|
||||
@@ -473,6 +473,7 @@ local KindlePaperWhite5 = Kindle:new{
|
||||
touch_dev = "/dev/input/by-path/platform-1001e000.i2c-event",
|
||||
-- NOTE: While hardware dithering (via MDP) should be a thing, it doesn't appear to do anything right now :/.
|
||||
canHWDither = no,
|
||||
canDoSwipeAnimation = yes,
|
||||
}
|
||||
|
||||
function Kindle2:init()
|
||||
|
||||
@@ -141,6 +141,19 @@ When enabled the UI direction for the Table of Contents, Book Map, and Page Brow
|
||||
}
|
||||
}
|
||||
|
||||
if Device:canDoSwipeAnimation() then
|
||||
table.insert(PageTurns.sub_item_table, {
|
||||
text =_("Page Turn Animations"),
|
||||
checked_func = function()
|
||||
return G_reader_settings:isTrue("swipe_animations")
|
||||
end,
|
||||
callback = function()
|
||||
G_reader_settings:flipNilOrFalse("swipe_animations")
|
||||
end,
|
||||
separator = true,
|
||||
})
|
||||
end
|
||||
|
||||
if Device:hasKeys() then
|
||||
table.insert(PageTurns.sub_item_table, {
|
||||
text = _("Invert page turn buttons"),
|
||||
|
||||
Reference in New Issue
Block a user