MCPcopy Create free account
hub / github.com/Snapchat/Valdi / ValdiContext

Class ValdiContext

valdi/src/java/com/snap/valdi/context/ValdiContext.kt:31–540  ·  view source on GitHub ↗

* A Valdi context uniquely identifies a view tree inflated by Valdi. It is * backed by a native instance. */

Source from the content-addressed store, hash-verified

29 * backed by a native instance.
30 */
31@Keep
32class ValdiContext(val native: ContextNative,
33 contextId: ValdiContextId,
34 componentPath: String,
35 moduleName: String,
36 moduleOwnerName: String,
37 val logger: Logger): IValdiContext {
38
39 var performGcOnDestroy = false
40
41 override val contextId: ValdiContextId
42
43 val componentPath: String
44 val moduleName: String
45 val moduleOwnerName: String
46
47 val bundleName: String
48 get() = moduleName
49
50 var usesSnapDrawingRenderBackend = false
51 internal set
52
53 internal var rootViewHandler: IRootViewHandler? = null
54
55 val actions: ValdiActions
56 get() {
57 return synchronized(this) {
58 if (innerActions == null) {
59 innerActions = ValdiActions(ValdiActionHandlerHolder())
60 }
61
62 innerActions!!
63 }
64 }
65
66 /**
67 * The actionHandler is the object that will respond to actions/touch events.
68 */
69 var actionHandler: Any?
70 get() = actions.actionHandlerHolder.actionHandler
71 set(value) { actions.actionHandlerHolder.actionHandler = value }
72
73 val runtime: ValdiRuntime
74 get() {
75 return native.getRuntime()!!
76 }
77
78 val runtimeOrNull: ValdiRuntime?
79 get() {
80 return native.getRuntime()
81 }
82
83 var componentContext: WeakReference<Any>? = null
84
85 /**
86 * The owner for this context
87 */
88 var owner: ValdiViewOwner? = null

Callers 1

createContextMethod · 0.85

Calls 11

ValdiActionsClass · 0.85
ValdiFatalExceptionClass · 0.85
runOnMainThreadIfNeededFunction · 0.85
setValdiContextMethod · 0.80
setViewNodeIdMethod · 0.80
contextIsReadyMethod · 0.80
getRuntimeMethod · 0.45
setViewModelMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected