Screen

KaiOS devices have a QVGA resolution screen, all of which are in portrait mode. Only one device as of October 10, 2020 is landscape default.

Rotating the screen

There are two ways to do this.

Method 1

You can rotate the screen by calling screen.orientation.lock(ori), where ori is either portrait or landscape. Portrait is the device's normal orientation, and landscape is by default the device rotated sideways in a counter-clockwise motion.
Possible values are:
portrait-primary phone
portrait-secondary phone180
landscape-primary phone270
landscape-secondary phone90

Here's some code that will rotate the screen all around.

function rotate() {
    switch(screen.orientation.type) {
        case 'portrait-primary': screen.orientation.lock('landscape-primary'); break;
        case 'landscape-primary': screen.orientation.lock('portrait-secondary'); break;
        case 'portrait-secondary': screen.orientation.lock('landscape-secondary'); break;
        case 'landscape-secondary': screen.orientation.lock('portrait-primary'); break;
    }
}

Method 2

You can set an orientation in the manifest.webapp.

"orientation": "landscape"

Possible values are the same as in method 1.

Fullscreen

The default screen size for application that aren't fullscreen is 240x394 in portrait, or 320x214 in landscape. To find out how use the entire screen, refer to this page.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License