Search…
RootCanvasView

Hierarchy

  • View
    RootCanvasView

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

+ new RootCanvasView(context: Context, canvas: Canvas): RootCanvasView
Overrides View.constructor
Parameters:
Name
Type
context
Context
canvas
Canvas
Returns: RootCanvasView

Properties

Protected Optional backgroundColor

backgroundColor? : undefined | string

Protected Optional borderColor

borderColor? : undefined | string
Inherited from RootCanvasView.borderColor

Protected Optional borderRect

borderRect? : Rect
Inherited from RootCanvasView.borderRect

Readonly context

context: Context
Inherited from RootCanvasView.context

Protected height

height: number = 0
Inherited from RootCanvasView.height

Optional id

id? : undefined | number
Inherited from RootCanvasView.id

Protected innerRect

innerRect: Rect = new Rect(0)
Inherited from RootCanvasView.innerRect
This are the bounds of view including padding.

Protected lp

lp: LayoutParams = new LayoutParams()
Inherited from RootCanvasView.lp

Readonly name

name: string
Inherited from RootCanvasView.name

offsetRect

offsetRect: Rect = new Rect(0)
Inherited from RootCanvasView.offsetRect
This are the bounds of view absolute offset.

Protected Optional onMount

onMount? : undefined | function
Inherited from RootCanvasView.onMount

Protected rect

rect: Rect = new Rect(0)
Inherited from RootCanvasView.rect
This are bounds of a view including margin and padding

Protected visibility

visibility: Visibility = Visibility.VISIBLE
Inherited from RootCanvasView.visibility

Protected width

width: number = 0
Inherited from RootCanvasView.width

Accessors

innerHeight

get innerHeight(): number
Inherited from RootCanvasView.innerHeight
Returns: number

innerWidth

get innerWidth(): number
Inherited from RootCanvasView.innerWidth
Returns: number

Methods

addChild

addChild(child: View, position: number): void
Inherited from RootCanvasView.addChild
Parameters:
Name
Type
Default
child
View
-
position
number
-1
Returns: void

destroy

destroy(): void
Inherited from RootCanvasView.destroy
Returns: void

dispatchPointerEvent

dispatchPointerEvent(event: CanvasPointerEvent): boolean
Parameters:
Name
Type
Returns: boolean

draw

draw(canvas: ViewCanvas): void
Overrides TextView.draw
Parameters:
Name
Type
canvas
Returns: void

getBackgroundColor

getBackgroundColor(): undefined | string
Returns: undefined | string

getBorder

getBorder(): undefined | string
Inherited from RootCanvasView.getBorder
Returns: undefined | string

getBorderColor

getBorderColor(): undefined | string
Inherited from RootCanvasView.getBorderColor
Returns: undefined | string

getCanvas

getCanvas(): HTMLCanvasElement
Returns: HTMLCanvasElement

getId

getId(): undefined | string | number
Inherited from RootCanvasView.getId
Returns: undefined | string | number

getInternalWrappedHeight

getInternalWrappedHeight(_canvas: ViewCanvas): number | undefined
Parameters:
Name
Type
_canvas
Returns: number | undefined

getInternalWrappedWidth

getInternalWrappedWidth(_canvas: ViewCanvas): number | undefined
Parameters:
Name
Type
_canvas
Returns: number | undefined

getLayoutParams

getLayoutParams(): LayoutParams‹›
Returns: LayoutParams‹›

getMatchParentHeight

getMatchParentHeight(): number
Returns: number

getMatchParentWidth

getMatchParentWidth(): number
Returns: number

getOnMount

getOnMount(): undefined | function
Inherited from RootCanvasView.getOnMount
Returns: undefined | function

getParent

getParent(): null | ViewViewProps
Inherited from RootCanvasView.getParent
Returns: null | ViewViewProps

getRootView

getRootView(): ViewViewProps
Inherited from RootCanvasView.getRootView
Returns: ViewViewProps

getScale

getScale(): number
Returns: number

getVisibility

getVisibility(): Visibility
Inherited from RootCanvasView.getVisibility
Returns: Visibility

hasParent

hasParent(): boolean
Inherited from RootCanvasView.hasParent
Returns: boolean

layout

layout(force?: undefined | false | true): void
Inherited from RootCanvasView.layout
Prepares the layout for all children
Parameters:
Name
Type
force?
undefined | false | true
Returns: void

measure

measure(canvas: ViewCanvas, force?: undefined | false | true): void
Inherited from RootCanvasView.measure
Measures the component and adjusts it's dimensions to min/max width and height values.
Parameters:
Name
Type
canvas
force?
undefined | false | true
Returns: void
true if width or height changed, false otherwise

mount

mount(): void
Inherited from RootCanvasView.mount
Returns: void

onDestroy

onDestroy(): void
Overrides TextView.onDestroy
Returns: void

onDraw

onDraw(_canvas: ViewCanvas): void
Inherited from RootCanvasView.onDraw
Parameters:
Name
Type
_canvas
Returns: void

onLayout

