DeviceCapabilities

public class
feathers.system.DeviceCapabilities

Description

Using values from the Stage and Capabilities classes, makes educated guesses about the physical size of the device this code is running on.

API overview

Constructor

DeviceCapabilities ()

Attributes

Public attributes

dpi: Number static

The DPI to be used by Feathers

screenPixelHeight: Number static

A custom height, in pixels, to use for calculations of the device's physical screen size

screenPixelWidth: Number static

A custom width, in pixels, to use for calculations of the device's physical screen size

tabletScreenMinimumInches: Number static

The minimum physical size, in inches, of the device's larger side to be considered a tablet

Functions

Public functions

isPhone (): Boolean static

Determines if this device is probably a phone, based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen DPI

isTablet (): Boolean static

Determines if this device is probably a tablet, based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen DPI

screenInchesX (): Number static

The physical width of the device, in inches

screenInchesY (): Number static

The physical height of the device, in inches

Constructor

DeviceCapabilities ()

Attributes

dpi: Number

static

The DPI to be used by Feathers. Defaults to the value of Capabilities.screenDPI, but may be overridden. For example, if one wishes to demo a mobile app in the desktop browser, a custom DPI will override the real DPI of the desktop screen.

screenPixelHeight: Number

static

A custom height, in pixels, to use for calculations of the device's physical screen size. Set to NaN to use the actual height.

screenPixelWidth: Number

static

A custom width, in pixels, to use for calculations of the device's physical screen size. Set to NaN to use the actual width.

tabletScreenMinimumInches: Number

static

The minimum physical size, in inches, of the device's larger side to be considered a tablet.

Functions

getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

isPhone (): Boolean

static

Determines if this device is probably a phone, based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen DPI.



isTablet (): Boolean

static

Determines if this device is probably a tablet, based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen DPI.



screenInchesX (): Number

static

The physical width of the device, in inches. Calculated using the full-screen width and the screen DPI.



screenInchesY (): Number

static

The physical height of the device, in inches. Calculated using the full-screen height and the screen DPI.



toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.