Configuración de 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#

Escala de la pantalla#

GRID_UNIT_PX (píxeles por unidad de cuadrícula o «Px/GU») es específico para cada dispositivo. Su meta es hacer que la interfaz de usuario del sistema y sus aplicaciones se perciban del mismo tamaño independientemente del dispositivo en que se estén mostrando. Depende principalmente de la densidad de píxeles de la pantalla del dispositivo y de la distancia a la pantalla a la que esté el usuario. El último valor no se puede detectar automáticamente y se basa en la heurística. Asumimos la misma distancia para tabletas y portátiles y que están sostenidos a 1,235 veces la distancia a la que se suelen sostener los teléfonos.

QTWEBKIT_DPR configura la escala de la pantalla para el motor web Oxide, así que los cambios a este valor afectarán a la escala del navegador y de las aplicaciones web.

Un dispositivo de referencia ha sido elegido y del cuál derivamos los valores para todos los otros dispositivos. El dispositivo de referencia es un portátil con una pantalla de 120ppi. Sin embargo, no existe una fórmula exacta ya que estas opciones se configuran para un tamaño percibido mas que un tamaño físico. Aquí tiene algunos valores para otros dispositivos para que pueda derivar el correcto para el suyo:

Dispositivo

Resolución

Tamaño de pantalla

PPI

Px/GU

QtWebKit DPR

Portátil con densidad «normal»

N/D

N/D

96-150

8

1.0

ASUS Nexus 7

1280x800

216

12

2.0

Portátil con densidad «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

Experimente con algunos valores hasta encontrar uno con el que se sienta bien comparado con la experiencia de Ubuntu Touch en otros dispositivos. Si no está seguro de cuál es el mejor, comparta con nosotros algunas fotografías (incluyendo algún objeto como escala) así como las especificaciones del dispositivo.

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 configura la orientación de la pantalla incorporada en el dispositivo. Este valor se usa siempre que la rotación automática no esté funcionando correctamente o cuando una aplicación desea estar bloqueada en la orientación nativa del dispositivo. Valores aceptables son landscape (horizontal), que se usa normalmente para tabletas, portátiles y ordenadores de escritorio; y portrait (vertical), que se usa generalmente en teléfonos móviles.