diff --git a/Makefile b/Makefile index 77a4c516a..fe4eb7008 100644 --- a/Makefile +++ b/Makefile @@ -128,8 +128,9 @@ koboupdate: all androidupdate: all mkdir -p $(ANDROID_LAUNCHER_DIR)/assets/module -rm $(ANDROID_LAUNCHER_DIR)/assets/module/koreader-* - cd $(INSTALL_DIR)/koreader && 7z a -l -mx=3 \ - ../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-g$(REVISION).7z * + cd $(INSTALL_DIR)/koreader && 7z a -l -mx=1 \ + ../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-g$(REVISION).7z * \ + -x!resources/fonts -x!resources/icons/src -x!spec androiddev: androidupdate $(MAKE) -C $(ANDROID_LAUNCHER_DIR) dev diff --git a/android/luajit-launcher b/android/luajit-launcher index 675fce576..3153b9269 160000 --- a/android/luajit-launcher +++ b/android/luajit-launcher @@ -1 +1 @@ -Subproject commit 675fce5766d4b9390399f454959d12e2e545b14e +Subproject commit 3153b92693a4a57cbe6e21d32f94b1f89e115633 diff --git a/frontend/document/koptinterface.lua b/frontend/document/koptinterface.lua index 01229ad56..67ef58f5b 100644 --- a/frontend/document/koptinterface.lua +++ b/frontend/document/koptinterface.lua @@ -7,6 +7,7 @@ local Geom = require("ui/geometry") local serial = require("serialize") local Cache = require("cache") local DEBUG = require("dbg") +local util = require("ffi/util") local KoptInterface = { ocrengine = "ocrengine", @@ -673,7 +674,20 @@ end function KoptInterface:clipPagePNGString(doc, pos0, pos1, pboxes, drawer) local kc = self:getClipPageContext(doc, pos0, pos1, pboxes, drawer) - local png = kc:exportSrcPNGString(pboxes, drawer) + -- there is no fmemopen in Android so leptonica.pixWriteMemPng will + -- fail silently, workaround is creating a PNG file and read back the string + local png = nil + if util.isAndroid() then + local tmp = "cache/tmpclippng.png" + kc:exportSrcPNGFile(pboxes, drawer, tmp) + local pngfile = io.open(tmp, "rb") + if pngfile then + png = pngfile:read("*all") + pngfile:close() + end + else + png = kc:exportSrcPNGString(pboxes, drawer) + end kc:free() return png end diff --git a/frontend/ui/widget/buttondialog.lua b/frontend/ui/widget/buttondialog.lua index ad4794acd..58aa18e88 100644 --- a/frontend/ui/widget/buttondialog.lua +++ b/frontend/ui/widget/buttondialog.lua @@ -21,7 +21,8 @@ function ButtonDialog:init() AnyKeyPressed = { { Input.group.Any }, seqtext = "any key", doc = _("close dialog") } } - else + end + if Device:isTouchDevice() then self.ges_events.TapClose = { GestureRange:new{ ges = "tap", diff --git a/frontend/ui/widget/virtualkeyboard.lua b/frontend/ui/widget/virtualkeyboard.lua index 1836d2e9e..ea1e1b2d6 100644 --- a/frontend/ui/widget/virtualkeyboard.lua +++ b/frontend/ui/widget/virtualkeyboard.lua @@ -20,10 +20,10 @@ local VirtualKey = InputContainer:new{ key = nil, icon = nil, label = nil, - + keyboard = nil, callback = nil, - + width = nil, height = nil, bordersize = 2, @@ -42,7 +42,7 @@ function VirtualKey:init() else self.callback = function () self.keyboard:addChar(self.key) end end - + local label_widget = nil if self.icon then label_widget = ImageWidget:new{ @@ -96,10 +96,6 @@ end function VirtualKey:invert(invert) self[1].invert = invert - UIManager.update_region_func = function() - DEBUG("update key region", self[1].dimen) - return self[1].dimen - end UIManager:setDirty(self.keyboard, "partial") end @@ -114,7 +110,7 @@ local VirtualKeyboard = InputContainer:new{ shiftmode = false, symbolmode = false, utf8mode = false, - + width = 600, height = 256, bordersize = 2, @@ -183,7 +179,7 @@ function VirtualKeyboard:init() icon = "resources/icons/appbar.arrow.enter.png", width = 1.5, }, - + } } self:initLayout(self.layout) @@ -196,7 +192,7 @@ function VirtualKeyboard:initLayout(layout) end return 2 - boolnum(b1) + 2 * boolnum(b2) + 4 * boolnum(b3) end - + if layout then -- to be sure layout is selected properly layout = math.max(layout, self.min_layout) @@ -223,7 +219,7 @@ function VirtualKeyboard:addKeys() local horizontal_group = HorizontalGroup:new{} for j = 1, #self.KEYS[i] do local width_factor = self.KEYS[i][j].width or 1.0 - local key_width = math.floor((base_key_width + self.key_padding) * width_factor) + local key_width = math.floor((base_key_width + self.key_padding) * width_factor) - self.key_padding local key_height = base_key_height local label = self.KEYS[i][j].label or self.KEYS[i][j][self.layout] @@ -236,7 +232,7 @@ function VirtualKeyboard:addKeys() height = key_height, } table.insert(horizontal_group, key) - if j ~= #self.KEYS[i] then + if j ~= #self.KEYS[i] then table.insert(horizontal_group, h_key_padding) end end @@ -245,7 +241,7 @@ function VirtualKeyboard:addKeys() table.insert(vertical_group, v_key_padding) end end - + local size = vertical_group:getSize() local keyboard_frame = FrameContainer:new{ margin = 0, diff --git a/koreader-base b/koreader-base index 34a26b30c..88e83badb 160000 --- a/koreader-base +++ b/koreader-base @@ -1 +1 @@ -Subproject commit 34a26b30c2fb85f4520c07a8b4cd3ead51297f18 +Subproject commit 88e83badbc4d0a06a99d53ea5003c3e19f539f9d