▪ _Props: Record‹string, any›
+ new View(context
: Context, name
: string): View
Parameters:
Returns: View
Protected
Optional
backgroundColor• backgroundColor? : undefined | string
Protected
Optional
borderColor• borderColor? : undefined | string
Protected
Optional
borderRect• borderRect? : Rect
Readonly
context• context: Context
Protected
height• height: number = 0
Optional
id• id? : undefined | number
Protected
innerRect• innerRect: Rect = new Rect(0)
This are the bounds of view including padding.
Protected
lp• lp: LayoutParams = new LayoutParams()
Readonly
name• name: string
• offsetRect: Rect = new Rect(0)
This are the bounds of view absolute offset.
Protected
Optional
onMount• onMount? : undefined | function
Protected
rect• rect: Rect = new Rect(0)
This are bounds of a view including margin and padding
Protected
visibility• visibility: Visibility = Visibility.VISIBLE
Protected
width• width: number = 0
• get innerHeight(): number
Returns: number
• get innerWidth(): number
Returns: number
▸ addChild(child
: View, position
: number): void
Parameters:
Returns: void
▸ destroy(): void
Returns: void
▸ dispatchPointerEvent(event
: CanvasPointerEvent): boolean
Parameters:
Returns: boolean
▸ draw(canvas
: ViewCanvas, force
: boolean): void
Parameters:
Returns: void
▸ getBackgroundColor(): undefined | string
Returns: undefined | string
▸ getBorder(): undefined | string
Returns: undefined | string
▸ getBorderColor(): undefined | string
Returns: undefined | string
▸ getId(): undefined | string | number
Returns: undefined | string | number
▸ getInternalWrappedHeight(_canvas
: ViewCanvas): number | undefined
Parameters:
Returns: number | undefined
▸ getInternalWrappedWidth(_canvas
: ViewCanvas): number | undefined
Parameters:
Returns: number | undefined
▸ getLayoutParams(): LayoutParams‹›
Returns: LayoutParams‹›
▸ getMatchParentHeight(): number
Returns: number
▸ getMatchParentWidth(): number
Returns: number
▸ getOnMount(): undefined | function
Returns: undefined | function
▸ getParent(): null | View‹ViewProps›
Returns: null | View‹ViewProps›
▸ getRootView(): View‹ViewProps›
▸ getVisibility(): Visibility
Returns: Visibility
▸ hasParent(): boolean
Returns: boolean
▸ layout(force?
: undefined | false | true): void
Prepares the layout for all children
Parameters:
Returns: void
▸ measure(canvas
: ViewCanvas, force?
: undefined | false | true): void
Measures the component and adjusts it's dimensions to min/max width and height values.
Parameters:
Returns: void
true if width or height changed, false otherwise
▸ mount(): void
Returns: void
▸ onDestroy(): void
Returns: void
▸ onDraw(_canvas
: ViewCanvas): void
Parameters:
Returns: void
▸ onLayout(): void
Returns: void
▸ onMeasure(width
: number, height
: number): object
Parameters:
Returns: object
height: number
width: number
▸ onPointerEvent(_event
: CanvasPointerEvent): boolean
Parameters:
Returns: boolean
▸ onSizeChanged(_width
: number, _height
: number, _oldWidth
: number, _oldHeight
: number): void
Parameters:
Returns: void
▸ onSnapshot(): object
Returns: object
▸ removeChild(child
: View | number): void
Parameters:
Returns: void
▸ removeChildAt(startIndex
: number, endIndex
: number): void
Parameters:
Returns: void
▸ require(requiredChanges
: RequiredViewChanges): void
Parameters:
Returns: void
▸ requireGuard(requiredChanges
: RequiredViewChanges): boolean
Parameters:
Returns: boolean
▸ requireGuardAndTake(requiredChanges
: RequiredViewChanges, force?
: undefined | false | true): boolean
Parameters:
Returns: boolean
▸ 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
▸ screenshot(): string | undefined
Returns: string | undefined
▸ setBackgroundColor(backgroundColor
: string | undefined): void
Parameters:
Returns: void
▸ setBorder(borderRect
: RectLike | undefined): void
Parameters:
Returns: void
▸ setBorderColor(borderColor
: string | undefined): void
Parameters:
Returns: void
▸ setChildAt(child
: View, position
: number): void
Parameters:
Returns: void
▸ setId(id?
: undefined | string): void
Parameters:
Returns: void
▸ setLayoutParams(lp
: LayoutParams): void
Parameters:
Returns: void
▸ setOnMount(callback
: function): void
Parameters:
▪ callback: function
▸ (view
: View‹any›): void
Parameters:
Returns: void
▸ setVisibility(visibility
: Visibility): void
Parameters:
Returns: void
▸ snapshot(): object
Returns: object
Name | Type | Default |
---|---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
context
-
name
string
"View"
child
-
position
number
-1
event
canvas
-
force
boolean
false
_canvas
_canvas
force?
undefined | false | true
canvas
force?
undefined | false | true
_canvas
width
number
height
number
_event
_width
number
_height
number
_oldWidth
number
_oldHeight
number
child
View | number
startIndex
number
-
endIndex
number
startIndex + 1
requiredChanges
requiredChanges
requiredChanges
force?
undefined | false | true
backgroundColor
string | undefined
borderRect
RectLike | undefined
borderColor
string | undefined
child
position
number
id?
undefined | string
lp
view
View‹any›
visibility
Visibility.VISIBLE