mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[Android] misc fixes (#4478)
* use product as device model * print android version (codename + number) + api at launch * exit the application properly * fix fullscreen switching (and disable it on newer android versions) * gettext: lower log level for message: cannot open translation file * android common settings refactor
This commit is contained in:
committed by
Frans de Jonge
parent
81e160692d
commit
b15c2ed0c5
@@ -123,9 +123,29 @@ if Screen.isColorScreen() then
|
||||
else
|
||||
common_settings.screen.sub_item_table[2].separator = true
|
||||
end
|
||||
|
||||
if Device:isAndroid() then
|
||||
table.insert(common_settings.screen.sub_item_table, require("ui/elements/screen_fullscreen_menu_table"))
|
||||
table.insert(common_settings.screen.sub_item_table, require("ui/elements/screen_keep_on_menu_table"))
|
||||
-- android common settings
|
||||
local isAndroid, android = pcall(require, "android")
|
||||
if not isAndroid then return end
|
||||
|
||||
-- keep screen on
|
||||
table.insert(common_settings.screen.sub_item_table,
|
||||
{
|
||||
text = _("Keep screen on"),
|
||||
checked_func = function() return not G_reader_settings:isTrue("disable_android_wakelock") end,
|
||||
callback = function() require("ui/elements/screen_android"):toggleWakelock() end,
|
||||
})
|
||||
|
||||
-- fullscreen
|
||||
if Device.firmware_rev <= 16 then
|
||||
table.insert(common_settings.screen.sub_item_table,
|
||||
{
|
||||
text = _("Fullscreen"),
|
||||
checked_func = function() return android.isFullscreen() end,
|
||||
callback = function() require("ui/elements/screen_android"):toggleFullscreen() end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
if Device:hasKeys() then
|
||||
|
||||
Reference in New Issue
Block a user