Packagefeathers.system
Classpublic class DeviceCapabilities
InheritanceDeviceCapabilities Inheritance Object

Product Version : Feathers 1.0.0

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



Public Properties
 PropertyDefined By
  dpi : int
[static] The screen density to be used by Feathers.
DeviceCapabilities
  largePhoneScreenLandscapeWidthMinimumInches : Number = 4.5
[static] The minimum physical size, in inches, of the device's larger side to be considered a large phone (sometimes called a phablet).
DeviceCapabilities
  largePhoneScreenPortraitWidthMinimumInches : Number = 2.5
[static] The minimum physical width, in inches, of the device when in portrait orientation to be considered a large phone (sometimes called a phablet).
DeviceCapabilities
  screenPixelHeight : Number = NaN
[static] A custom height, in pixels, to use for calculations of the device's physical screen size.
DeviceCapabilities
  screenPixelWidth : Number = NaN
[static] A custom width, in pixels, to use for calculations of the device's physical screen size.
DeviceCapabilities
  simulateDPad : Boolean = false
[static] Indicates if the arrow and enter keys on a standard keyboard are treated the same as a d-pad.
DeviceCapabilities
  tabletScreenLandscapeWidthMinimumInches : Number = 5
[static] The minimum physical size, in inches, of the device's larger side to be considered a tablet.
DeviceCapabilities
  tabletScreenPortraitWidthMinimumInches : Number = 3.5
[static] The minimum physical width, in inches, of the device when in portrait orientation to be considered a tablet.
DeviceCapabilities
Public Methods
 MethodDefined By
  
isLargePhone(stage:Stage = null):Boolean
[static] Determines if this device is probably a large phone (sometimes called a phablet), based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen density.
DeviceCapabilities
  
isPhone(stage:Stage = null):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 density.
DeviceCapabilities
  
isTablet(stage:Stage = null):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 density.
DeviceCapabilities
  
screenInchesX(stage:Stage = null):Number
[static] The physical width of the device, in inches.
DeviceCapabilities
  
screenInchesY(stage:Stage = null):Number
[static] The physical height of the device, in inches.
DeviceCapabilities
Property Detail
dpiproperty
public static var dpi:int

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

Warning: You should avoid changing this value on a mobile device because it may result in unexpected side effects. In addition to being used to scale components in the example themes, the screen density is used by components such as Scroller (and its subclasses like List and ScrollContainer) to optimize the scrolling behavior. Reporting a different screen density may cause some components to appear poorly responsive (or overly sensitive) to touches.

The default value is flash.system.Capabilities.screenDPI.

See also

largePhoneScreenLandscapeWidthMinimumInchesproperty 
public static var largePhoneScreenLandscapeWidthMinimumInches:Number = 4.5

The minimum physical size, in inches, of the device's larger side to be considered a large phone (sometimes called a phablet).

When calling isLargePhone(), a device must meet the requirements of both the minimum portrait width and the minimum landscape width.

The default value is 4.5.

See also

largePhoneScreenPortraitWidthMinimumInchesproperty 
public static var largePhoneScreenPortraitWidthMinimumInches:Number = 2.5

The minimum physical width, in inches, of the device when in portrait orientation to be considered a large phone (sometimes called a phablet).

When calling isLargePhone(), a device must meet the requirements of both the minimum portrait width and the minimum landscape width.

The default value is 2.5.

See also

screenPixelHeightproperty 
public static var screenPixelHeight:Number = NaN

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

The default value is flash.display.Stage.fullScreenHeight.

See also

screenPixelWidthproperty 
public static var screenPixelWidth:Number = NaN

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

The default value is flash.display.Stage.fullScreenWidth.

See also

simulateDPadproperty 
public static var simulateDPad:Boolean = false

Product Version : Feathers 3.4.0

Indicates if the arrow and enter keys on a standard keyboard are treated the same as a d-pad. If true, focus and other behaviors may be controlled with a standard keyboard.

In the following example, the D-Pad is simulated:

DeviceCapabilities.simulateDPad = true;

The default value is false.

tabletScreenLandscapeWidthMinimumInchesproperty 
public static var tabletScreenLandscapeWidthMinimumInches:Number = 5

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

When calling isTablet(), a device must meet the requirements of both the minimum portrait width and the minimum landscape width.

The default value is 5.

See also

tabletScreenPortraitWidthMinimumInchesproperty 
public static var tabletScreenPortraitWidthMinimumInches:Number = 3.5

The minimum physical width, in inches, of the device when in portrait orientation to be considered a tablet.

When calling isTablet(), a device must meet the requirements of both the minimum portrait width and the minimum landscape width.

The default value is 3.5.

See also

Method Detail
isLargePhone()method
public static function isLargePhone(stage:Stage = null):Boolean

Determines if this device is probably a large phone (sometimes called a phablet), based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen density.

Parameters

stage:Stage (default = null)

Returns
Boolean

See also

isPhone()method 
public static function isPhone(stage:Stage = null):Boolean

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 density.

Returns true if the device is smaller than the minimum dimensions of a tablet. Larger phones (sometimes called phablets) are classified as phones when calling isPhone(). If isPhone() returns true, use isLargePhone() to determine the size of the phone, if necessary.

Parameters

stage:Stage (default = null)

Returns
Boolean

See also

isTablet()method 
public static function isTablet(stage:Stage = null):Boolean

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 density.

Parameters

stage:Stage (default = null)

Returns
Boolean

See also

screenInchesX()method 
public static function screenInchesX(stage:Stage = null):Number

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

Parameters

stage:Stage (default = null)

Returns
Number

See also

screenInchesY()method 
public static function screenInchesY(stage:Stage = null):Number

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

Parameters

stage:Stage (default = null)

Returns
Number

See also