onLayout(): void
Inherited from RootCanvasView.onLayout
Returns: void

onMeasure

onMeasure(width: number, height: number): object
Inherited from RootCanvasView.onMeasure
Parameters:
Name
Type
width
number
height
number
Returns: object
  • height: number
  • width: number

onPointerEvent

onPointerEvent(_event: CanvasPointerEvent): boolean
Inherited from RootCanvasView.onPointerEvent
Parameters:
Name
Type
_event
Returns: boolean

onSizeChanged

onSizeChanged(): void
Overrides TextView.onSizeChanged
Returns: void

onSnapshot

onSnapshot(): object
Overrides View.onSnapshot
Returns: object
  • dpr: number = this.dpr

removeChild

removeChild(child: View | number): void
Inherited from RootCanvasView.removeChild
Parameters:
Name
Type
child
View | number
Returns: void

removeChildAt

removeChildAt(startIndex: number, endIndex: number): void
Inherited from RootCanvasView.removeChildAt
Parameters:
Name
Type
Default
startIndex
number
-
endIndex
number
startIndex + 1
Returns: void

require

require(requiredChanges: RequiredViewChanges): void
Overrides TextView.require
Parameters:
Name
Type
requiredChanges
Returns: void

requireGuard

requireGuard(requiredChanges: RequiredViewChanges): boolean
Inherited from RootCanvasView.requireGuard
Parameters:
Name
Type
requiredChanges
Returns: boolean

requireGuardAndTake

requireGuardAndTake(requiredChanges: RequiredViewChanges, force?: undefined | false | true): boolean
Parameters:
Name
Type
requiredChanges
force?
undefined | false | true
Returns: boolean

resolvePositionDependencies

resolvePositionDependencies(): void
Prepare arrays of children ordered horizontally and vertically, so that they could be measured in a single pass, without waiting for their dependencies to be resolved.
This has to be called before measure whenever child's layoutParams change or views are added/removed.
throws an error in case of unresolvable dependency (circular or lack of required view)
Returns: void

run

run(): void
Returns: void

screenshot

screenshot(): string | undefined
Inherited from RootCanvasView.screenshot
Returns: string | undefined

setBackgroundColor

setBackgroundColor(backgroundColor: string | undefined): void
Parameters:
Name
Type
backgroundColor
string | undefined
Returns: void

setBorder

setBorder(borderRect: RectLike | undefined): void
Inherited from RootCanvasView.setBorder
Parameters:
Name
Type
borderRect
RectLike | undefined
Returns: void

setBorderColor

setBorderColor(borderColor: string | undefined): void
Inherited from RootCanvasView.setBorderColor
Parameters:
Name
Type
borderColor
string | undefined
Returns: void

setChildAt

setChildAt(child: View, position: number): void
Inherited from RootCanvasView.setChildAt
Parameters:
Name
Type
child
View
position
number
Returns: void

setDebugEnabled

setDebugEnabled(enabled: boolean): void
Parameters:
Name
Type
enabled
boolean
Returns: void

setId

setId(id?: undefined | string): void
Inherited from RootCanvasView.setId
Parameters:
Name
Type
id?
undefined | string
Returns: void

setLayoutParams

setLayoutParams(lp: LayoutParams): void
Parameters:
Name
Type
lp
Returns: void

setOnMount

setOnMount(callback: function): void
Inherited from RootCanvasView.setOnMount
Parameters:
callback: function
▸ (view: View‹any›): void
Parameters:
Name
Type
view
View‹any›
Returns: void

setVisibility

setVisibility(visibility: Visibility): void
Inherited from RootCanvasView.setVisibility
Parameters:
Name
Type
Default
visibility
Visibility.VISIBLE
Returns: void

setupPointerEvents

setupPointerEvents(): void
Returns: void

snapshot

snapshot(): object
Inherited from RootCanvasView.snapshot
Returns: object
Export as PDF
Copy link
On this page
Hierarchy
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Properties
Protected Optional backgroundColor
Protected Optional borderColor
Protected Optional borderRect
Readonly context
Protected height
Optional id
Protected innerRect
Protected lp
Readonly name
offsetRect
Protected Optional onMount
Protected rect
Protected visibility
Protected width
Accessors
innerHeight
innerWidth
Methods
addChild
destroy
dispatchPointerEvent
draw
getBackgroundColor
getBorder
getBorderColor
getCanvas
getId
getInternalWrappedHeight
getInternalWrappedWidth
getLayoutParams
getMatchParentHeight
getMatchParentWidth
getOnMount
getParent
getRootView
getScale
getVisibility
hasParent
layout
measure
mount
onDestroy
onDraw
onLayout
onMeasure
onPointerEvent
onSizeChanged
onSnapshot
removeChild
removeChildAt
require
requireGuard
requireGuardAndTake
resolvePositionDependencies
run
screenshot
setBackgroundColor
setBorder
setBorderColor
setChildAt
setDebugEnabled
setId
setLayoutParams
setOnMount
setVisibility
setupPointerEvents
snapshot