View Single Post
Old 03-29-2021, 04:36 PM   #350
pazos
cosiņeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,271
Karma: 2200049
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Xwang View Post
Is it possible to save the orientation of the screen?
Each time I start KOReader on my tablet it opens in landscape mode despite the fact that the tablet is in portrait mode with automatic rotation.
KOReader does not change orientation when I turn the device and its way to rotate are a bit counter-intuitive so once I've found the correct portrait mode I would like it to be the default one.
Nope. Default orientation was forced to portrait in the past but was changed to "nosensor" because that uses whatever rotation your device uses. AFAICT the rotation matches the boot logo.

Returning back to portrait will make the app unoperative on landscape devices, like Android TV or chrome OS.

This has nothing to do with dealing with gyro events. That's just how the app is started.

About gyro events: they're handled automatically by the framework and we already have all the code to make it happens. See https://github.com/koreader/android-....lua#L480-L493. All these modes work fine but just the 4 (landscape, portrait and their reversed modes) are available using the UI.


Patches welcome to make the UI more complete. In the mean time if you want to have full sensor behaviour you'll need a patch.lua with something like

Code:
local ffi = require("ffi")
local android = require("android")
local C = ffi.C
android.orientation.set(C.ASCREEN_ORIENTATION_FULL_SENSOR)
placed in /sdcard/koreader

Last edited by pazos; 11-28-2021 at 12:28 PM. Reason: link updated
pazos is offline   Reply With Quote