Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' into decouple
  • Loading branch information
Frenzie committed Mar 3, 2019
2 parents 0e2a3f1 + be407d1 commit 60ad49b
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -352,7 +352,7 @@ androidupdate: all
cd $(INSTALL_DIR)/koreader && 7z a -l -m0=lzma2 -mx=1 \
../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-$(VERSION).7z * \
-x!resources/fonts -x!resources/icons/src -x!spec
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) $(if $(KODEBUG), debug, release) ANDROID_VERSION=$(ANDROID_VERSION) ANDROID_NAME=$(ANDROID_NAME)
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) $(if $(KODEBUG), debug, release) ANDROID_VERSION=$(ANDROID_VERSION) ANDROID_NAME=$(ANDROID_NAME) ANDROID_FLAVOR=$(ANDROID_FLAVOR)
cp $(ANDROID_LAUNCHER_DIR)/bin/NativeActivity.apk \
koreader-android-$(MACHINE)-$(VERSION).apk

Expand Down
5 changes: 5 additions & 0 deletions frontend/apps/reader/modules/readercropping.lua
Expand Up @@ -85,6 +85,11 @@ function ReaderCropping:onPageCrop(mode)
self:setCropZoomMode(true)
end
return
elseif mode == "none" then
if self.document.configurable.text_wrap ~= 1 then
self.ui:handleEvent(Event:new("SetZoomMode", "pagewidth", "cropping"))
end
return
end
-- backup original view dimen
self.orig_view_dimen = Geom:new{w = self.view.dimen.w, h = self.view.dimen.h}
Expand Down
10 changes: 10 additions & 0 deletions frontend/apps/reader/modules/readerfont.lua
Expand Up @@ -383,6 +383,16 @@ function ReaderFont:buildFontsTestDocument()
<html>
<head>
<title>%s</title>
<style>
section > title {
font-size: large;
font-weight: bold;
text-align: center;
page-break-before: always;
margin-bottom: 0.5em;
}
a { color: black; }
</style>
</head>
<body>
<section id="list"><title>%s</title></section>
Expand Down
11 changes: 8 additions & 3 deletions frontend/device/android/device.lua
Expand Up @@ -10,6 +10,11 @@ local T = require("ffi/util").template
local function yes() return true end
local function no() return false end

local function canUpdateApk()
-- disable updates on fdroid builds, since they manage their own repo.
return (android.getFlavor() ~= "fdroid")
end

local Device = Generic:new{
model = android.getProduct(),
hasKeys = yes,
Expand All @@ -21,7 +26,7 @@ local Device = Generic:new{
display_dpi = android.lib.AConfiguration_getDensity(android.app.config),
hasClipboard = yes,
hasColorScreen = yes,
hasOTAUpdates = yes,
hasOTAUpdates = canUpdateApk,
--[[
Disable jit on some modules on android to make koreader on Android more stable.
Expand Down Expand Up @@ -152,7 +157,7 @@ local function getCodename()
return codename or ""
end

android.LOGI(string.format("Android %s - %s (API %d)",
android.getVersion(), getCodename(), Device.firmware_rev))
android.LOGI(string.format("Android %s - %s (API %d) - flavor: %s",
android.getVersion(), getCodename(), Device.firmware_rev, android.getFlavor()))

return Device
6 changes: 3 additions & 3 deletions frontend/ui/data/koptoptions.lua
Expand Up @@ -28,13 +28,13 @@ local KoptOptions = {
{
name = "trim_page",
name_text = S.PAGE_CROP,
toggle = {S.MANUAL, S.AUTO, S.SEMIAUTO},
toggle = {S.MANUAL, S.AUTO, S.SEMIAUTO, S.NONE},
alternate = false,
values = {0, 1, 2},
values = {0, 1, 2, 3},
default_value = DKOPTREADER_CONFIG_TRIM_PAGE,
enabled_func = Device.isTouchDevice,
event = "PageCrop",
args = {"manual", "auto", "semi-auto"},
args = {"manual", "auto", "semi-auto", "none"},
name_text_hold_callback = optionsutil.showValues,
}
}
Expand Down
1 change: 1 addition & 0 deletions frontend/ui/data/strings.lua
Expand Up @@ -40,6 +40,7 @@ S.OFF = _("off")
S.AUTO = _("auto")
S.MANUAL = _("manual")
S.SEMIAUTO = _("semi-auto")
S.NONE = _("none")
S.SMALL = _("small")
S.MEDIUM = _("medium")
S.LARGE = _("large")
Expand Down
4 changes: 4 additions & 0 deletions kodev
Expand Up @@ -22,6 +22,10 @@ fi
NDKABI=${NDKABI:-14}
export NDKABI

# Default android flavor
ANDROID_FLAVOR=${ANDROID_FLAVOR:-rocks}
export ANDROID_FLAVOR

function assert_ret_zero() {
if [ "${1}" -ne 0 ]; then
if [ -n "${2}" ]; then
Expand Down

0 comments on commit 60ad49b

Please sign in to comment.