Add bloks integration infra + Layout result wrapper
Summary: This adds the base infra for the UIDebugger bloks integration as well as an implementation for the Layout result wrapper for bloks. When theUIDebugger is connected we wrap the original layout result with a debug varient that delegates all methods to the original layout result but also provides access to the bloks model. This allows the UIDebugger to inspect the Layout result and bloks model together Reviewed By: pasqualeanatriello Differential Revision: D43444444 fbshipit-source-id: ac531a0c7491c05db1d6f7671e3ab09c73c213b9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
42320e1c09
commit
98b94d62cf
@@ -31,6 +31,8 @@ class UIDebuggerFlipperPlugin(val context: UIDContext) : FlipperPlugin {
|
||||
|
||||
@Throws(Exception::class)
|
||||
override fun onConnect(connection: FlipperConnection) {
|
||||
isConnected = true
|
||||
|
||||
Log.i(LogTag, "Connected")
|
||||
this.context.connectionRef.connection = connection
|
||||
this.context.bitmapPool.makeReady()
|
||||
@@ -54,6 +56,7 @@ class UIDebuggerFlipperPlugin(val context: UIDContext) : FlipperPlugin {
|
||||
|
||||
@Throws(Exception::class)
|
||||
override fun onDisconnect() {
|
||||
isConnected = false
|
||||
this.context.connectionRef.connection = null
|
||||
Log.i(LogTag, "Disconnected")
|
||||
|
||||
@@ -66,4 +69,9 @@ class UIDebuggerFlipperPlugin(val context: UIDContext) : FlipperPlugin {
|
||||
override fun runInBackground(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
companion object {
|
||||
var isConnected: Boolean = false
|
||||
private set
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user