* A Valdi context uniquely identifies a view tree inflated by Valdi. It is * backed by a native instance. */
| 29 | * backed by a native instance. |
| 30 | */ |
| 31 | @Keep |
| 32 | class 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 |
no test coverage detected