Paràmetres de la pantalla#

There are two variables that set the content scaling for Lomiri and Ubuntu Touch applications: GRID_UNIT_PX and QTWEBKIT_DPR.

There are also other options available that may be useful for you depending on your device’s form factor. These are mentioned below and explained in depth in the section on display settings.

All of these settings are guessed by Unity 8 if none are set. There are many cases, however, where the guess is wrong (for example, very high resolution phone displays will be identified as desktop computers). To manually set a value for these variables, simply edit the file at etc/ubuntu-touch-session.d/android.conf specifying them. For example, this is the file for the Nexus 7 tablet:

$ cat /etc/ubuntu-touch-session.d/flo.conf
GRID_UNIT_PX=18
QTWEBKIT_DPR=2.0
NATIVE_ORIENTATION=landscape
FORM_FACTOR=tablet

The method for deriving values for these variables is explained below.

Once you have adjusted the android.conf file to the display settings needed for your device, this file should be incorporated into your build. Follow the overlay file method corresponding to your Halium version.

Nota

This way of configuration is considered legacy and will be replaced by DeviceInfo in the future. For migration purposes please set both configurations (android.conf as well as DeviceInfo).

Determining the correct display settings#

Escalat de la pantalla#

GRID_UNIT_PX (Píxels per unitat de quadrícula o Px/GU) és específica per a cada dispositiu. El seu objectiu és fer que la interfície d’usuari del sistema i de les seves aplicacions tinguin la mateixa mida «percebuda» independentment del dispositius on es visualitzen. Principalment depèn de la densitat de píxels de la pantalla del dispositiu i la distància a la pantalla on es troba l’usuari. Aquest últim valor no pot ser detectat automàticament i es basa en l’heurística. Fem el supòsit que les tauletes i els ordinadors portàtils se sostenen a la mateixa distància i que se sostenen a 1.235 cops la distància a la qual se sostenen els telèfons.

``QTWEBKIT_DPR``estableix l’escalat de la pantalla per al motor de web Oxide, de manera que els canvis a aquest valor afectarà l’escalat del navegadors i les aplicacions web.

A reference device has been chosen from which we derive the values for all other devices. The reference device is a laptop with a 120ppi screen. However, there is no exact formula since these options are set for perceived size rather than physical size. Here are some values for other devices so you may derive the correct one for yours:

Dispositiu

Resolució

Mida de la pantalla

PPI

Px/GU

QtWebKit DPR

Ordinador portàtil amb densitat “normal”

N/D

N/D

96-150

8

1.0

ASUS Nexus 7

1280x800

216

12

2.0

Ordinador portàtil de densitat “alta”

N/D

N/D

150-250

16

1.5

Samsung Galaxy Nexus

1280x720

4.65»

316

18

2.0

LG Nexus 4

1280x768

4.7»

320

18

2.0

Samsung Nexus 10

2560x1600

10.1»

299

20

2.0

Fairphone 2

1080x1920

440

23

2.5

LG Nexus 5

1080x1920

4.95»

445

23

2.5

Experimenteu amb alguns pocs valores per trobar un amb el que us sentiu a gust quan compareu amb l’experiència de l’Utuntu Touch a d’altres dispositius. SI no teniu seguretat de quin és el millor, compartiu amb nosaltres algunes fotografies (incloent-hi algun objecte per escalar) junt amb les especificacions del dispositiu.

There are two other settings that may be of interest to you:

Factor de forma#

FORM_FACTOR specifies the device’s form factor. This value is set as the device’s Chassis, which you can find by running hostnamectl. The acceptable values are handset, tablet, laptop and desktop. Apps such as the gallery use this information to change their functionality. For more information on the Chassis, see the freedesktop.org hostnamed specification.

Native orientation#

NATIVE_ORIENTATION estableix l’orientació de la pantalla per a la pantalla incorporada del dispositiu. Aquest valor s’usa sempre que la rotació automàtica no estigui funcionant correctament o quan una aplicació vol acoblar-se a l’orientació nativa. Els valors acceptables són landscape (horitzontal), que s’usa normalment per a tauletes, ordinadors portàtils i d’escriptori; i portrait (vertical), que s’usa generalment per a telèfons mòbils.