Options
All
  • Public
  • Public/Protected
  • All
Menu

Module layout

Utility module related to layout.

Index

Variables

Const AT_MOST

AT_MOST: number

Const EXACTLY

EXACTLY: number

Const MEASURED_HEIGHT_STATE_SHIFT

MEASURED_HEIGHT_STATE_SHIFT: number

Bits that provide the actual measured size.

Const MEASURED_SIZE_MASK

MEASURED_SIZE_MASK: number

Const MEASURED_STATE_MASK

MEASURED_STATE_MASK: number

Const MEASURED_STATE_TOO_SMALL

MEASURED_STATE_TOO_SMALL: number

Const UNSPECIFIED

UNSPECIFIED: number

Functions

getDisplayDensity

  • getDisplayDensity(): number

getMeasureSpecMode

  • getMeasureSpecMode(spec: number): number
  • Gets measure specification mode from a given specification.

    Parameters

    • spec: number

      The measure specification.

    Returns number

getMeasureSpecSize

  • getMeasureSpecSize(spec: number): number
  • Gets measure specification size from a given specification.

    Parameters

    • spec: number

      The measure specification.

    Returns number

getMode

  • getMode(mode: number): string
  • Gets layout mode from a given specification as string.

    Parameters

    • mode: number

      The measure specification mode.

    Returns string

makeMeasureSpec

  • makeMeasureSpec(px: number, mode: number): number
  • Creates measure specification size from size and mode.

    Parameters

    • px: number
    • mode: number

      The mode component of measure specification.

    Returns number

measureNativeView

  • measureNativeView(nativeView: any, width: number, widthMode: number, height: number, heightMode: number): object
  • Converts device pixels to device independent pixes and measure the nativeView. Returns the desired size of the nativeView in device pixels.

    Parameters

    • nativeView: any

      the nativeView to measure (UIView or android.view.View)

    • width: number

      the available width

    • widthMode: number

      width mode - UNSPECIFIED, EXACTLY or AT_MOST

    • height: number

      the available hegiht

    • heightMode: number

      height mode - UNSPECIFIED, EXACTLY or AT_MOST

    Returns object

    • height: number
    • width: number

measureSpecToString

  • measureSpecToString(measureSpec: number): string
  • Prints user friendly version of the measureSpec.

    Parameters

    • measureSpec: number

      the spec to print

    Returns string

round

toDeviceIndependentPixels

  • toDeviceIndependentPixels(value: px): dip
  • Convert device pixels to device independent pixels - px to dip.

    Parameters

    • value: px

      The pixel to convert.

    Returns dip

toDevicePixels

  • toDevicePixels(value: dip): px
  • Convert device independent pixels to device pixels - dip to px.

    Parameters

    • value: dip

      The pixel to convert.

    Returns px

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method